forked from dequelabs/axe-core
-
Notifications
You must be signed in to change notification settings - Fork 0
257 lines (238 loc) · 6.8 KB
/
Copy pathtest.yml
File metadata and controls
257 lines (238 loc) · 6.8 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
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
name: Tests
on:
pull_request:
push:
branches:
- master
- develop
- release-*
# We want to group to the workflow for each branch.
# Non-push events will be cancelled if a new one is started.
# Push events will run sequentially. This helps ensure that
# the `next` tag isn't out of sync.
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions: {}
env:
CHROME_DEVEL_SANDBOX: /opt/google/chrome/chrome-sandbox
jobs:
lint:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- &checkout
name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- &setup-node
name: Set up Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: .nvmrc
cache: 'npm'
- &install-deps-directly
name: Install Dependencies
run: npm ci
- name: Run ESLint
run: npm run eslint
fmt_check:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- *checkout
- *setup-node
- *install-deps-directly
- run: npm run fmt:check
build:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- *checkout
- *setup-node
- *install-deps-directly
- &build
name: Build
run: |
npm run prepare
npm run build
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: axe-core
path: axe.js
retention-days: 1
test_chrome:
runs-on: ubuntu-24.04
timeout-minutes: 10
env:
DISPLAY: :99
steps:
- *checkout
- &install-deps-with-xvfb
name: Install Deps
uses: ./.github/actions/install-deps
id: install-deps
with:
start-xvfb: ${{ env.DISPLAY }}
- *build
- name: Run Tests Against Chrome
env:
WTR_BROWSER: chrome
CHROME_BIN: ${{ steps.install-deps.outputs.chrome-path }}
CHROMEDRIVER_BIN: ${{ steps.install-deps.outputs.chromedriver-path }}
run: npm run test
- name: Run Chrome Integration Tests
env:
CHROME_BIN: ${{ steps.install-deps.outputs.chrome-path }}
CHROMEDRIVER_BIN: ${{ steps.install-deps.outputs.chromedriver-path }}
run: npm run test:integration:chrome
test_firefox:
runs-on: ubuntu-24.04
timeout-minutes: 10
env:
DISPLAY: :99
steps:
- *checkout
- *install-deps-with-xvfb
- *build
- name: Run Tests Against Firefox
env:
WTR_BROWSER: firefox
FIREFOX_BIN: ${{ steps.install-deps.outputs.firefox-path }}
run: npm run test
- name: Run Firefox Integration Tests
env:
FIREFOX_BIN: ${{ steps.install-deps.outputs.firefox-path }}
run: npm run test:integration:firefox
# Run examples under `doc/examples`
test_examples:
runs-on: ubuntu-24.04
timeout-minutes: 10
# Temporarily non-blocking due to an upstream issue with the examples.
# A failure here will not fail the Tests workflow, so it won't block deploys.
# Remove this once the upstream issue is resolved.
continue-on-error: true
steps:
- *checkout
- &install-deps
name: Install Deps
id: install-deps
uses: ./.github/actions/install-deps
- *build
- name: Run Tests Against Examples
env:
PUPPETEER_EXECUTABLE_PATH: ${{ steps.install-deps.outputs.chrome-path }}
run: npm run test:examples
test_act:
runs-on: ubuntu-24.04
timeout-minutes: 10
needs: build
steps:
- *checkout
- *install-deps
- &restore-axe-build
name: Restore axe build
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: axe-core
- name: Run ACT Tests
env:
CHROME_BIN: ${{ steps.install-deps.outputs.chrome-path }}
CHROMEDRIVER_BIN: ${{ steps.install-deps.outputs.chromedriver-path }}
run: npm run test:act
test_aria_practices:
runs-on: ubuntu-24.04
timeout-minutes: 10
needs: build
steps:
- *checkout
- *install-deps
- *restore-axe-build
- name: Run ARIA Practices Tests
env:
CHROME_BIN: ${{ steps.install-deps.outputs.chrome-path }}
CHROMEDRIVER_BIN: ${{ steps.install-deps.outputs.chromedriver-path }}
run: npm run test:apg
test_locales:
runs-on: ubuntu-24.04
timeout-minutes: 10
needs: build
steps:
- *checkout
- *install-deps
- *restore-axe-build
- name: Run Locale Tests
run: npm run test:locales
test_virtual_rules:
runs-on: ubuntu-24.04
timeout-minutes: 10
needs: build
steps:
- *checkout
- *install-deps
- *restore-axe-build
- name: Run Virtual Rules Tests
run: npm run test:virtual-rules
test_jsdom:
runs-on: ubuntu-24.04
timeout-minutes: 10
needs: build
steps:
- *checkout
- *install-deps
- *restore-axe-build
- name: Run jsdom Tests
run: npm run test:jsdom
build_api_docs:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- *checkout
- *install-deps
- name: Run API Docs Build
run: npm run api-docs
test_rule_help_version:
runs-on: ubuntu-24.04
timeout-minutes: 10
if: ${{ github.ref_name == 'master' }}
steps:
- *checkout
- *install-deps
- name: Run Rule Help Version Tests
run: npm run test:rule-help-version
sri-validate:
runs-on: ubuntu-24.04
timeout-minutes: 10
needs: build
# Run on master and RC branches along with PRs targeting those branches.
if: ${{ github.ref_name == 'master' || startsWith(github.ref_name, 'release-') || github.event.pull_request.base.ref == 'master' || startsWith(github.event.pull_request.base.ref, 'release-') }}
steps:
- *checkout
- *install-deps
- *restore-axe-build
- name: Validate Subresource Integrity
run: npm run sri-validate
test_node:
# The package can't be built on Node 6 anymore, but should still run there.
# So we need to pull in a previous build artifact.
needs: build
strategy:
matrix:
node:
- 6
- 18
- 20
- 22
- 24
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- *checkout
- name: Set up Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: ${{ matrix.node }}
- *restore-axe-build
- name: Run Node.js Tests
run: npm run test:node