-
-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (183 loc) · 7.78 KB
/
Copy pathe2e.yml
File metadata and controls
200 lines (183 loc) · 7.78 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
#
# E2E gate for SNIFS: builds the wasm guest in BOTH ReleaseSafe and ReleaseFast
# modes (per Justfile build-wasm), then runs the Elixir demo suite against the
# fresh artifacts. The property under test is the SNIFS guarantee itself —
# illegal behaviour in the ReleaseSafe artifact must surface as {:error, _},
# and the ReleaseFast artifact must demonstrably produce the silent-corruption
# anti-property. If this gate is red, the SNIFS isolation claim is void on the
# affected build.
name: E2E + Aspect + Bench
on:
push:
branches: [main, master, develop]
paths:
- 'zig/**'
- 'demo/**'
- 'priv/**'
- 'Justfile'
- '.github/workflows/e2e.yml'
pull_request:
branches: [main, master]
paths:
- 'zig/**'
- 'demo/**'
- 'priv/**'
- 'Justfile'
- '.github/workflows/e2e.yml'
workflow_dispatch:
permissions: read-all
concurrency:
group: e2e-${{ github.ref }}
cancel-in-progress: true
jobs:
# ─── Build-mode invariant gate ─────────────────────────────────────
# Builds the wasm guest fresh from source (defeating any stale committed
# artifacts) and runs the demo suite against it. The ReleaseSafe artifact
# asserts traps → {:error, _}; the ReleaseFast artifact asserts the canary
# value 0x0BADF00D leaks back as {:ok, [195_948_557]} (proving safety checks
# are absent on that artifact — by design for the demo, and the proof that
# the test discriminates between modes rather than passing trivially).
e2e:
name: E2E — Build-mode invariant
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install Zig 0.15.1
uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
with:
version: 0.15.1
- name: Install just
run: |
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh \
| bash -s -- --to /usr/local/bin
- name: Build wasm artifacts (both modes, from source)
run: just build-wasm
- name: Verify build outputs
run: |
test -f priv/safe_nif_ReleaseSafe.wasm
test -f priv/safe_nif_ReleaseFast.wasm
ls -la priv/*.wasm
- name: Install Erlang/Elixir
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.24.0
with:
# OTP 28.3 + Elixir 1.19.4 matches what the rest of the estate
# uses (bofj-kitt static-analysis-gate verified working). The
# earlier OTP-28 Hex `bs_add` incompat is specific to Elixir 1.18's
# Hex archive — Elixir 1.19's archive is unaffected.
otp-version: '28.3'
elixir-version: '1.19.4'
- name: Run demo test suite
working-directory: demo
run: |
# Install latest Hex/rebar compatible with the Elixir/OTP combo.
# Without this, the bundled-with-setup-beam Hex 2.4.2 hits a
# `Hex.Repo module does not exist` supervisor error on
# Elixir 1.18 / OTP 28 — fixed by installing the runtime-matched
# Hex archive before `mix deps.get` tries to use it.
mix local.hex --force
mix local.rebar --force
mix deps.get
mix test --trace
## === DENO/RESCRIPT E2E ===
# e2e:
# name: E2E — Full Pipeline
# runs-on: ubuntu-latest
# timeout-minutes: 15
# steps:
# - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
# - uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
# with:
# deno-version: v2.x
# - run: deno install --node-modules-dir=auto
# - run: deno task res:build # ReScript compile
# - run: deno test tests/e2e/
## === PLAYWRIGHT (Browser E2E) ===
# e2e-playwright:
# name: Playwright — ${{ matrix.project }}
# runs-on: ubuntu-latest
# timeout-minutes: 20
# strategy:
# fail-fast: false
# matrix:
# project: [chromium-1080p, firefox-1080p, webkit-1080p]
# steps:
# - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
# - uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
# with:
# deno-version: v2.x
# - run: deno install --node-modules-dir=auto
# - run: npx playwright install --with-deps
# - run: npx playwright test --project=${{ matrix.project }}
# - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
# if: failure()
# with:
# name: playwright-traces-${{ matrix.project }}
# path: test-results/**/trace.zip
# retention-days: 7
## === HASKELL E2E ===
# e2e:
# name: E2E — Full Pipeline
# runs-on: ubuntu-latest
# timeout-minutes: 15
# steps:
# - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
# - uses: haskell-actions/setup@cd0d9bdd65b20557f41bea4dbe43d0b5fbbfe553 # v2.11.0
# with:
# ghc-version: '9.6'
# cabal-version: '3.10'
# - run: cabal build all
# - run: bash tests/integration-test.sh
# ─── Aspect Tests ──────────────────────────────────────────────────
# Cross-cutting concerns: thread safety, ABI contracts, SPDX, dangerous patterns
# Uncomment and customise:
# aspect-tests:
# name: Aspect — Architectural Invariants
# runs-on: ubuntu-latest
# timeout-minutes: 10
# steps:
# - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
# - run: bash tests/aspect_tests.sh
# ─── Benchmarks ────────────────────────────────────────────────────
# Performance regression detection. Uncomment matching stack:
## === RUST BENCH ===
# benchmarks:
# name: Bench — Performance Regression
# runs-on: ubuntu-latest
# timeout-minutes: 15
# steps:
# - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
# - uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
# - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
# - run: cargo bench 2>&1 | tee /tmp/bench-results.txt
# - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
# if: always()
# with:
# name: benchmark-results
# path: /tmp/bench-results.txt
# retention-days: 30
## === ZIG BENCH ===
# benchmarks:
# name: Bench — Performance Regression
# runs-on: ubuntu-latest
# timeout-minutes: 15
# steps:
# - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
# - uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
# with:
# version: 0.15.0
# - run: cd ffi/zig && zig build bench
# ─── Readiness (CRG) ──────────────────────────────────────────────
# Component Readiness Grade: D (runs) → C (correct) → B (edge cases)
# readiness:
# name: Readiness — Grade D/C/B
# runs-on: ubuntu-latest
# timeout-minutes: 10
# steps:
# - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
# - uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
# - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
# - run: cargo test --test readiness -- --nocapture