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
50 changes: 2 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
pull_request:
workflow_call: # lets release.yml reuse this exact gate

# Playwright runs in e2e.yml, only when the library or the test app change.

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
# cancel superseded PR runs, but never cancel pushes to main or v2
Expand Down Expand Up @@ -43,51 +45,3 @@ jobs:
- name: Typecheck test app
run: pnpm build.types && pnpm lint
working-directory: test

e2e:
name: Playwright (${{ matrix.browser }})
needs: verify
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
browser: [chromium, webkit]
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup

# The Playwright webServer runs `pnpm dev` in ./test, which imports the
# workspace-linked library from lib/, so the lib must be built first.
- name: Build library
run: pnpm build.types && pnpm build.lib

- name: Resolve Playwright version
id: pw
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT"

- name: Cache Playwright browsers
id: pw-cache
uses: actions/cache@v6
with:
path: ~/.cache/ms-playwright
key: playwright-v2-${{ runner.os }}-${{ matrix.browser }}-${{ steps.pw.outputs.version }}

- name: Install Playwright (browser + system deps)
if: steps.pw-cache.outputs.cache-hit != 'true'
run: pnpm exec playwright install --with-deps ${{ matrix.browser }}

- name: Install Playwright system deps (cached browser)
if: steps.pw-cache.outputs.cache-hit == 'true'
run: pnpm exec playwright install-deps ${{ matrix.browser }}

- name: Run Playwright tests
run: pnpm exec playwright test --project=${{ matrix.browser }}

- name: Upload report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v7
with:
name: playwright-report-${{ matrix.browser }}
path: playwright-report/
retention-days: 7
92 changes: 92 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: E2E

# The Playwright suite drives the library (src/) through the test app (test/),
# so it only runs when one of them, or what builds and runs them, changes: a
# pull request that only touches the website or the docs doesn't wait for it.
# The release always runs it (workflow_call).
on:
push:
branches: [main, v2]
paths:
- "src/**"
- "test/**"
- "playwright.config.ts"
- "vite.config.ts"
- "tsconfig.json"
- "tsconfig.lib.json"
- "package.json"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- ".github/actions/setup/**"
- ".github/workflows/e2e.yml"
# Every base, not only main: in a stack each pull request targets the branch below it.
pull_request:
paths:
- "src/**"
- "test/**"
- "playwright.config.ts"
- "vite.config.ts"
- "tsconfig.json"
- "tsconfig.lib.json"
- "package.json"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- ".github/actions/setup/**"
- ".github/workflows/e2e.yml"
workflow_call: # lets release.yml run it before publishing

concurrency:
group: e2e-${{ github.workflow }}-${{ github.ref }}
# cancel superseded PR runs, but never cancel pushes to main or v2
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
contents: read

jobs:
e2e:
name: Playwright (${{ matrix.browser }})
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
browser: [chromium, webkit]
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup

# The Playwright webServer runs `pnpm dev` in ./test, which imports the
# workspace-linked library from lib/, so the lib must be built first.
- name: Build library
run: pnpm build.types && pnpm build.lib

- name: Resolve Playwright version
id: pw
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT"

- name: Cache Playwright browsers
id: pw-cache
uses: actions/cache@v6
with:
path: ~/.cache/ms-playwright
key: playwright-v2-${{ runner.os }}-${{ matrix.browser }}-${{ steps.pw.outputs.version }}

- name: Install Playwright (browser + system deps)
if: steps.pw-cache.outputs.cache-hit != 'true'
run: pnpm exec playwright install --with-deps ${{ matrix.browser }}

- name: Install Playwright system deps (cached browser)
if: steps.pw-cache.outputs.cache-hit == 'true'
run: pnpm exec playwright install-deps ${{ matrix.browser }}

- name: Run Playwright tests
run: pnpm exec playwright test --project=${{ matrix.browser }}

- name: Upload report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v7
with:
name: playwright-report-${{ matrix.browser }}
path: playwright-report/
retention-days: 7
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ permissions:
contents: read

jobs:
# Full quality gate (lint + typecheck + lib build + Playwright) before anything ships.
# Full quality gate before anything ships: lint, typecheck and builds (ci.yml)
# and the Playwright suite (e2e.yml), whatever the release changed.
ci:
uses: ./.github/workflows/ci.yml

e2e:
uses: ./.github/workflows/e2e.yml

# Runs next to the CI, so a mistagged release fails in seconds.
version:
name: The tag is the version
Expand All @@ -33,7 +37,7 @@ jobs:

stage:
name: Stage on npm
needs: [ci, version]
needs: [ci, e2e, version]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
7 changes: 6 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ at build time too (`website/src/lib/github.ts`). Details: `website/README.md`.

## Releases

A `v*` tag (pushed by `pnpm release`) runs `.github/workflows/release.yml`: CI → tag/version check →
A `v*` tag (pushed by `pnpm release`) runs `.github/workflows/release.yml`: CI + e2e → tag/version check →
pack + contents check → `npm stage publish` (Trusted Publishing) → draft GitHub release
(changelogithub) → waits until a maintainer runs `pnpm stage approve` (2FA) → publishes the release →
deploys the website. Steps: `CONTRIBUTING.md` → Releases.
Expand Down Expand Up @@ -139,6 +139,11 @@ pnpm test # playwright (from root)
After any change to `src/`, the minimum green bar is: **`pnpm build.types` + `pnpm build.lib`**
pass at the root, and `pnpm build.types` passes in `website/` and `test/`.

In GitHub Actions, `ci.yml` (lint, types, the library and website builds) runs on every push to
`main`/`v2` and every pull request; `e2e.yml` (Playwright, chromium + webkit) only when `src/`,
`test/`, the Playwright/Vite/TS config, the dependencies or the CI setup change. The release runs
both whatever changed.

## Qwik authoring conventions (apply to all `.tsx` here)

- Components are declared with `component$(() => { ... })`. Event handlers and inline closures that
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Maintainers only. On an up-to-date `v2` (`main` once `v2` merges), `pnpm release
version (`2.0.0-beta.2`…), commits it, tags it and pushes. The tag runs
[`release.yml`](./.github/workflows/release.yml):

1. the CI, and a check that the tag matches the version in `package.json`;
1. the CI, the Playwright suite and a check that the tag matches the version in `package.json`;
2. it builds and packs the library, checks the package contents and **stages** it on npm through
Trusted Publishing (a prerelease under its identifier, like `beta`; a plain version under
`latest`);
Expand Down
Loading