Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ This is a crowdfunding platform for games with a developer theme. The applicatio
- Follow good security practices
- Make sure to explicitly set the workflow permissions
- Add comments to document what tasks are being performed
- Keep the Playwright CI container image derived from the locked `@playwright/test` version so dependency updates use matching browsers.

## npm Commands

Expand Down
29 changes: 26 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,39 @@ jobs:
- name: Run unit tests
run: npm run test:unit

# Resolve the image before starting the E2E container so dependency updates
# always use the browser binaries for the locked Playwright version.
playwright-image:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
image: ${{ steps.image.outputs.image }}

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "lts/*"

- name: Resolve Playwright image from lockfile
id: image
run: |
node -p "'image=mcr.microsoft.com/playwright:v' + require('./package-lock.json').packages['node_modules/@playwright/test'].version + '-noble'" >> "$GITHUB_OUTPUT"

# Build the static site and run the Playwright end-to-end suite against it
frontend-tests:
needs: playwright-image
runs-on: ubuntu-latest
# Run inside Playwright's official image so the browsers and their OS-level
# dependencies are preinstalled. This is the approach recommended by the
# Playwright CI docs (https://playwright.dev/docs/ci) and avoids the slow,
# network-variable `playwright install --with-deps` apt step on each run.
# The tag MUST match the @playwright/test version in package-lock.json
# so the bundled browsers resolve; bump it whenever Playwright is upgraded.
container: mcr.microsoft.com/playwright:v1.63.0-noble
# Derive the tag from package-lock.json so the bundled browsers resolve.
container: ${{ needs.playwright-image.outputs.image }}
permissions:
contents: read

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ npm run test:unit # Vitest unit tests (transforms + data-access helpers)
npm run test:e2e # Playwright E2E tests (builds + previews the static site first)
```

CI runs the E2E suite in the official Playwright container, with its image tag derived from the exact `@playwright/test` version in `package-lock.json` so the preinstalled browsers match the test runner.

## Linting

The frontend uses ESLint to enforce code quality across TypeScript and Astro files. Run it with:
Expand Down
Loading
Loading