name: Frontend checks on: push: branches: [main] pull_request: workflow_dispatch: permissions: contents: read concurrency: group: checks-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: verify: runs-on: ubuntu-latest env: # Ties error reports and analytics to this build. VITE_APP_RELEASE: ${{ github.sha }} timeout-minutes: 15 steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version-file: .nvmrc cache: npm - run: npm install --global npm@11.16.0 - run: npm ci - run: npm run check:dependencies - run: npm run check # The Playwright image ships every browser and system library, so jobs skip # the slow apt download. Its tag follows the locked @playwright/test version. playwright-version: runs-on: ubuntu-latest timeout-minutes: 5 outputs: version: ${{ steps.lock.outputs.version }} steps: - uses: actions/checkout@v7 - id: lock run: echo "version=$(node -p "require('./package-lock.json').packages['node_modules/@playwright/test'].version")" >> "$GITHUB_OUTPUT" # Browser flows gate every pull request. The suite (flows, accessibility audits, # three engines) is split across parallel shards to keep each job short. e2e: needs: playwright-version runs-on: ubuntu-latest container: image: mcr.microsoft.com/playwright:v${{ needs.playwright-version.outputs.version }}-noble timeout-minutes: 20 strategy: fail-fast: false matrix: shard: [1, 2, 3, 4] env: VITE_APP_RELEASE: ${{ github.sha }} # Firefox refuses to run as root with a HOME owned by another user. HOME: /root steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version-file: .nvmrc cache: npm - run: npm install --global npm@11.16.0 - run: npm ci - run: npm run test:e2e -- --shard=${{ matrix.shard }}/4 --workers=2 - uses: actions/upload-artifact@v7 if: failure() with: name: browser-failures-${{ matrix.shard }} path: test-results/ retention-days: 7