-
Notifications
You must be signed in to change notification settings - Fork 34
113 lines (97 loc) · 2.69 KB
/
code-quality.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Code Quality
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
jobs:
test:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run test --if-present
lint:
name: Run Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run format
cypress-install:
runs-on: ubuntu-latest
container: cypress/browsers:node16.16.0-chrome107-ff107-edge
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cypress install
uses: cypress-io/github-action@v5.8.3
with:
# Disable running of tests within install job
runTests: false
cypress-run-e2e:
name: Run End-to-End Tests
needs: cypress-install
runs-on: ubuntu-latest
container: cypress/browsers:node16.16.0-chrome107-ff107-edge
strategy:
# don't fail the entire matrix on failure
fail-fast: false
matrix:
# run copies of the current job in parallel
containers: [1, 2, 3]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cypress run
uses: cypress-io/github-action@v5.0.9
with:
# Specify Browser since container image is compile with Firefox
browser: chrome
start: npm run dev
wait-on: 'http://localhost:3000'
record: true
parallel: true
group: e2e
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
cypress-run-component:
name: Run Component Tests
needs: cypress-install
runs-on: ubuntu-latest
container: cypress/browsers:node16.16.0-chrome107-ff107-edge
strategy:
# don't fail the entire matrix on failure
fail-fast: false
matrix:
# run copies of the current job in parallel
containers: [1, 2, 3]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cypress run
uses: cypress-io/github-action@v5.0.9
with:
# Specify Browser since container image is compile with Firefox
browser: chrome
component: true
record: true
parallel: true
group: component
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}