-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.53 KB
/
Copy pathreact.yml
File metadata and controls
58 lines (48 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: React CI
on: push
jobs:
unit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-nodemodules-
- name: Install dependencies
run: yarn install
- name: Run unit tests
run: yarn test --coverage --passWithNoTests
env:
CI: false
- name: Report Coverage
uses: davelosert/vitest-coverage-report-action@v2
if: always() # Also generate the report if tests are failing
with:
working-directory: packages/client
e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: yarn install
- name: Check Cypress tests exist
id: check_cypress_tests
uses: andstor/file-existence-action@v2
with:
files: 'packages/client/cypress/e2e/'
- name: Install and run Cypress tests
uses: cypress-io/github-action@v5
if: steps.check_cypress_tests.outputs.files_exists == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
project: packages/client
build: yarn run build --if-present
start: yarn start
wait-on: 'http://localhost:3000'