forked from Ethereal-Future/FuTuRe
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.46 KB
/
Copy pathaccessibility-testing.yml
File metadata and controls
48 lines (40 loc) · 1.46 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
name: Accessibility Testing
on:
push:
branches: [main, 'feature/**']
pull_request:
branches: [main]
jobs:
accessibility-tests:
name: Accessibility Audit & Regression
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.3.0
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run accessibility tests
run: npx vitest run frontend/tests/accessibility-automation.test.jsx --reporter=verbose
env:
NODE_ENV: test
- name: Upload accessibility report
if: always()
uses: actions/upload-artifact@v4
with:
name: accessibility-report-${{ github.sha }}
path: test-reports/
retention-days: 14
- name: Comment PR on accessibility failure
if: failure() && github.event_name == 'pull_request'
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '♿ **Accessibility regression detected.** Review the `accessibility-report` artifact for WCAG violations introduced by this PR.'
})