11# SPDX-License-Identifier: MPL-2.0
2+ #
3+ # Standalone CI: no dependency on third-party actions or external-repo
4+ # reusable workflows. The OCaml toolchain is self-hosted via apt + opam
5+ # (replacing ocaml/setup-ocaml), and only first-party `actions/*` are used
6+ # (checkout / setup-node / upload-artifact), SHA-pinned. dune-project requires
7+ # OCaml >= 4.14, satisfied by the runner's apt OCaml (ocaml-system), with a
8+ # base-compiler fallback.
9+ #
10+ # NOTE on pins: first-party `actions/*` are SHA-pinned (repo SHA-pinning
11+ # policy + Hypatia workflow_audit + the "allowed actions" policy that rejects
12+ # tag refs at run-creation). `actions/checkout` is v7.0.0 (`9c091bb…`, bumped
13+ # by Dependabot in #605); `setup-node` / `upload-artifact` remain v4.
214name : CI
315on :
416 push :
@@ -9,27 +21,36 @@ permissions:
921 contents : read
1022# Actions concurrency pool. Applied only to read-only check workflows
1123# (no publish/mutation), so cancelling a superseded run is always safe.
24+ # Safe here: this is a normal workflow (not a reusable-workflow caller),
25+ # so there is no caller/reusable concurrency stacking (the BP008 startup
26+ # failure class).
1227concurrency :
1328 group : ${{ github.workflow }}-${{ github.ref }}
1429 cancel-in-progress : true
1530jobs :
1631 build :
1732 runs-on : ubuntu-latest
18- timeout-minutes : 10
33+ timeout-minutes : 25
1934
2035 steps :
2136 - name : Checkout code
22- uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
23- - name : Set up OCaml
24- uses : ocaml/setup-ocaml@e32b06a3e831ff2fbc6f08cf35be2085e3918014 # v3
25- with :
26- ocaml-compiler : " 5.1"
37+ uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
38+ - name : Set up OCaml toolchain (self-hosted; replaces ocaml/setup-ocaml)
39+ run : |
40+ sudo apt-get update
41+ sudo apt-get install -y --no-install-recommends opam ocaml
42+ opam init --bare --disable-sandboxing --yes
43+ # Prefer the runner's system OCaml (>= 4.14 satisfies dune-project)
44+ # for an instant switch; fall back to a pinned base compiler.
45+ opam switch create . ocaml-system --no-install --yes \
46+ || opam switch create . ocaml-base-compiler.4.14.2 --no-install --yes
47+ opam exec -- ocaml -version
2748 - name : Set up Node.js
2849 uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v4
2950 with :
3051 node-version : " 20"
3152 - name : Install dependencies
32- run : opam install . --deps-only --with-test --with-doc
53+ run : opam install . --deps-only --with-test --with-doc --yes
3354 - name : Install tree-sitter CLI (for res-to-affine walker tests)
3455 # Same rationale as the migration-assistant job (see below):
3556 # npm distribution is the fast CI install (~5 s). The walker
@@ -72,21 +93,25 @@ jobs:
7293 run : opam exec -- dune build @fmt
7394 lint :
7495 runs-on : ubuntu-latest
75- timeout-minutes : 10
96+ timeout-minutes : 25
7697
7798 steps :
7899 - name : Checkout code
79- uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
80- - name : Set up OCaml
81- uses : ocaml/setup-ocaml@e32b06a3e831ff2fbc6f08cf35be2085e3918014 # v3
82- with :
83- ocaml-compiler : " 5.1"
100+ uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
101+ - name : Set up OCaml toolchain (self-hosted; replaces ocaml/setup-ocaml)
102+ run : |
103+ sudo apt-get update
104+ sudo apt-get install -y --no-install-recommends opam ocaml
105+ opam init --bare --disable-sandboxing --yes
106+ opam switch create . ocaml-system --no-install --yes \
107+ || opam switch create . ocaml-base-compiler.4.14.2 --no-install --yes
108+ opam exec -- ocaml -version
84109 - name : Install dependencies
85110 # Match the build job: `dune build` compiles everything including
86111 # test/ (which depends on alcotest, with-test) and the @doc target
87112 # below (which depends on odoc, with-doc). Without these flags, lint
88113 # fails on missing alcotest before it ever reaches the doc step.
89- run : opam install . --deps-only --with-test --with-doc
114+ run : opam install . --deps-only --with-test --with-doc --yes
90115 - name : Build
91116 run : opam exec -- dune build
92117 - name : Lint with odoc
@@ -97,17 +122,21 @@ jobs:
97122 # §"Bench standards". Does NOT block merge. Promotion to a
98123 # ratcheted gate requires a calibrated baseline first.
99124 runs-on : ubuntu-latest
100- timeout-minutes : 10
125+ timeout-minutes : 25
101126
102127 steps :
103128 - name : Checkout code
104- uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
105- - name : Set up OCaml
106- uses : ocaml/setup-ocaml@e32b06a3e831ff2fbc6f08cf35be2085e3918014 # v3
107- with :
108- ocaml-compiler : " 5.1"
129+ uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
130+ - name : Set up OCaml toolchain (self-hosted; replaces ocaml/setup-ocaml)
131+ run : |
132+ sudo apt-get update
133+ sudo apt-get install -y --no-install-recommends opam ocaml
134+ opam init --bare --disable-sandboxing --yes
135+ opam switch create . ocaml-system --no-install --yes \
136+ || opam switch create . ocaml-base-compiler.4.14.2 --no-install --yes
137+ opam exec -- ocaml -version
109138 - name : Install dependencies
110- run : opam install . --deps-only --with-test --with-doc
139+ run : opam install . --deps-only --with-test --with-doc --yes
111140 - name : Build bench targets
112141 run : opam exec -- dune build @bench --force
113142 continue-on-error : true
@@ -133,7 +162,7 @@ jobs:
133162 } >> "$GITHUB_STEP_SUMMARY"
134163 - name : Upload bench log
135164 if : always()
136- uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
165+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4
137166 with :
138167 name : bench-output
139168 path : bench-output.log
@@ -143,17 +172,21 @@ jobs:
143172 # docs/standards/TESTING.adoc §"Coverage (visibility-only)".
144173 # No merge-blocking floor today.
145174 runs-on : ubuntu-latest
146- timeout-minutes : 10
175+ timeout-minutes : 25
147176
148177 steps :
149178 - name : Checkout code
150- uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
151- - name : Set up OCaml
152- uses : ocaml/setup-ocaml@e32b06a3e831ff2fbc6f08cf35be2085e3918014 # v3
153- with :
154- ocaml-compiler : " 5.1"
179+ uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
180+ - name : Set up OCaml toolchain (self-hosted; replaces ocaml/setup-ocaml)
181+ run : |
182+ sudo apt-get update
183+ sudo apt-get install -y --no-install-recommends opam ocaml
184+ opam init --bare --disable-sandboxing --yes
185+ opam switch create . ocaml-system --no-install --yes \
186+ || opam switch create . ocaml-base-compiler.4.14.2 --no-install --yes
187+ opam exec -- ocaml -version
155188 - name : Install dependencies
156- run : opam install . --deps-only --with-test --with-doc
189+ run : opam install . --deps-only --with-test --with-doc --yes
157190 - name : Run tests with bisect_ppx instrumentation
158191 run : |
159192 opam exec -- dune runtest --force --instrument-with bisect_ppx
@@ -178,7 +211,7 @@ jobs:
178211 } >> "$GITHUB_STEP_SUMMARY"
179212 - name : Upload coverage HTML
180213 if : always()
181- uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
214+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4
182215 with :
183216 name : coverage-html
184217 path : _coverage
@@ -203,7 +236,7 @@ jobs:
203236
204237 steps :
205238 - name : Checkout code
206- uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 .0.3
239+ uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 .0.0
207240 - name : Set up Node.js
208241 uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v4
209242 with :
@@ -248,7 +281,7 @@ jobs:
248281
249282 steps :
250283 - name : Checkout code
251- uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 .0.3
284+ uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 .0.0
252285 - name : Set up Node.js
253286 uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v4
254287 with :
0 commit comments