From 6079721f2cba8f51e4ad10af836b828040901c0d Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 25 Oct 2024 16:17:53 -0700 Subject: [PATCH] add pa11y-ci 508 compliance tests --- .github/workflows/frontend_ci.yml | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/frontend_ci.yml b/.github/workflows/frontend_ci.yml index 55aacb3d022..8cdd4749125 100644 --- a/.github/workflows/frontend_ci.yml +++ b/.github/workflows/frontend_ci.yml @@ -54,6 +54,41 @@ jobs: - name: Run linting run: yarn run lint + pa11y: + name: Run Pa11y 508 Compliance Check + needs: lint + runs-on: ubuntu-latest + + steps: + - name: Check out changes + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 + - name: Use Node.js with yarn + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 + with: + node-version-file: frontend-react/.nvmrc + cache: yarn + cache-dependency-path: frontend-react/yarn.lock + - name: Yarn install + run: yarn install --immutable + + - name: Install Pa11y-CI + run: yarn add pa11y-ci --no-lockfile + + - name: Run Frontend Server + run: | + cd frontend-react + yarn run start & + sleep 10 # Wait for the server to start up + + - name: Run Pa11y Check + run: | + pa11y-ci --sitemap http://localhost:3000/sitemap.xml \ + --sitemap-find https://reportstream.cdc.gov \ + --sitemap-replace http://localhost:3000 + + - name: Stop Frontend Server + run: kill $(cat server.pid) + unit_tests: name: Unit tests needs: lint