-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.3 KB
/
test.yml
File metadata and controls
50 lines (42 loc) · 1.3 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
name: Axe Tests
on:
push:
branches: [main]
paths:
- "patterns/**"
- "package.json"
- "vitest.config.js"
pull_request:
paths:
- "patterns/**"
- "package.json"
- "vitest.config.js"
jobs:
test:
name: Run axe tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
cache: "npm"
- name: Install dependencies
run: npm install
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run axe tests
run: npm test
- name: Post axe results as PR comment
if: failure() && github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ **Axe tests failed.** Check the [Actions log](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.\n\nRemember: `before/` must fail axe and `after/` must pass axe for every pattern.'
})