-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (146 loc) · 6.88 KB
/
Copy pathe2e.yml
File metadata and controls
163 lines (146 loc) · 6.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# End-to-end scenarios for the demo visor, in a real Chromium.
#
# The companion to pages.yml: that workflow proves the demo still BUILDS,
# this one proves it still BEHAVES. Every scenario here was previously a
# hand-drive performed once per session in an embedded webview — which,
# among other things, does not deliver `<dialog>` close events, so one of
# these claims (dialog-close-retirement) was literally unverifiable
# before this workflow existed.
#
# The build half mirrors pages.yml exactly — same Deno, same sibling
# checkouts, same cargo cache, same setup.sh — because `just e2e` depends
# on `just site`, which builds the engine composite, the app guest and
# both panels. Diverging on those steps would mean testing a differently
# built artifact from the one that deploys.
name: E2E
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
# A superseded run is cancelled rather than queueing behind itself.
group: e2e-${{ github.ref }}
cancel-in-progress: true
jobs:
e2e:
runs-on: ubuntu-latest
# Same budget as the Pages build: a cold cargo cache dominates, and
# the scenarios themselves run in well under a minute.
timeout-minutes: 60
env:
# ABSOLUTE, and it must be: a relative PLAYWRIGHT_BROWSERS_PATH is
# resolved against $HOME rather than the working directory, which
# silently installs the browser somewhere the cache never sees.
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.deps/pw-browsers
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install Deno (the polyengine host; stock, no flags)
uses: denoland/setup-deno@v2
with:
deno-version: "2.9.5"
- name: Check out pinned siblings
# Before the cache restore, for the same reason as in pages.yml:
# rust-cache keys on the listed workspaces' lockfiles.
run: SIBLINGS_ONLY=1 ./scripts/setup.sh
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
workspaces: |
engine
examples/todomvc/guest
providers/s3/panel
providers/dropbox/panel
cache-all-crates: true
cache-bin: false
# The SAME entry the Pages build job saves — the expression must
# match pages.yml exactly. shared-key replaces rust-cache's
# default job-id key component (and the `key` input): without
# it this job looked up "...-e2e-..." while Pages saved
# "...-build-...", so every E2E run was a cold cargo build.
shared-key: demo-${{ hashFiles('scripts/setup.sh', '**/rust-toolchain.toml') }}
# Never saves: the Pages workflow builds the same workspaces on
# main and owns the entry; this job only restores it.
save-if: false
- name: Set up tools and the endpoint component
run: ./scripts/setup.sh
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Read the pinned Playwright version
# The pin lives in ONE place (demo/justfile) so the
# installed browser revision and the library that launches it
# cannot drift. The cache key follows it: a version bump is a
# different browser build and must not restore the old one.
id: pw
working-directory: demo
run: |
version=$(sed -n 's/^PLAYWRIGHT := "npm:playwright@\(.*\)"$/\1/p' justfile)
test -n "$version" || { echo "could not read the Playwright pin from the justfile" >&2; exit 1; }
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "pinned playwright: $version"
- name: Cache the Playwright browsers
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.deps/pw-browsers
# The `-ff` suffix is load-bearing: the cache saves only on a
# key MISS, so when the browser set grew (chromium + firefox,
# the firefox-smoke scenario) the old key would have hit
# forever with a chromium-only archive and e2e-deps would have
# re-downloaded Firefox's ~90MB on every single run. A browser-
# set change must change the key.
key: pw-${{ runner.os }}-${{ runner.arch }}-${{ steps.pw.outputs.version }}-ff
- name: Cache the MinIO binary
# ~110 MB fetched from dl.min.io; the credential scenarios need a
# real S3 to talk to (and one of them needs it to stop answering).
uses: actions/cache@v4
with:
path: engine/.deps/minio
key: minio-${{ runner.os }}-${{ runner.arch }}-v1
- name: Read the pinned iroh-relay version
# Same one-place-pin discipline as the Playwright step: the
# version lives in engine/justfile (IROH_RELAY_VERSION), the
# install recipe verifies the installed binary against it, and
# the cache key follows it so a bump cannot restore the old
# build.
id: relay
working-directory: engine
run: |
version=$(sed -n 's/^IROH_RELAY_VERSION := "\(.*\)"$/\1/p' justfile)
test -n "$version" || { echo "could not read the iroh-relay pin from engine/justfile" >&2; exit 1; }
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "pinned iroh-relay: $version"
- name: Cache the iroh-relay binary
# The e2e harness spawns its OWN relay on an ephemeral port —
# nothing in the suite reaches the public relay — and the binary
# is a `cargo install` (minutes when cold). The cache makes
# `just relay-bin` a version-probe no-op on every later run.
uses: actions/cache@v4
with:
path: engine/.deps/relay
key: relay-${{ runner.os }}-${{ runner.arch }}-${{ steps.relay.outputs.version }}
- name: Install the browser and the store
# Probe-then-install: a restored cache makes this a no-op beyond
# the launch probe. `install-deps` (system libraries for Chromium)
# runs inside the recipe when CI is set.
working-directory: demo
run: just e2e-deps
- name: Run the scenarios
working-directory: demo
run: just e2e
env:
# Browser-process lifecycle into the job log (launch args, child
# process exits, crash/OOM messages) — two runs wedged silently
# at a scenario banner (2026-08-21) and left nothing to diagnose;
# this plus the harness's own scenario deadline is what makes a
# third occurrence legible. Low noise: pw:browser logs process
# events only, not protocol traffic.
DEBUG: pw:browser
- name: Source-level invariants (#22 ruling table)
# Cheap, and it fails for reasons the scenarios cannot see: these
# are properties of the SOURCE TEXT (the petname never crossing
# the frame seam, no key export path) rather than of a run.
working-directory: demo
run: just check