Repository navigation
Enable CI, disable CD - #4166
Open
yiyi-wang-rv wants to merge 1 commit into
Open
yiyi-wang-rv wants to merge 1 commit into
yiyi-wang-rv wants to merge 1 commit into
Conversation
Keep the pull-request CI and remove the release/deploy workflows, so that no workflow uses a repository secret. - Delete release.yml and update-deps.yml, and the Version Bump job of master.yml: they used JENKINS_GITHUB_PAT and CACHIX_PUBLIC_TOKEN. - Keep master.yml's Cache Stack job as cache-stack.yml. It builds on every push to master and saves the stack cache that pull requests restore from; it uses no secret. - Set `permissions: contents: read`, pin every action to the commit SHA of its latest release, and set `persist-credentials: false` on every checkout. - Stop writing GITHUB_TOKEN into the Nix configuration, and drop the Install Nix step from the self-hosted Nix / Integration job: the runner already has Nix. - Check out the pull request's head commit in Formatting and Style and HLint instead of its branch name, which does not exist here for fork pull requests. Nothing pushes from those jobs any more. - Quote two shell expansions that shellcheck flags. - Add actionlint and zizmor checks for the workflows, as in K. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
palinatolmach
pushed a commit
to runtimeverification/mir-semantics
that referenced
this pull request
Nov 12, 2026
### Why CI on this repository should run without any repository secrets, and CD is removed. This does for mir-semantics what runtimeverification/k#4974, runtimeverification/llvm-backend#1223 and runtimeverification/haskell-backend#4166 did. It supersedes #1094 and keeps its commits. #1094 removed CD and every secret, but its self-hosted jobs failed in `Set up Docker` with exit code 125. The commit on top fixes that and adds the same hardening as the other repositories. ### What changes **From #1094: CD and every secret removed** - `release.yml`, `p-token-release.yml` and `master-push.yml`: the release pipeline (version bump, GitHub releases, Docker Hub images, Cachix). - `update-dependencies.yml`: dependency-bump automation. - `test-cachix-pin.yml` and `.github/scripts/check-cachix-pin.sh`. - `JENKINS_GITHUB_PAT` removed from the checkouts. The only submodule, `stable-mir-json`, is public. - `cachix-action` removed from the `Nix Tests` job. - Actions bumped to their latest releases. **Self-hosted jobs on rootless Podman** - **The CI image's base is now fully qualified,** as `docker.io/runtimeverificationinc/kframework-k`. Rootless Podman refuses the short name when no unqualified-search registry is configured, and that was the exit code 125 in #1094. - **`with-docker` no longer overrides `USER`.** `USER` is exported, and rootless Podman looks up the runner user's subordinate UIDs by `$USER`. With `USER=github-user` it found none and fell back to a single mapping, where only root exists in the container. The image build then failed at its first `apt-get`. The container user is now `CONTAINER_USER`. - **The checkout is copied with `docker cp ./.`** instead of `docker cp .`. On the runners' Podman, a bare `.` landed in a subdirectory, and `make` found no Makefile. K and llvm-backend use `./.`. - **Each job and matrix entry gets its own container name.** All six `Integration Tests` entries used `mir-semantics-ci-<sha>`, so two of them on one runner removed each other's container. - **Containers are cleaned up reliably.** Each container is force-removed before it starts and torn down with `docker rm -f || true`. A container left over from a canceled run of the same commit no longer blocks the next run. - **`Nix Tests` no longer runs `install-nix-action`** on the self-hosted runners, which already have Nix. On those runners it only printed `Aborting: Nix is already installed`. **Hardening** - `permissions: contents: read` on every workflow, and `persist-credentials: false` on every checkout. - In `test-stable-mir-ui.yml` this also covers the rust-lang/rust checkout. Before, it was copied into the container with the token still in its git config. - Every action is pinned to the commit SHA of its latest release: checkout v7.0.1, setup-uv v10.3.3, install-nix-action v31.11.3, setup-buildx-action v4.4.1, build-push-action v7.4.0, upload-artifact v7.0.2, zizmor-action v0.8.1. - No `${{ }}` expressions are left in `run:` blocks. They go through `env:` instead. - New `lint-workflows.yml` and `.github/zizmor.yml`, identical to K's: - **actionlint**: pinned to 1.7.12, with the download's checksum verified. - **zizmor**: reports findings as annotations and fails the check. Neither is a required check yet. **Fixes** - **`smir-parse-tests` ran no tests in CI.** It looked for the tests under `$(PWD)`, which `docker exec` does not set, so `Integration with stable-mir-json` passed without parsing anything. It now uses `$(CURDIR)`, and fails if it finds no tests. Its 35 tests pass. - `Test Kmir Image` appended its summary to a file literally named `GITHUB_STEP_SUMMARY`. Its job outputs are gone too, since only the release pipeline used them. - `test-stable-mir-ui.yml` copied the rust-lang/rust checkout into the container twice: once with the workspace, and again into `rust/rust`. Runs of the same commit, which share a container name, no longer overlap. - `nix/README.md` no longer says CI uploads to the binary cache. ### Tested CI on this PR passed: all 14 checks, including all 8 self-hosted jobs. The Docker jobs ran on github-runner-01, -02 and -03. - The integration test suites all pass: - `LLVM Concrete Tests`: 60 passed - `Haskell Exec SMIR`: 40 passed - `Haskell Termination`: 20 passed - `Haskell Proofs`: 106 passed - `Verify Rust Std`: 16 passed - `Remainder`: 129 passed, 7 skipped - `Unit Tests`: 40 passed. - `Integration with stable-mir-json` parses all 35 `smir-parse-tests` programs, instead of none. - `Nix Tests (normal)` and `Nix Tests (MacM1)` pass on the runners' own Nix, with no Cachix step. - Every job's `GITHUB_TOKEN` was read-only (`Contents: read`). No job used a secret, and no token value appears in any log. ### Notes for reviewers - **Releases stop.** Merging to `master` no longer bumps the version, tags, publishes a GitHub release, pushes `runtimeverificationinc/kmir` to Docker Hub, or pushes to Cachix. `package/version.sh` is kept for manual use. - **The CI images are frozen at K 7.1.337.** `.github/workflows/Dockerfile` and `Dockerfile.kmir` build `FROM runtimeverificationinc/kframework-k:ubuntu-jammy-<deps/k_release>`. Only K's release pipeline published that image, and that pipeline is gone, so bumping `deps/k_release` past 7.1.337 will break `Set up Docker` and `Test Kmir Image` until the image is published some other way. - **`Nix Tests (normal)` relies on the runner's own Nix configuration** for the `k-framework` cache. The workflow cannot add it: the runner user is not a trusted Nix user, so `cachix use` was already refused there. If the job times out, the runner admins can add `extra-substituters = https://k-framework.cachix.org` and its public key to `/etc/nix/nix.conf`. It is a public cache, so no token is needed. - **The only token CI still uses is the automatic, per-run `GITHUB_TOKEN`**, read-only. - **PR code runs on persistent self-hosted runners.** zizmor's auditor persona flags those jobs; that is by design. Keep "require approval" for outside contributors on. - **Required checks:** all 12 required checks on `master` keep their names. ### Follow-ups - Decide what replaces release/CD: version bump, tags, GitHub releases, Docker images, Cachix. - Publish `kframework-k` images somewhere other than K's removed release pipeline, or build the CI image from a public base plus the K release `.deb`. - Dependency bumps (K, stable-mir-json, uv, rust toolchain) are manual for now. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Everett Hildenbrandt <everett.hildenbrandt@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CI on this repository has to run without any secrets. CD goes away completely. This does for the Haskell
backend what runtimeverification/k#4974 and runtimeverification/llvm-backend#1223 did.
#4159 already removed the PAT and the Cachix token from
Test. What was left:Bump version and make release job, which has failed on every push tomasterlately;What changes
Removed CD and every secret
release.yml: on a push torelease, drafted a GitHub release, pushed the Nix closure toCachix with
CACHIX_PUBLIC_TOKEN, uploaded the jammy.deb, published the release, anddispatched
runtimeverification/devopswithJENKINS_GITHUB_PAT.update-deps.yml: synced rv-nix-tools on_update-deps/*branches withJENKINS_GITHUB_PATand
CACHIX_PUBLIC_TOKEN.master.yml'sVersion Bumpjob: pushed a version bump toreleasewithJENKINS_GITHUB_PAT.Kept:
Cache Stackonmastermaster.yml's other job is nowcache-stack.yml. It builds and unit-tests every push tomasterand saves the stack cache that pull requests can restore from. It needs no secret.Stack / Unit Testsspends about 13 minutes building dependencies.Hardening
permissions: contents: readon every workflow. Until now the token got the repositorydefault, which is write access to contents, pull requests, actions and more.
Nix / Integrationalso getspull-requests: read, becausedorny/paths-filterlists thechanged files through the API.
persist-credentials: falseon every checkout.Every action is pinned to the commit SHA of its latest release: checkout v7.0.1,
install-nix-action v31.11.3, cache v6.1.0, haskell-actions/setup v2.12.1,
paths-filter v4.0.3, zizmor-action v0.8.1. actions/cache v6 restores caches saved by v5.
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}is removed from the Nix configuration.On GitHub-hosted runners, install-nix-action still adds the per-job, now read-only
GITHUB_TOKENtonix.confby itself, as it does in K.Nix / IntegrationdropsInstall Nix. The self-hosted runner already has Nix, and the steponly printed
Aborting: Nix is already installed.New
lint-workflows.ymland.github/zizmor.yml, identical to K's:Neither is a required check yet.
Smaller changes
Formatting and StyleandHLintcheck out the pull request's head commit instead of itsbranch name. The branch does not exist in this repository for fork pull requests. Full
history is no longer fetched: it was only needed to push fourmolu commits, which ci(test): remove PAT and Cachix token dependencies from the Test workflow #4159 removed.
hpack_versionvariable is gone.Tested
CI on this PR passed: all 8 checks, including the self-hosted
Nix / IntegrationandmacOS
Nix / Unit Testsjobs. The logs confirm that:kore-testtests and 980 boosterunit-teststests in each.Stack / Unit Testsbuilds the Ubuntu package with haskell-actions/setup v2.12.1 andactions/cache v6.1.0.
GITHUB_TOKENwas read-only:Contents: read, plusPullRequests: readforNix / Integration. Before this PR, the token had write access.Nix / Integrationskipped its integration tests, as designed: they run only when Haskellcode, tests or the build files change, and this PR changes only
.github/.Notes for reviewers
masterno longer bumps the version, publishes a release, a.debor a Cachix closure, or notifiesdevops. K takes the Haskell backend from its GitHubreleases, so K cannot move to a newer Haskell backend until releases are made by hand.
releasebranch still carries the oldrelease.yml. It runs on any push to that branchand references
CACHIX_PUBLIC_TOKENandJENKINS_GITHUB_PAT. Delete or lock the branch, ordisable the
Release,Bump version and make release jobandUpdate Versionworkflows in theActions settings.
CACHIX_SIGNING_KEY,KORE_CACHIX_SIGNING_KEYandRUNTIMEVERIFICATION_CACHIX_SIGNING_KEY(from 2020), and the organization's
CACHIX_PUBLIC_TOKEN. They should be deleted.Nix / Integration, and the macOSNix / Unit Tests). zizmor's auditor persona flags this, by design. The Linux runner's own Nixconfiguration still lists private Cachix caches whose tokens have been revoked. Their owners
should remove that configuration. Keep "require approval" for outside contributors on.
masterkeep their names.cachix/cachix-actiontotest.ymlworkflow #4160 re-addscachix-actiontotest.yml, so it will conflict with this PR. On the self-hostedrunners,
cachix-actionpicks up a revoked token that is stored there, which is why K andllvm-backend dropped it there.
Follow-ups
Cachix and the
devopsdispatch.update-deps.yml) is gone. rv-nix-tools bumps are manual for now.package/version.shis kept for manual use.🤖 Generated with Claude Code