-
Notifications
You must be signed in to change notification settings - Fork 91
65 lines (50 loc) · 1.64 KB
/
check-a11y-of-changed-content.yaml
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
name: Check accessibility of changed content
on:
workflow_dispatch:
pull_request:
permissions:
contents: read
pull-requests: read
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
check-a11y-of-changed-content:
name: Check accessibility of changed content
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch gh-pages branch
run: >-
git fetch origin gh-pages
&& git branch gh-pages origin/gh-pages;
- name: Calculate URLs and output to JavaScript module
run: >-
chmod +x ./generate_pa11y_ci_urls_from_git_diff.sh
&& ./generate_pa11y_ci_urls_from_git_diff.sh gh-pages
>> ./pa11y-ci-urls.js;
- name: Log contents of resulting JavaScript module
run: cat ./pa11y-ci-urls.js;
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.3
- name: Install gems
run: bundle config path vendor/bundle && bundle install
- name: Run the blog
run: bundle exec jekyll serve &
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Install NPM dependencies
run: npm ci
- name: Setup Chrome
uses: browser-actions/setup-chrome@v1
id: setup-chrome
- name: Wait for blog to be running
run: npx wait-on http://localhost:4000 --timeout 60000
- name: Run pa11y-ci
run: CHROMIUM_BIN=$(which chrome) npx pa11y-ci