chore(guards): initial guards docs #340
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: Playwright tests | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [main] | |
| merge_group: | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened] | |
| # Based on https://playwright.dev/docs/test-sharding#github-actions-example | |
| jobs: | |
| build: | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| cache: npm | |
| node-version: lts/* | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| env: | |
| # We need an Arcjet key for the dev server to run, but it doesn't | |
| # actually need to be valid for the tests to run. | |
| ARCJET_KEY: ajkey_dummy | |
| # See astro.config.mts for context. | |
| ASTRO_FORCE_NODE_ADAPTER: "1" | |
| - name: Upload build output | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: build-output | |
| path: dist/ | |
| retention-days: 1 | |
| test: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shardIndex: [1, 2, 3, 4] | |
| shardTotal: [4] | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| cache: npm | |
| node-version: lts/* | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Download build output | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: build-output | |
| path: dist/ | |
| - name: Install Playwright Browsers | |
| run: npm run pw:install | |
| - name: Run Playwright tests | |
| run: npm run pw:run -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} | |
| - name: Upload blob report | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: blob-report-${{ matrix.shardIndex }} | |
| path: blob-report | |
| retention-days: 1 | |
| merge-reports: | |
| if: ${{ !cancelled() }} | |
| needs: test | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| cache: npm | |
| node-version: lts/* | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Download blob reports | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| path: all-blob-reports | |
| pattern: blob-report-* | |
| merge-multiple: true | |
| - name: Merge into HTML Report | |
| run: npx playwright merge-reports --reporter html ./all-blob-reports | |
| - name: Upload HTML report | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 |