Accessibility Tests #22
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: Accessibility Tests | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 3 * * 0' # Run every Sunday at 3am | |
jobs: | |
pally: | |
name: Pa11y accessibility tests | |
env: | |
RAILS_ENV: test | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Prepare application environment | |
uses: ./.github/actions/prepare-app-env | |
with: | |
skip-ruby: true | |
- run: npm install | |
- name: Run Pa11y accessibility tests against QA sitemap pages | |
run: | | |
npm install -g pa11y-ci | |
pa11y-ci --sitemap https://qa.teaching-vacancies.service.gov.uk/sitemap.xml | |
axe: | |
name: Axe accessibility tests | |
env: | |
RAILS_ENV: test | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Prepare application environment | |
uses: ./.github/actions/prepare-app-env | |
with: | |
skip-ruby: true | |
- run: npm install | |
- name: Run Axe accessibility tests against QA sitemap pages | |
run: | | |
npm install -g @axe-core/cli sitemap-urls | |
# Gets all urls from sitemap in an array | |
urls=($(curl https://qa.teaching-vacancies.service.gov.uk/sitemap.xml | sitemap-urls)) | |
# Runs axe against each url from the sitemap | |
axe $(for url in "${urls[@]}"; do echo $url, ; done;) --exit | |
lighthouse: | |
name: Lighthouse tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Prepare application environment | |
uses: ./.github/actions/prepare-app-env | |
with: | |
skip-ruby: true | |
- run: npm install | |
- name: run Lighthouse Performance, Accessibility, Best Practices, SEO, and PWA tests | |
run: | | |
npm install -g @lhci/cli | |
lhci autorun \ | |
--collect.url=https://qa.teaching-vacancies.service.gov.uk \ | |
--collect.url=https://qa.teaching-vacancies.service.gov.uk/jobs \ | |
--collect.url=https://qa.teaching-vacancies.service.gov.uk/schools \ |