-
Notifications
You must be signed in to change notification settings - Fork 217
50 lines (39 loc) · 1.33 KB
/
accessibility-scan.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
# This workflow uses actions to scan for accessibility
name: Accessibility Scan
on: [push, pull_request]
jobs:
accessibility:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
- name: Install dependencies
run: npm install
- name: Install axe-cli and http-server
run: npm install -g axe-cli http-server
- name: Start local server
run: |
nohup http-server ./ &
- name: Create axe-reports directory
run: mkdir -p ./axe-reports
- name: Run axe-cli accessibility scan
run: npx axe-cli http://localhost:8080 --output html --output-path ./axe-reports/accessibility-report.html
- name: Verify report creation
run: |
ls -la ./axe-reports/
cat ./axe-reports/accessibility-report.html || echo "Report not created"
- name: Upload axe-core report
uses: actions/upload-artifact@v3
with:
name: axe-report
path: ./axe-reports/accessibility-report.html
cat ./axe-reports/accessibility-report.html || echo "Report not created"
- name: Upload axe-core report
uses: actions/upload-artifact@v3
with:
name: axe-report
path: ./axe-reports/accessibility-report.html