@@ -160,33 +160,104 @@ jobs:
160160 - run : npm test
161161
162162 # ---------------------------------------------------------------------------
163- # PLACEHOLDER — read -only end-to-end checks against production (Playwright).
163+ # Read -only end-to-end checks against PRODUCTION (Playwright).
164164 #
165- # DISABLED ON PURPOSE. This repo has no Playwright config or browser install step
166- # yet; those land with workstreams C (playground E2E) and D (docs E2E). Enabling
167- # this job before then would just fail on a missing config, so it stays commented
168- # out rather than guessing at spec paths that do not exist.
165+ # `prod-smoke` above proves the routes answer; this proves the sites still WORK —
166+ # the playground boots and compiles a plan in a real browser, the embed page draws
167+ # from a `#z=` link, the docs site's machine artifacts are byte-identical to this
168+ # checkout, and `<ArchLive>` hydrates into a live compiler rather than a dead
169+ # `<pre>`. ci.yml runs the same specs against a locally BUILT site before merge;
170+ # this runs a subset against what visitors actually get.
169171 #
170- # To enable, AFTER C/D have landed their configs: delete the comment markers, point
171- # `--config`/`--project` at whatever those workstreams actually committed (do not
172- # invent paths here), and keep the run READ-ONLY — this drives *production*, so no
173- # form submits, no writes, no state mutation, only navigation and assertions.
172+ # Two rules govern this job, and neither is negotiable:
174173 #
175- # e2e-prod:
176- # name: E2E against production (read-only)
177- # runs-on: ubuntu-latest
178- # steps:
179- # - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
180- # - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
181- # with:
182- # node-version: 22
183- # cache: npm
184- # - run: npm ci
185- # - run: npx playwright install --with-deps chromium
186- # - run: <the E2E command workstream C/D committed>
187- # env:
188- # PLAYWRIGHT_BASE_URL: https://playground.archlang.uk
174+ # 1. READ-ONLY. It drives production, so the run is restricted to `--grep @prod`
175+ # — a tag each spec file carries a comment explaining. Tagged cases navigate,
176+ # read and assert; nothing downloads, writes the clipboard, submits a form or
177+ # depends on persisted state. Never widen this to the full suite.
178+ # 2. NO BUILD. `E2E_BASE_URL` makes each config drop its `webServer` and point at
179+ # the live origin, so there is nothing to build and no preview server — which
180+ # is also what makes the docs byte-equality cases meaningful here: they compare
181+ # PRODUCTION's bytes against THIS checkout of `main`, i.e. they fail when a
182+ # deploy has silently gone stale.
183+ #
184+ # A red night here means production is broken or stale, not that a PR is bad — it
185+ # lands in the same pinned issue the `report` job writes.
189186 # ---------------------------------------------------------------------------
187+ e2e-prod :
188+ name : E2E against production (read-only)
189+ runs-on : ubuntu-latest
190+ steps :
191+ - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
192+
193+ - name : Set up Node.js
194+ uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
195+ with :
196+ # Node 22, matching ci.yml's e2e-docs leg: archlive.spec.ts imports the
197+ # playground's `#z=` decoder, which needs `DecompressionStream("deflate-raw")`
198+ # (Node ≥ 21.2) at module scope even when the tagged subset never calls it.
199+ node-version : 22
200+ cache : npm
201+
202+ - name : Install dependencies
203+ run : npm ci
204+
205+ # NB: no `npm run build`, no site build. With E2E_BASE_URL set, neither config
206+ # starts a preview server — the specs drive the live origins directly.
207+
208+ # Keyed on the RESOLVED @playwright/test version: a browser build is pinned
209+ # to its driver, so a version bump must miss the cache rather than reuse an
210+ # incompatible download. (Same key as ci.yml's e2e jobs, so a nightly can hit
211+ # a cache a PR run populated.)
212+ - name : Resolve Playwright version
213+ id : pw
214+ run : |
215+ version=$(node -p "require('@playwright/test/package.json').version")
216+ echo "version=$version" >> "$GITHUB_OUTPUT"
217+
218+ - name : Cache Playwright browsers
219+ id : pw-cache
220+ uses : actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
221+ with :
222+ path : ~/.cache/ms-playwright
223+ key : playwright-${{ runner.os }}-${{ steps.pw.outputs.version }}
224+
225+ # On a cache hit the browser binary is already there but the OS packages it
226+ # links against are not (they live outside the cached path), so the two
227+ # cases install different things.
228+ - name : Install Chromium (browser + system deps)
229+ if : steps.pw-cache.outputs.cache-hit != 'true'
230+ run : npx playwright install --with-deps chromium
231+
232+ - name : Install Chromium system deps only (cached browser)
233+ if : steps.pw-cache.outputs.cache-hit == 'true'
234+ run : npx playwright install-deps chromium
235+
236+ - name : Playground — https://playground.archlang.uk
237+ run : npx playwright test -c playground --grep @prod
238+ env :
239+ E2E_BASE_URL : https://playground.archlang.uk
240+
241+ # `!cancelled()`, not the default: if the playground is down, the docs site's
242+ # verdict is still worth having tonight. Both still fail the job.
243+ - name : Docs site — https://archlang.uk
244+ if : ${{ !cancelled() }}
245+ run : npx playwright test -c docs-site --grep @prod
246+ env :
247+ E2E_BASE_URL : https://archlang.uk
248+
249+ - name : Upload Playwright report
250+ if : failure()
251+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
252+ with :
253+ name : playwright-report-prod
254+ path : |
255+ playground/playwright-report
256+ playground/test-results
257+ docs-site/playwright-report
258+ docs-site/test-results
259+ retention-days : 7
260+ if-no-files-found : ignore
190261
191262 # ---------------------------------------------------------------------------
192263 # One writer for the pinned issue. Folding "advisories found" and "a job failed"
@@ -195,7 +266,7 @@ jobs:
195266 # ---------------------------------------------------------------------------
196267 report :
197268 name : Report
198- needs : [prod-smoke, audit, secrets, full-matrix]
269+ needs : [prod-smoke, audit, secrets, full-matrix, e2e-prod ]
199270 if : always()
200271 runs-on : ubuntu-latest
201272 permissions :
0 commit comments