-
Notifications
You must be signed in to change notification settings - Fork 13
162 lines (138 loc) · 4.61 KB
/
qa.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Quality Assurance
on:
pull_request:
branches: [ master ]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master
with:
submodules: 'recursive'
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Use Node.js (.nvmrc)
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-and-next
with:
path: |
~/.yarn
~/.cache/Cypress
./node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: TypeScript
run: yarn check:ts
unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master
with:
submodules: 'recursive'
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Use Node.js (.nvmrc)
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-and-next
with:
path: |
~/.yarn
~/.cache/Cypress
./node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Unit Tests
run: yarn test --ci
functional:
name: Functional tests
runs-on: ubuntu-latest
strategy:
# when one test fails, DO NOT cancel the other
# containers, because this will kill Cypress processes
# leaving the Dashboard hanging ...
# https://github.com/cypress-io/github-action/issues/48
fail-fast: false
matrix:
# run multiple copies of the current job in parallel
# Cypress seems to run on all but one machines defined here
containers: [1, 2, 3, 4, 5]
steps:
- name: Checkout repository
uses: actions/checkout@master
with:
submodules: 'recursive'
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Use Node.js (.nvmrc)
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-and-next
with:
path: |
~/.yarn
~/.cache/Cypress
./node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
# because of "record" and "parallel" parameters
# these containers will load balance all found tests among themselves
# https://github.com/cypress-io/github-action
- name: Cypress run
uses: cypress-io/github-action@v4
with:
start: npm start
install: false
record: true
parallel: true
group: 'Functional Tests'
env:
PORT: 3000
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# env vars for local server started via `npm start`
autoformtoken: ${{ secrets.AUTOFORMTOKEN }}
# navody.digital base url for redirect
NAVODY_BASE_URL: https://staging.navody.digital