Updated accessibility check step #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: 'VAMobile/.nvmrc' | |
cache: yarn | |
cache-dependency-path: VAMobile/yarn.lock | |
- name: Test build | |
working-directory: VAMobile | |
run: | | |
yarn install --frozen-lockfile | |
cd documentation | |
yarn install --frozen-lockfile | |
yarn build | |
#run: npm start & npx wait-on http://localhost:3000 | |
- name: Start web server | |
working-directory: VAMobile/documentation | |
run: npm start & npx wait-on http://localhost:3000 & | |
- 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 | |
### | |
- name: Run accessibility check | |
run: | | |
while IFS= read -r url; do | |
npx @axe-core/cli "$url" --exit --tags wcag2a,wcag2aa --report "$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.' | |