How skipping works
How a job's hash becomes a skip on GitHub Actions, the rules it follows, and its limits today.
Skipping rests on one rule: a job may skip only when everything its result depends on is exactly what it was when it last passed. cigen hashes that state (the job’s inputs, declared and derived), and keeps a record of each hash that passed.
On GitHub Actions
Every job with inputs gets cigen installed on the runner, then four steps after
its checkout:
- Compute source hash.
cigen hash --job <id>hashes the job’s inputs and writes the result to a step output. - Restore skip cache.
actions/cachelooks for the exact keyjob-skip-<os>-<job>-<hash>. Only an exact match counts. - Skip job (cached). On a hit, every remaining step is skipped and the job ends green.
- Record job completion. If every step passed, a marker is saved under that key, so the next run with the same hash skips.
The generated steps look like this (trimmed):
# generated: .github/workflows/ci.yml
- name: Compute source hash
id: compute_hash
run: cigen hash --job test --output job_hash
- name: Restore skip cache
id: job_skip_cache
uses: actions/cache@v4
with:
path: .cigen/skip-cache/test
key: job-skip-${{ runner.os }}-test-${{ steps.compute_hash.outputs.job_hash }}
- name: Skip job (cached)
if: steps.job_skip_cache.outputs.cache-hit == 'true'
run: echo 'Job cache hit; skipping remaining steps.' && exit 0
- run: cargo test
if: steps.job_skip_cache.outputs.cache-hit != 'true'
The hash step finds a cigen.yml or .cigen/ config by itself. For a config with any other name, such as
cigen generate --config ci.yml, it passes --config ci.yml.
Installing cigen on the runner
The hash step runs cigen, so the jobs that skip need it on the runner. cigen_install says how they get it.
By default (release), a step Install cigen <version> downloads the cigen release whose version generated the
workflow, for the runner’s OS and architecture (Linux or macOS, x86_64 or arm64), checks it against the release’s
.sha256, and puts it on PATH. A download that doesn’t match its checksum fails the job, before anything can skip.
The .sha256 comes from the same release as the archive, so this catches a corrupt or truncated download, not a
release someone replaced.
Set CIGEN_RELEASE_URL on the runner to download from a mirror with the same layout as the GitHub releases.
A repository that builds cigen itself, as cigen’s own does to test the commit under review, names the job that builds it:
# cigen.yml
provider: github
cigen_install:
job: build_cigen
workflows:
ci:
jobs:
build_cigen:
image: rust:latest
steps:
- run: cargo build --workspace && mkdir -p out && cp target/debug/cigen* out/
- uses: actions/upload-artifact@v4
with:
name: cigen-bin
path: out
test:
image: rust:latest
inputs: 'src/**'
steps:
- run: cargo test
Every other job in that workflow then needs that job and takes cigen from the cigen-bin artifact it uploads. The job
must exist, and must be in the same workflow as the jobs that skip:
# cigen.yml
# error: `cigen_install` names job `build_cigen`, which isn't defined
provider: github
cigen_install:
job: build_cigen
workflows:
ci:
jobs:
test:
image: rust:latest
steps:
- run: cargo test
The rules
These behaviours are covered by end-to-end tests that run generated workflows in a GitHub Actions simulator:
- An unchanged tree skips.
- A changed input, or a changed job definition, runs.
- A failed job records no pass, so the next run tries again.
- A pull request reuses passes recorded on
main, butmaincan’t reuse a pull request’s. - A pass expires after 7 days without use.
Limits today
- A skipped job still starts. Skipping happens step by step inside a running job, so it still takes a runner and a checkout. A planner job that decides before any job starts is planned.
- The install step needs its version’s release. It downloads the release whose version generated the workflow, and no release has the archives it expects yet (v0.2.0 will be the first), so a workflow generated by an unreleased build fails at that step until its version is released.
- Cache limits. Markers live in the GitHub Actions cache, so they inherit its rules: scoped by branch, evicted after 7 days unused, one lookup per job.
- Forcing a rerun means deleting the job’s cache entries, such as with
gh cache delete --allor by key prefixjob-skip-. - Under
act, the restore step is turned off, so every job runs.
On CircleCI
The CircleCI provider generates a setup workflow that hashes every job, looks for job-status markers in the CircleCI cache,
and continues with only the jobs that need to run. Its setup job can’t run end to end yet: it calls a form of
cigen generate the CLI doesn’t have, on an image without cigen.
Where it’s going
Pass records will be pluggable: the GitHub Actions cache by default, self-hosted stores such as Redis or S3, and a free hosted store on VisualCI that is visible across branches and never evicted. If a store can’t be reached, every job runs: skipping must never fail or block a build. See the roadmap.