-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (66 loc) · 2.28 KB
/
axe.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
on:
workflow_dispatch:
schedule:
- cron: "0 12 * * 0"
jobs:
parse-config:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.config-matrix.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Parse config.json into matrix
id: config-matrix
run: echo "matrix=$(jq -c . < ./config.json)" >> $GITHUB_OUTPUT
axe:
needs: parse-config
runs-on: ubuntu-latest
strategy:
matrix: ${{fromJson(needs.parse-config.outputs.matrix)}}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install axe-core/cli
run: npm i @axe-core/cli -g
- name: Cache chromedriver
id: cache-chromedriver
uses: actions/cache@v3
with:
path: /usr/local/bin/chromedriver
key: ${{ runner.os }}-chromedriver
- name: Install chromedriver
if: steps.cache-chromedriver.outputs.cache-hit != 'true'
uses: nanasess/setup-chromedriver@v2
- name: Create folder
run: mkdir -p ${{ matrix.name }}
- name: Testing ${{ matrix.name }}
run: axe --stdout --chromedriver-path='/usr/local/bin/chromedriver' ${{ join(matrix.urls, ', ') }} > ${{ matrix.name }}/$(date +'%Y-%m-%d').json
- name: Remove unneeded data from axe-result
run: |
jq 'del(.[].inapplicable)' ${{ matrix.name }}/$(date +'%Y-%m-%d').json > ${{ matrix.name }}/tmp.json
jq 'del(.[] | .passes, .incomplete, .violations | .[] | .nodes, .tags)' ${{ matrix.name }}/tmp.json > ${{ matrix.name }}/$(date +'%Y-%m-%d').json
rm ${{ matrix.name }}/tmp.json
- name: Upload result
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}/*.json
publish-results:
permissions:
contents: write
runs-on: ubuntu-latest
needs: [axe]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download results
uses: actions/download-artifact@v3
- name: Publish new results
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Publish new results"