-
-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (56 loc) · 1.82 KB
/
check_a11y.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
52
53
54
55
56
57
name: Check accessibility (a11y)
# This action uses pa11y to check for accessibility issues using aXe and HTML
# Code Sniffer. This action will fail when errors are found. If you'd rather it
# only warn you about accessibility issues but not fail when issues are found,
# remove or comment out the "Run pa11y" step, and use the "Run axe" step
# instead.
#
# If you change your port in `config.js`, be sure to update the commands below
# as well.
#
# More information and approaches:
# https://www.adrianbolonio.com/en/accessibility-github-actions/
on:
push:
branches:
# Build whenever the main branch is pushed.
- 'main'
paths-ignore:
# Exclude changes that only affect these directories and files.
- '.github/**'
- 'docs/**'
- 'README.md'
pull_request:
branches:
# Build whenever the main branch has a pull request.
- 'main'
paths-ignore:
# Exclude changes that only affect these directories and files.
- '.github/**'
- 'docs/**'
- 'README.md'
jobs:
check_a11y:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
- name: Install dependencies
# The first line of `run` is designed to omit husky setup, since it's
# not necessary or desireable in a remote build.
run: |
npm set-script prepare ""
npm ci
- name: Generate site
run: |
gulp --noop & npx wait-on http://localhost:9050
- name: Run pa11y
run: |
npm install -g pa11y
pa11y --runner axe --runner htmlcs --ignore color-contrast --standard WCAG2AA http://localhost:9050
# - name: Run axe
# run: |
# npm install -g @axe-core/cli
# axe http://localhost:9050