-
Notifications
You must be signed in to change notification settings - Fork 3
81 lines (81 loc) · 2.91 KB
/
e2e.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: E2E
on: [deployment_status]
jobs:
accessibility:
if: github.event.deployment_status.state == 'success'
# WORKAROUND: https://github.com/pa11y/pa11y/issues/651
runs-on: ubuntu-20.04
permissions:
checks: read
pull-requests: write
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16.15.0
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Scan for issues
run: |
npx pa11y-ci \
--sitemap ${{github.event.deployment_status.target_url}}/sitemap-0.xml \
--sitemap-find https://www.audioverse.org \
--sitemap-replace ${{github.event.deployment_status.target_url}} \
--sitemap-exclude 'https?:\/\/[\w\.-]+\/(?!en)\w\w\/'
- name: Add comment
if: always()
uses: actions/github-script@v5
env:
BODY_PREFIX: '<!-- pa11y-ci results -->'
with:
script: |
const script = require('./.github/workflows/scripts/pa11y-ci.js')
await script({ context, core, github })
- name: Upload results
if: always()
uses: actions/upload-artifact@v2
with:
name: pa11y-results
path: reports
lighthouse:
if: github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
permissions:
checks: read
pull-requests: write
steps:
# WORKAROUND: https://github.com/treosh/lighthouse-ci-action/issues/21
- uses: actions/checkout@v2
- name: Delete default configuration
run: rm .lighthouserc.yaml
- name: Run Lighthouse
uses: treosh/lighthouse-ci-action@v9
id: lighthouse
with:
urls: |
${{github.event.deployment_status.target_url}}/
${{github.event.deployment_status.target_url}}/en
${{github.event.deployment_status.target_url}}/es
${{github.event.deployment_status.target_url}}/en/discover
${{github.event.deployment_status.target_url}}/en/teachings/all/page/1
${{github.event.deployment_status.target_url}}/en/teachings/300
${{github.event.deployment_status.target_url}}/en/bibles
${{github.event.deployment_status.target_url}}/en/presenters/1309/amanda-anguish
runs: 3
uploadArtifacts: true
temporaryPublicStorage: true
- name: Add comment
uses: actions/github-script@v5
env:
LIGHTHOUSE_LINKS: ${{ steps.lighthouse.outputs.links }}
with:
script: |
const script = require('./.github/workflows/scripts/lighthouse.js')
await script({ context, core, github })