|
5 | 5 | # |
6 | 6 | # Runs on every PR and push to main. Three jobs: |
7 | 7 | # structural — fast structural checks (no compiler required) |
8 | | -# smoke — Node.js smoke test (AffineScript parser + example files) |
| 8 | +# smoke — Deno harnesses (AffineScript parser + aspect/proof envelopes) |
9 | 9 | # build-e2e — Full Idris2 + Zig build then E2E |
10 | 10 | # cargo-verify — Cargo workspace build + test (typed-wasm-verify crate) |
11 | 11 | name: E2E Validation |
@@ -39,75 +39,76 @@ jobs: |
39 | 39 | run: E2E_BUILD=0 bash tests/e2e.sh |
40 | 40 |
|
41 | 41 | # -------------------------------------------------------------------------- |
42 | | - # Job 2: Smoke test — Node.js parser validation |
| 42 | + # Job 2: Smoke test — Deno harness validation |
43 | 43 | # -------------------------------------------------------------------------- |
44 | 44 | smoke: |
45 | | - name: Smoke test (Node.js AffineScript parser) |
| 45 | + name: Smoke test (Deno AffineScript harnesses) |
46 | 46 | runs-on: ubuntu-latest |
| 47 | + env: |
| 48 | + # Scoped permissions covering the harnesses' needs (file read/write, |
| 49 | + # subprocess spawn for idris2, env). See deno.json / Justfile `deno_run`. |
| 50 | + DENO_RUN: "deno run --allow-read --allow-write --allow-run --allow-env --allow-sys" |
47 | 51 |
|
48 | 52 | steps: |
49 | 53 | - name: Checkout repository |
50 | 54 | uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
51 | 55 |
|
52 | | - - name: Set up Node.js |
53 | | - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 |
54 | | - with: |
55 | | - node-version: '25' |
56 | | - |
57 | | - - name: Install npm deps |
58 | | - run: npm install --no-audit --no-fund --silent |
59 | | - |
60 | | - # Phase 0 NOTE (issue #48): Track A's parser migration replaced |
61 | | - # ReScript (.res + rescript.json + rescript build) with AffineScript |
62 | | - # (.affine + affinescript.json + @hyperpolymath/affinescript compiler). |
63 | | - # The compiler isn't yet declared as an npm dep in package.json so |
64 | | - # `npm install` can't fetch it on a clean CI runner. Detect the |
65 | | - # AffineScript or ReScript binary if either is present after install, |
66 | | - # build with whichever is available, otherwise skip and let downstream |
67 | | - # steps handle the artefact-absent case (they're already guarded). |
68 | | - - name: Build parser (AffineScript preferred, ReScript fallback) |
| 56 | + # Deno is the project's JS runtime (estate npm→Deno migration, #133 / |
| 57 | + # standards#253). deno.land is denied by some network policies, so install |
| 58 | + # straight from the GitHub release assets — the same curl pattern the |
| 59 | + # Idris2 / Zig steps use below. |
| 60 | + - name: Install Deno |
69 | 61 | run: | |
70 | | - if [ -x node_modules/.bin/affinescript ]; then |
71 | | - echo "Building with AffineScript..." |
72 | | - node_modules/.bin/affinescript build |
73 | | - elif [ -x node_modules/.bin/rescript ]; then |
74 | | - echo "Building with ReScript (migration fallback)..." |
75 | | - node_modules/.bin/rescript build |
| 62 | + DENO_VERSION="2.8.1" |
| 63 | + curl -fsSL -o /tmp/deno.zip \ |
| 64 | + "https://github.com/denoland/deno/releases/download/v${DENO_VERSION}/deno-x86_64-unknown-linux-gnu.zip" |
| 65 | + mkdir -p "$HOME/.deno/bin" |
| 66 | + unzip -oq /tmp/deno.zip -d "$HOME/.deno/bin" |
| 67 | + echo "$HOME/.deno/bin" >> "$GITHUB_PATH" |
| 68 | + "$HOME/.deno/bin/deno" --version |
| 69 | +
|
| 70 | + # The AffineScript parser compiler is OCaml (opam + dune, NOT npm — see |
| 71 | + # tools/provision.sh). Building it is expensive (~5 min) and is exercised by |
| 72 | + # c5-regenerate.yml, not here. If it happens to be on PATH, build; otherwise |
| 73 | + # skip and let the guarded steps below handle the artefact-absent case. |
| 74 | + - name: Build parser (AffineScript, if provisioned) |
| 75 | + run: | |
| 76 | + if command -v affinescript >/dev/null 2>&1; then |
| 77 | + echo "Building parser with AffineScript..." |
| 78 | + affinescript build |
76 | 79 | else |
77 | | - echo "::warning::No parser compiler available — skipping build." |
78 | | - echo "::warning::Track A parser-migration is incomplete; see #48." |
79 | | - echo "::warning::Downstream smoke / aspect / property / benchmark" |
80 | | - echo "::warning::steps will skip if src/parser/Parser.mjs is absent." |
| 80 | + echo "::warning::affinescript (OCaml) not provisioned — skipping parser build." |
| 81 | + echo "::warning::smoke / property / benchmark steps will skip if src/parser/Parser.mjs is absent." |
81 | 82 | fi |
82 | 83 |
|
83 | 84 | - name: Run smoke test (skip if parser artefacts absent) |
84 | 85 | run: | |
85 | 86 | if [ -f src/parser/Parser.mjs ]; then |
86 | | - node tests/smoke/e2e-smoke.mjs |
| 87 | + $DENO_RUN tests/smoke/e2e-smoke.mjs |
87 | 88 | else |
88 | 89 | echo "::warning::src/parser/Parser.mjs absent — skipping smoke test." |
89 | 90 | fi |
90 | 91 |
|
91 | 92 | - name: Run aspect tests (claim + security envelopes — no parser dep) |
92 | 93 | run: | |
93 | | - node tests/aspect/claim-envelope.mjs |
94 | | - node tests/aspect/security-envelope.mjs |
| 94 | + $DENO_RUN tests/aspect/claim-envelope.mjs |
| 95 | + $DENO_RUN tests/aspect/security-envelope.mjs |
95 | 96 |
|
96 | 97 | - name: Run property tests (skip if parser artefacts absent) |
97 | 98 | run: | |
98 | 99 | if [ -f src/parser/Parser.mjs ]; then |
99 | | - node tests/property/property_test.mjs |
| 100 | + $DENO_RUN tests/property/property_test.mjs |
100 | 101 | else |
101 | 102 | echo "::warning::src/parser/Parser.mjs absent — skipping property tests." |
102 | 103 | fi |
103 | 104 |
|
104 | 105 | - name: Run proof regression (named theorems + idris2 typecheck if present) |
105 | | - run: node tests/proof/regression.mjs |
| 106 | + run: $DENO_RUN tests/proof/regression.mjs |
106 | 107 |
|
107 | 108 | - name: Run parser benchmark (skip if parser artefacts absent) |
108 | 109 | run: | |
109 | 110 | if [ -f src/parser/Parser.mjs ]; then |
110 | | - BENCH_ITERS=20 node benchmarks/parser-bench.mjs |
| 111 | + BENCH_ITERS=20 $DENO_RUN benchmarks/parser-bench.mjs |
111 | 112 | else |
112 | 113 | echo "::warning::src/parser/Parser.mjs absent — skipping benchmark." |
113 | 114 | fi |
@@ -158,11 +159,18 @@ jobs: |
158 | 159 | tar -xJf /tmp/zig.tar.xz -C /opt |
159 | 160 | ln -s "/opt/${ZIG_DIR}/zig" /usr/local/bin/zig |
160 | 161 |
|
161 | | - # ---- Node (for smoke test within E2E script) ---- |
162 | | - - name: Set up Node.js |
163 | | - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 |
164 | | - with: |
165 | | - node-version: '25' |
| 162 | + # ---- Deno (JS runtime for the smoke harness within the E2E script) ---- |
| 163 | + # Installed from the GitHub release assets (deno.land is denied by some |
| 164 | + # network policies); matches the curl pattern above. See tests/e2e.sh. |
| 165 | + - name: Install Deno |
| 166 | + run: | |
| 167 | + DENO_VERSION="2.8.1" |
| 168 | + curl -fsSL -o /tmp/deno.zip \ |
| 169 | + "https://github.com/denoland/deno/releases/download/v${DENO_VERSION}/deno-x86_64-unknown-linux-gnu.zip" |
| 170 | + mkdir -p "$HOME/.deno/bin" |
| 171 | + unzip -oq /tmp/deno.zip -d "$HOME/.deno/bin" |
| 172 | + echo "$HOME/.deno/bin" >> "$GITHUB_PATH" |
| 173 | + "$HOME/.deno/bin/deno" --version |
166 | 174 |
|
167 | 175 | # ---- Full E2E ---- |
168 | 176 | # Phase 0 NOTE (issue #48): this step has been persistently red since |
|
0 commit comments