-
Notifications
You must be signed in to change notification settings - Fork 4
102 lines (85 loc) · 3.3 KB
/
documentation_accessibility_checks.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: '[Documentation] Accessibility Check'
# Adapted from https://docusaurus.io/docs/deployment
on:
workflow_dispatch:
push:
branches:
- chanel-8217-accessibility-checks
# paths:
# - VAMobile/src/components/**
# - VAMobile/documentation/**
# - VAMobile/src/utils/hooks.tsx
jobs:
test-deploy:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Step 1: Clean npm cache
- name: Clean npm cache
run: npm cache clean --force
# Step 2: Install Axe CLI globally
- name: Install Axe CLI globally
run: npm install -g @axe-core/cli@latest
# Step 3: Update npm
- name: Update npm
run: npm install -g npm@latest
# Step 4: Setup Node.js environment
- uses: actions/setup-node@v3
with:
node-version-file: 'VAMobile/.nvmrc'
cache: yarn
cache-dependency-path: VAMobile/yarn.lock
# Step 5: Install dependencies and build
- name: Test build
working-directory: VAMobile
run: |
yarn install --frozen-lockfile
cd documentation
yarn install --frozen-lockfile
yarn build
# Step 6: Start web server
- name: Start web server
working-directory: VAMobile/documentation
run: npm start & npx wait-on http://localhost:3000 &
# Step 7: Extract URLs from sitemap
- name: Extract URLs from sitemap
id: extract-urls
run: |
wget https://department-of-veterans-affairs.github.io/va-mobile-app/sitemap.xml -O sitemap.xml
cat sitemap.xml | grep "<loc>" | sed 's/.*<loc>\(.*\)<\/loc>.*/\1/' > urls.txt
# - name: Run accessibility check
# run: |
# while IFS= read -r url; do
# npx axe-cli "$url" --no-color --tags wcag2a,wcag2aa --report "$url-axe-report.json"
# done < urls.txt
# Add any additional logic here based on the output of the accessibility check
###
# Step 8: Run accessibility check
- name: Run accessibility check
run: |
while IFS= read -r url; do
axe "$url" --exit --tags wcag2a,wcag2aa > "$url-axe-report.json"
done < urls.txt
# - name: Run documentation site
# working-directory: VAMobile/documentation
# run: yarn start
# - name: Setup docs
# working-directory: VAMobile/documentation
# run: cd VAMobile && yarn docs
#- name: Wait for server to start
# working-directory: VAMobile/documentation
# run: npx wait-on http://localhost:3000
# - name: Run axe
# working-directory: VAMobile/documentation
# run: |
# npm install -g @axe-core/cli
# axe http://localhost:3000 --exit
# start_slack_thread:
# name: Start Slack thread
# needs: test-deploy
#uses: ./.github/workflows/start_slack_thread.yml
# secrets: inherit
# with:
# channel_name: va-mobile-build-alerts
# # message: 'On demand build started by {{ github.actor }}: \"{{ inputs.notes }}\" (:git: `{{ github.ref_name }}`). This process may take a while. See :thread: or <{{ github.server_url }}/{{ github.repository }}/actions/runs/{{ github.run_id }}|workflow run> for results.'