-
Notifications
You must be signed in to change notification settings - Fork 11
52 lines (38 loc) · 1.37 KB
/
pa11y.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
name: pa11y tests
on: [pull_request]
jobs:
build:
name: Building site and running pa11y-ci tests
runs-on: ubuntu-latest
steps:
- name: Checkout source.
uses: actions/checkout@v4
- name: Install jekyll site dependencies.
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Install pa11y-ci dependencies.
run: npm ci
- name: Start up jekyll server.
run: npm run start-detached
- name: Run pa11y-ci.
run: npm run pa11y-ci:sitemap 2>&1 | tee pa11y_output.txt
- name: Read pa11y_output file.
id: pa11y_output
uses: juliangruber/read-file-action@v1
with:
path: ./pa11y_output.txt
- name: Comment on pull request.
uses: thollander/actions-comment-pull-request@v2
if: github.actor != 'dependabot[bot]'
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: '<details><summary>Pa11y testing results</summary>
```${{ steps.pa11y_output.outputs.content }}```
</details>'
- name: Check for pa11y failures.
if: contains(steps.pa11y_output.outputs.content, 'errno 2')
run: |
echo "::error::The site is failing accessibility tests. Please review the comment in the pull request or the pa11y-ci step in the workflow for details."
exit 1