-
Notifications
You must be signed in to change notification settings - Fork 28
54 lines (44 loc) · 1.16 KB
/
test.yml
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
name: Test
on:
push:
paths:
- "project/**"
- ".github/workflows/test.yml"
pull_request:
paths:
- "project/**"
- ".github/workflows/test.yml"
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./project
steps:
- uses: actions/checkout@v2
- name: Cache node_modules
uses: actions/cache@v3
with:
path: "project/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('project/package-lock.json') }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install
run: npm install
- name: Build
run: npm run build
- name: Test
id: test
continue-on-error: true
run: npm test
- name: Uploading screenshots on failure
if: steps.test.outcome == 'failure'
uses: actions/upload-artifact@v2
with:
name: failure-screenshots
path: project/packages/examples/test/e2e/screenshots/
- name: Exit signal
if: steps.test.outcome == 'failure'
run: exit 1