From 158b1a19b0aad08af16a679bd00a33eca624a61f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 13:44:05 +0000 Subject: [PATCH 1/3] ci: persist-credentials off on four checkouts, skip unchanged renv cache save, weekly Julia canary, upstream-patch note Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7ZkJwTENF5faco36Cn5 --- .github/workflows/ci.yml | 25 +++++++++- .github/workflows/julia-canary.yml | 54 +++++++++++++++++++++ docs/maintenance/ci-speed-upstream-patch.md | 41 ++++++++++++++++ 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/julia-canary.yml create mode 100644 docs/maintenance/ci-speed-upstream-patch.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5061224e..d635192a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,6 +161,8 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false # nothing here pushes # The required "SonarCloud Code Analysis" check is the GitHub App's # automatic analysis -- nothing in this repository configures or runs it, @@ -304,6 +306,15 @@ jobs: renv-${{ runner.os }}-R${{ env.R_APT_VERSION }}-${{ hashFiles('renv.lock') }}- renv-${{ runner.os }}-R${{ env.R_APT_VERSION }}- + # SHA-512 of the cache contents before and after the install, so the save below + # is skipped when this run added nothing (the key is unique per run, so an + # unchanged cache would otherwise be uploaded again for no benefit). + - name: Hash the renv cache before the install + id: renv_before + run: | + sudo mkdir -p /opt/renv-cache + echo "hash=$(sudo find /opt/renv-cache -type f -print0 | LC_ALL=C sort -z | sudo xargs -0 -r sha512sum | sha512sum | cut -d" " -f1)" >> "$GITHUB_OUTPUT" + # R_CLI_DYNAMIC and TERM make renv print progress one line at a time in the log. - name: Install R packages timeout-minutes: 25 @@ -331,8 +342,14 @@ jobs: if: always() run: sudo chmod -R a+rX /opt/renv-cache || true - - name: Save the renv cache + - name: Hash the renv cache after the install + id: renv_after if: always() + run: | + echo "hash=$(sudo find /opt/renv-cache -type f -print0 | LC_ALL=C sort -z | sudo xargs -0 -r sha512sum | sha512sum | cut -d" " -f1)" >> "$GITHUB_OUTPUT" + + - name: Save the renv cache + if: always() && steps.renv_after.outputs.hash != steps.renv_before.outputs.hash uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: /opt/renv-cache @@ -580,6 +597,8 @@ jobs: timeout-minutes: 60 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false # nothing here pushes - name: Set up Julia timeout-minutes: 10 @@ -739,6 +758,8 @@ jobs: AGDA_IMAGE: debian:trixie-20250929-slim@sha256:1caf1c703c8f7e15dcf2e7769b35000c764e6f50e4d7401c355fb0248f3ddfdb steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false # nothing here pushes # A pass is memoised on its inputs: the proofs, the checker pins and the # invocation. Pull requests reuse a pass whose inputs are unchanged, which @@ -869,6 +890,8 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false # nothing here pushes - name: Install proof tools timeout-minutes: 10 run: | diff --git a/.github/workflows/julia-canary.yml b/.github/workflows/julia-canary.yml new file mode 100644 index 00000000..732bd0c5 --- /dev/null +++ b/.github/workflows/julia-canary.yml @@ -0,0 +1,54 @@ +# SPDX-License-Identifier: MPL-2.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) +# +name: Julia canary + +# Weekly check that the dependency set still resolves and precompiles when +# Julia's package resolver is free to pick the newest compatible versions. The +# committed Manifest.toml pins CI; this run deliberately ignores it, so drift +# shows up here on a schedule instead of surprising the next pull request. +# It is not a required check and changes no ruleset. + +on: + schedule: + - cron: '17 5 * * 1' + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: julia-canary + cancel-in-progress: true + +jobs: + canary: + name: Julia dependency canary + runs-on: ubuntu-24.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false # nothing here pushes + + - name: Set up Julia + timeout-minutes: 10 + run: bash scripts/install-ci-julia.sh + + - name: Resolve without the Manifest + timeout-minutes: 10 + run: | + rm -f Manifest.toml + julia --project=. -e 'import Pkg; Pkg.resolve(); Pkg.instantiate()' + + - name: Report what moved + run: | + { + echo '### Julia canary' + echo + echo 'Newest compatible versions resolved without Manifest.toml. Outdated packages:' + echo + echo '```' + julia --project=. -e 'import Pkg; Pkg.status(outdated=true)' 2>&1 + echo '```' + } >> "$GITHUB_STEP_SUMMARY" diff --git a/docs/maintenance/ci-speed-upstream-patch.md b/docs/maintenance/ci-speed-upstream-patch.md new file mode 100644 index 00000000..26f869b8 --- /dev/null +++ b/docs/maintenance/ci-speed-upstream-patch.md @@ -0,0 +1,41 @@ +# CI speed work: what it changed and how to take it upstream + +This records the CI speed, fail-early and diagnostics work merged on the fork in +PR #328, with the follow-up in this change. It is a note for whoever carries the +work to `JoshuaJewell/MetaManifold-WebUI`; nothing here has been pushed or posted there. + +## What changed + +- Precompiled Julia caches keyed on the Julia pin, the R apt pin and `Manifest.toml`. +- Fail-early gates, per-step timing and a classifier for failure causes. +- An Agda pass memo: a pull request reuses an earlier pass when the proofs, the + checker pins and the invocation are unchanged. +- All eleven Python files replaced by GNU `bc`, `awk` and Julia. No Python tests + or scripts remain. +- The renv cache save is skipped when a SHA-512 of the cache contents is the same + before and after the R install. +- `persist-credentials: false` on the four `ci.yml` checkouts that were missing it. +- A weekly, non-required Julia dependency canary (`julia-canary.yml`). + +## Measured, cold cache (job timings) + +| Step | Before | After | +| --- | --- | --- | +| Julia tests job | 27m58s | 23m38s | +| Instantiate | 3m55s | 31s | +| Validated-statistics step | 2m37s | 49s | +| Full-suite "Run tests" step | 17m52s | 13m28s | +| Statistics standards job | 17m49s | 8m39s | +| Mutation campaign | 11m25s | 5m13s | + +"Rebuild RCall" is still about 5m04s because `Pkg.build` precompiles. + +Warm-cache timings: not measured yet. They are added below once a second run on +the same cache key has finished. + +## Taking it upstream + +A patch against upstream `89be534` applied cleanly in a scratch clone. Generate it +from the merge commit `c20ae05` and this change, apply it on a branch of the +upstream repository, and let upstream CI run. No ruleset, required check or job +name changes, and no matrix is added. From ae9abe27d3262bd7c5f44b936e675a3d65e0717b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 13:44:18 +0000 Subject: [PATCH 2/3] ci: canary comment matches what it runs Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7ZkJwTENF5faco36Cn5 --- .github/workflows/julia-canary.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/julia-canary.yml b/.github/workflows/julia-canary.yml index 732bd0c5..f0e2872a 100644 --- a/.github/workflows/julia-canary.yml +++ b/.github/workflows/julia-canary.yml @@ -3,7 +3,7 @@ # name: Julia canary -# Weekly check that the dependency set still resolves and precompiles when +# Weekly check that the dependency set still resolves and installs when # Julia's package resolver is free to pick the newest compatible versions. The # committed Manifest.toml pins CI; this run deliberately ignores it, so drift # shows up here on a schedule instead of surprising the next pull request. From 7f53763e2c833cb01e49ae6b7534d5283b288869 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 14:14:36 +0000 Subject: [PATCH 3/3] ci: canary relies on instantiate to fetch registries and resolve With no registries installed, Pkg.resolve() fails before Pkg.instantiate() runs. Instantiate downloads the registries and resolves when there is no Manifest.toml. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7ZkJwTENF5faco36Cn5 --- .github/workflows/julia-canary.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/julia-canary.yml b/.github/workflows/julia-canary.yml index f0e2872a..b9fe335f 100644 --- a/.github/workflows/julia-canary.yml +++ b/.github/workflows/julia-canary.yml @@ -39,7 +39,7 @@ jobs: timeout-minutes: 10 run: | rm -f Manifest.toml - julia --project=. -e 'import Pkg; Pkg.resolve(); Pkg.instantiate()' + julia --project=. -e 'import Pkg; Pkg.instantiate()' - name: Report what moved run: |