-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (44 loc) · 1.35 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
52
53
54
55
56
name: Accessibility Tests (pa11y)
on:
push:
branches:
- master
jobs:
build:
name: Building site and running accessibility tests
runs-on: ubuntu-latest
strategy:
max-parallel: 5
steps:
- name: Checkout Source
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 18
- name: Install Yarn
run: npm install -g yarn
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Create .env file
run: |
touch .env
echo CONTENTFUL_ENDPOINT=${{ secrets.CONTENTFUL_ENDPOINT }} >> .env
echo CONTENTFUL_SCHEMA=${{ secrets.CONTENTFUL_SCHEMA }} >> .env
echo CONTENTFUL_TOKEN=${{ secrets.CONTENTFUL_TOKEN }} >> .env
- name: Build Next App
run: yarn build
- name: Boot Next App
run: yarn start & sleep 15
- name: Run pa11y-ci
run: yarn lint:a11y 2>&1 | tee pa11y_output.txt
- name: Read pa11y_output
id: pa11y_output
uses: juliangruber/read-file-action@v1
with:
path: ./pa11y_output.txt
- name: Check for Failures
if: contains(steps.pa11y_output.outputs.content, 'errno 2')
run: |
echo "::error::The site is failing accessibility tests."
exit 1