ci: gate pull requests on the end-to-end suite #176

Öppen
öppnade 2026-08-02 16:06:37 +00:00 av supernaut · 0 kommentarer
Ägare

.forgejo/workflows/ci.yml runs the full lint / type-check / content-style / migration / build /
vitest gate but has no end-to-end step. The only thing enforcing the e2e suite is the developer's
pre-push hook, which means it is enforced against whatever browser that machine happens to have —
today, the locally installed Firefox — and not enforced at all on a squash-merge commit.

Add the suite to the existing ci job.

Add after the Test (vitest) step, in the SAME job

- name: Install Playwright browsers (no-op when the runner image is in sync)
  run: pnpm exec playwright install --with-deps

- name: End-to-end tests (playwright)
  env:
    E2E_FULL_MATRIX: ${{ github.event_name == 'push' }}
  run: pnpm test:e2e

- name: Upload Playwright report
  if: failure()
  uses: actions/upload-artifact@v4
  with:
    name: playwright-report
    path: |
      playwright-report/
      test-results/
    retention-days: 7

Why one job and not a matrix

Compute is billed per hour and every ephemeral runner VM rounds up to roughly one VM-hour even for
a two-minute job (ADR 0021). At the M - Medium flavor plus its 40 GB boot volume that is about
0.57 SEK per job. So a job that grows from four minutes to seven costs exactly the same, while a
second job — a browser matrix, a shard, a separate e2e workflow — costs another 0.57 SEK on every
push and consumes one of the four concurrent-runner slots. Parallelism belongs in Playwright's
workers, inside this job. Do not add --shard.

The same arithmetic is why firefox runs on the push: main event: the job is already running, the
extra engine is free, and pull requests stay fast.

Prerequisites

The browsers must already be in the gitborg-runner Glance image before this merges. The install
step above is idempotent and self-heals if the image drifts, but merging it against an unbaked
image wires a hard per-run dependency on Google's Chrome-for-Testing bucket and Microsoft's
Playwright CDN into the required status check for main — roughly 500 MB and 2.5–4 minutes on
every pull request.

Also verify

actions/upload-artifact@v4 resolves through the instance's DEFAULT_ACTIONS_URL
(data.forgejo.org). If the EU mirror does not carry it, print the JUnit summary to the job log
instead rather than reaching for github.com.

Acceptance

  • A pull request that breaks the hero heading fails ci
  • The install step logs "browsers are already installed" and takes about a second
  • A failing run leaves a downloadable report containing a trace
  • Total ci job wall clock grows by less than two minutes
`.forgejo/workflows/ci.yml` runs the full lint / type-check / content-style / migration / build / vitest gate but has no end-to-end step. The only thing enforcing the e2e suite is the developer's `pre-push` hook, which means it is enforced against whatever browser that machine happens to have — today, the locally installed Firefox — and not enforced at all on a squash-merge commit. Add the suite to the existing `ci` job. ### Add after the `Test (vitest)` step, in the SAME job - name: Install Playwright browsers (no-op when the runner image is in sync) run: pnpm exec playwright install --with-deps - name: End-to-end tests (playwright) env: E2E_FULL_MATRIX: ${{ github.event_name == 'push' }} run: pnpm test:e2e - name: Upload Playwright report if: failure() uses: actions/upload-artifact@v4 with: name: playwright-report path: | playwright-report/ test-results/ retention-days: 7 ### Why one job and not a matrix Compute is billed per hour and every ephemeral runner VM rounds up to roughly one VM-hour even for a two-minute job (ADR 0021). At the `M - Medium` flavor plus its 40 GB boot volume that is about 0.57 SEK per job. So a job that grows from four minutes to seven costs exactly the same, while a second job — a browser matrix, a shard, a separate e2e workflow — costs another 0.57 SEK on every push and consumes one of the four concurrent-runner slots. Parallelism belongs in Playwright's workers, inside this job. Do not add `--shard`. The same arithmetic is why firefox runs on the `push: main` event: the job is already running, the extra engine is free, and pull requests stay fast. ### Prerequisites The browsers must already be in the `gitborg-runner` Glance image before this merges. The install step above is idempotent and self-heals if the image drifts, but merging it against an unbaked image wires a hard per-run dependency on Google's Chrome-for-Testing bucket and Microsoft's Playwright CDN into the required status check for `main` — roughly 500 MB and 2.5–4 minutes on every pull request. ### Also verify `actions/upload-artifact@v4` resolves through the instance's `DEFAULT_ACTIONS_URL` (`data.forgejo.org`). If the EU mirror does not carry it, print the JUnit summary to the job log instead rather than reaching for github.com. ### Acceptance - [ ] A pull request that breaks the hero heading fails `ci` - [ ] The install step logs "browsers are already installed" and takes about a second - [ ] A failing run leaves a downloadable report containing a trace - [ ] Total `ci` job wall clock grows by less than two minutes
supernaut lade till detta till projektet Bitborg Web 2026-08-02 16:06:55 +00:00
Logga in för att delta i denna konversation.
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-web#176
Ingen beskrivning angiven.