@@ -20,6 +20,8 @@ name: DOCS
2020jobs :
2121 build :
2222 runs-on : ubuntu-latest
23+ container :
24+ image : rust:latest
2325 needs :
2426 - ci_gate
2527 steps :
4951 with :
5052 name : cigen-bin
5153 path : .cigen/bin
54+ continue-on-error : true
55+ - name : Ensure cigen binary
56+ run : |
57+ set -e
58+ if [ ! -x .cigen/bin/cigen ]; then
59+ echo 'cigen binary not found; building from source'
60+ cargo build --release --bin cigen
61+ mkdir -p .cigen/bin
62+ cp target/release/cigen .cigen/bin/cigen
63+ fi
5264 - name : Prepare cigen binary
5365 run : |
5466 set -e
@@ -163,59 +175,11 @@ jobs:
163175 fi
164176 - name : Checkout repository
165177 uses : actions/checkout@v4
166- - name : Download cigen binary
167- uses : actions/download-artifact@v4
168- with :
169- name : cigen-bin
170- path : .cigen/bin
171- - name : Prepare cigen binary
172- run : |
173- set -e
174- mkdir -p .cigen/bin
175- chmod +x .cigen/bin/cigen
176- - name : Compute source hash
177- id : compute_hash
178- run : |
179- set -euo pipefail
180- mkdir -p .cigen/skip-cache
181- mkdir -p .cigen/cache
182- ./.cigen/bin/cigen hash \
183- --job ci_gate \
184- --config .cigen \
185- --base-dir . \
186- --output job_hash \
187- --cache .cigen/cache/file-hashes.json
188- - name : Restore skip cache
189- id : job_skip_cache
190- uses : actions/cache@v4
191- with :
192- path : .cigen/skip-cache/ci_gate
193- key : job-skip-${ runner.os }-ci_gate-${ steps.compute_hash.outputs.job_hash }
194- restore-keys : job-skip-${ runner.os }-ci_gate-
195- if : ${{ env.ACT != 'true' }}
196- - name : Skip job (cached)
197- if : steps.job_skip_cache.outputs.cache-hit == 'true'
198- run : echo 'Job cache hit; skipping remaining steps.' && exit 0
199178 - uses : actions/github-script@v7
200179 with :
201180 script : |
202181 const wait = require('./.github/wait-for-checks.js');
203182 await wait({ github, context, core, checks: ["test"] });
204- if : steps.job_skip_cache.outputs.cache-hit != 'true'
205- - name : Record job completion
206- if : success() && steps.job_skip_cache.outputs.cache-hit != 'true'
207- run : |
208- set -e
209- HASH="${JOB_HASH}"
210- if [ -z "$HASH" ]; then
211- echo 'JOB_HASH missing' >&2
212- exit 1
213- fi
214- MARKER=.cigen/skip-cache/ci_gate/$HASH
215- mkdir -p "$(dirname "$MARKER")"
216- date > "$MARKER"
217- env :
218- JOB_HASH : ${{ steps.compute_hash.outputs.job_hash }}
219183 deploy :
220184 environment :
221185 name : github-pages
@@ -245,52 +209,4 @@ jobs:
245209 fi
246210 - name : Checkout repository
247211 uses : actions/checkout@v4
248- - name : Download cigen binary
249- uses : actions/download-artifact@v4
250- with :
251- name : cigen-bin
252- path : .cigen/bin
253- - name : Prepare cigen binary
254- run : |
255- set -e
256- mkdir -p .cigen/bin
257- chmod +x .cigen/bin/cigen
258- - name : Compute source hash
259- id : compute_hash
260- run : |
261- set -euo pipefail
262- mkdir -p .cigen/skip-cache
263- mkdir -p .cigen/cache
264- ./.cigen/bin/cigen hash \
265- --job deploy \
266- --config .cigen \
267- --base-dir . \
268- --output job_hash \
269- --cache .cigen/cache/file-hashes.json
270- - name : Restore skip cache
271- id : job_skip_cache
272- uses : actions/cache@v4
273- with :
274- path : .cigen/skip-cache/deploy
275- key : job-skip-${ runner.os }-deploy-${ steps.compute_hash.outputs.job_hash }
276- restore-keys : job-skip-${ runner.os }-deploy-
277- if : ${{ env.ACT != 'true' }}
278- - name : Skip job (cached)
279- if : steps.job_skip_cache.outputs.cache-hit == 'true'
280- run : echo 'Job cache hit; skipping remaining steps.' && exit 0
281212 - uses : actions/deploy-pages@v4
282- if : steps.job_skip_cache.outputs.cache-hit != 'true'
283- - name : Record job completion
284- if : success() && steps.job_skip_cache.outputs.cache-hit != 'true'
285- run : |
286- set -e
287- HASH="${JOB_HASH}"
288- if [ -z "$HASH" ]; then
289- echo 'JOB_HASH missing' >&2
290- exit 1
291- fi
292- MARKER=.cigen/skip-cache/deploy/$HASH
293- mkdir -p "$(dirname "$MARKER")"
294- date > "$MARKER"
295- env :
296- JOB_HASH : ${{ steps.compute_hash.outputs.job_hash }}
0 commit comments