feat(frontend): automated accessibility testing with jest-axe (closes #132) #1
Workflow file for this run
This file contains hidden or 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: Frontend CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| paths: | |
| - 'app/frontend/**' | |
| - '.github/workflows/frontend-ci.yml' | |
| pull_request: | |
| branches: [main, develop] | |
| paths: | |
| - 'app/frontend/**' | |
| - '.github/workflows/frontend-ci.yml' | |
| jobs: | |
| test: | |
| name: Frontend tests & accessibility audit | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: app/frontend | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: echo "store-dir=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" | |
| - name: Cache pnpm modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.store-dir }} | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Type check | |
| run: pnpm type-check | |
| - name: Lint | |
| run: pnpm lint --max-warnings=0 | |
| - name: Run unit & jest-axe accessibility tests | |
| # --ci ensures deterministic output and a clean exit code on test failures. | |
| run: pnpm jest --ci --colors=false | |
| - name: Upload test summary | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend-test-summary | |
| path: | | |
| app/frontend/coverage | |
| if-no-files-found: ignore | |
| retention-days: 7 |