local-ci
Run the GitHub Actions jobs your branch would trigger, on your machine, and get a short report back.
local-ci run # what a pull request of these changes would trigger
local-ci run --all # every check a pull request can trigger
local-ci reads .github/workflows/ (or the directories
.local-ci.toml names), works out which workflows a pull request
from this branch would start (triggers, branches, paths / paths-ignore),
and runs their jobs in a throwaway git worktree of the commit. It prints one
line per job and, for a failure, the end of the failing step's log. Full logs
and a JSON result are kept on disk.
It is meant for the moment before you push, and for coding agents that need to know "would CI pass?" without reading workflow files and logs themselves.
With examples/demo and a change that breaks one test shard:
$ local-ci run --no-status
local-ci 0.1.0 · 350924e vs main · 1 file changed · triggered by the changes · logs ~/Library/Caches/local-ci/runs/demo-2daacfc9/1793539365-350924e
setup ok 1 step 0s
PASS ci.yml › lint 0s
PASS ci.yml › discover 0s
PASS ci.yml › test (1) 0s
FAIL ci.yml › test (2) › Unit tests (shard 2) (exit 1) 0s
PASS ci.yml › integration 3s
SKIP deploy (needs failed)
── ci.yml › test (2) › Unit tests (shard 2) (exit 1)
expected 5, got 4
log: ~/Library/Caches/local-ci/runs/demo-2daacfc9/1793539365-350924e/ci-test-2/03-unit-tests-shard-2.log
result: failure · pass 4 / fail 1 / error 0 / skip 1 · 3s
status: not posted (--no-status)
It is not a GitHub Actions runner. Jobs run directly on your machine (not in
Ubuntu containers), with the tools you have installed. What cannot be
reproduced locally is skipped and listed under not covered instead of being
reported as a pass.
Install
cargo install local-ci
Or download a binary from the releases.
Commands
| Command | What it does |
|---|---|
local-ci plan |
Show the workflows, units and setup steps that would run. Runs nothing. |
local-ci run |
Run them and report. Exit code 0 = success (or no_work: the changes trigger no workflow), 1 = failure, 2 = error (could not run, or the result lacks something the plan expects), 3 = incomplete (what ran passed, but steps or workflows that local-ci cannot reproduce were left out, so it is not a pass; the commit status is error), 130 = interrupted. |
local-ci status |
Record the last run's result as the local-ci commit status (for a commit you have pushed since). |
Common options (plan and run):
| Option | |
|---|---|
--base <ref> |
Compare against this ref. Default: origin's default branch. |
--sha <rev> |
Test this commit. Default: HEAD. Uncommitted changes are never tested. |
--all |
All checks: ignore paths / paths-ignore, and run workflows that are disabled on GitHub. branches and types still apply, so a workflow that only runs on pushes to main stays out. |
--include-disabled |
Also run workflows that are disabled on GitHub, with paths / paths-ignore still applied. --all implies it. |
--workflows-dir <dir> |
Also read the workflows in this directory (relative to the repository root, repeatable), besides .github/workflows or the directories .local-ci.toml names. GitHub never runs them, so this is the place for checks you only want before pushing. They are picked by the same triggers and paths, read from the commit like the rest, and named by their path in the output (ci/local/mutation.yml › ...). |
-w, --workflow <file or name> |
Only these workflows. |
-j, --job <id> |
Only these jobs, plus the jobs they need. |
-C <dir> |
Repository directory. |
run also takes --parallel <n>, --containers <n>, --no-traffic-controller, --no-portool, --no-status, --keep
(keep the worktrees), --tail <lines>, --job-timeout <minutes> and --json.
.local-ci.toml
An optional file at the repository root. Like the workflows, it is read from the commit under test, so commit it before it takes effect.
# Read workflows from here instead of .github/workflows
= [".ci/workflows"]
# Always run these, even when a recent result covers them
= ["e2e.yml", "api-ci.yml:contract"]
[]
# Env names that do not change what an install does (see below)
= ["DATABASE_URL", "CI"]
| Key | |
|---|---|
workflows-dirs |
Directories to read workflows from, relative to the repository root. They replace .github/workflows; --workflows-dir still adds to them. Each one must hold a .yml / .yaml file at the commit. The workflows in the first one are named by their file name in the output (ci.yml › test), the others by their path. |
no-cache |
Workflows (ci.yml) or jobs (ci.yml:e2e) whose results are never reused (see Reused results). |
link-node-modules |
true to give units' copies links to setup's packages instead of a clone of each node_modules. Off by default. |
[setup] ignore-env |
env: names left out of the keys of setup steps. Off (empty) by default. |
[setup] ignore-env. An install that two jobs run in one directory with a
different env: (workflow, job or step) is not shared: each job runs its own,
so that one never sees the result of the other's. That includes variables the
install does not read, such as a DATABASE_URL that only the tests use. List
those names and jobs that differ only in them share one install, which runs
with the value of the first job that has it. A name that does change the
install (NODE_ENV) must not be listed.
link-node-modules. Even a copy-on-write clone makes, and later deletes,
one file per file, and dependencies are most of the files: in a monorepo of
twenty units that is millions of files per run, each deletion also checked by
fseventsd. With the key on, a copy's node_modules is a directory of links
to the packages setup installed. A step that may write into one (an install,
npm rebuild, prisma generate, yarn, pnpm, patch-package, or an npm
command from inside a script) first gets a copy of its own; so does a project
whose node_modules links out of itself (workspaces, file: dependencies)
or whose tsconfig emits declarations. It is off by default because a tool
that follows a link to where the package really is, outside the unit's copy,
may refuse it: TypeScript emitting declarations fails with TS2742 (handled
as said), and a Next.js build with Turbopack does not find next outside
its workspace root (not handled: do not turn the key on for a repository
that builds with Turbopack). Run everything once with --no-cache after
turning it on.
Without the file, local-ci reads .github/workflows as before. An absolute
path, a path outside the repository (..), an empty list and an unknown key
are errors.
CI with local-ci only. To keep GitHub Actions from running your checks and
run them with local-ci alone, move the workflows out of .github/workflows
(the only place GitHub looks) and point local-ci at their new place:
mkdir -p .ci && git mv .github/workflows .ci/workflows
printf 'workflows-dirs = [".ci/workflows"]\n' > .local-ci.toml
git add .local-ci.toml && git commit -m "Run CI with local-ci"
local-ci run
The triggers, branches and paths of the moved files apply as before, and
local-ci status still records the result as the local-ci commit status.
Workflows outside .github/workflows are never seen as disabled on GitHub.
How a run works
- Reused results. A unit whose jobs all passed (or were skipped) in the
last 24 hours is not run again when nothing it depends on has changed: the
files its workflow's
pathscover (all files but itspaths-ignore, or every file when it has neither), every file at the repository root (lockfiles, shared configuration), everything under.github/and the workflow directories, the merge base and the branch, the versions of Node and of the tools its steps name (npm, yarn, pnpm, dart, flutter, rustc, python3, go), and local-ci itself. This trustspathsto name what the workflow depends on, as GitHub does when a pull request changes nothing it covers: a change in a shared directory the workflow does not list does not run it again. The report shows such jobs asPASS … cached (abc1234, 2h ago), still lists what they did not cover, and when every unit is reused nothing is checked out or installed. Units runningnpm auditor other advisory checks (also from apackage.jsonscript) are always run, since their result changes without the code; so are those listed inno-cache.--no-cacheruns everything (and keeps the new results). - Worktree. The commit is checked out with
git worktree add --detachunder the cache directory. Your working tree is never touched, so steps such asgit add -A,cp .env.example .envor generators that rewrite tracked files are harmless. The worktree is removed afterwards. - Setup, once. In CI every job runs
npm cion a fresh VM. Locally that would install the same dependencies once per job. Install steps (npm ci,flutter pub get,npx prisma generate, ...) and steps that several jobs repeat word for word at their start are run once, before any job, and skipped in the jobs. A step whose result cannot be carried to another job stays in its job: one that holds an expression, anif:orneeds/matrix-dependent env, one that needs the job's services, one that writesGITHUB_ENV/GITHUB_PATH/step outputs, and Python venv /pip installsteps (the venv lives at an absolute path).local-ci planlists them with the reason. Installs that happen later anyway (a matrix job, a script that callsnpm ci) go through annpmwrapper onPATH: a directory is installed once per run and lockfile, and laternpm ci/npm installthere are no-ops. - Units in parallel. Jobs linked by
needs:(or writing the same build output) form a unit and run in order. Units run in parallel, each in its own copy of the worktree as it is after setup, as each CI job has its own checkout: a job that edits files for a while (a negative control, a formatter, mutation testing) is not seen by the jobs beside it. The copy is a copy-on-write clone (clonefile(2)on APFS,cp --reflink=autoelsewhere). Withlink-node-modules = truein.local-ci.toml, eachnode_modulesholds links to the packages in setup's instead (see below). With task-traffic-controller, the entries of a matrix run at once too (up tostrategy.max-parallel), each in its own copy. Jobs that start services or containers, run Playwright or Cypress, or look like integration / e2e tests, are exclusive. Their fixed ports and Compose projects are rewritten (see below). With portool and a.portool.toml, exclusive jobs withoutservices:overlap freely, except a job that pins something rewriting cannot reach (a Compose file withcontainer_name:or a literal host port,docker run --name): it takes a per-repository lock. Units with aservices:job, and every exclusive unit without portool, hold that lock and never overlap, in this run or in anotherlocal-cirun of the same repository: a port their code picks for itself (a test server's) is not theirs alone. Either way, at most--containersexclusive jobs (default 2) run at once on the machine, across alllocal-ciruns, so databases do not pile up while their tests wait for CPU. - Report. One line per job, the tail of each failing step, where the logs
are, and the overall state:
success,failure,error,incomplete(parts that cannot be reproduced here were skipped, or a workflow could not be run at all;--jsonlists them undercompleteness.incompleteand the exit code is 3) orno_work(nothing is triggered).successis only for a run whose result has everything the plan expects. A job that waited a second or more for something says what it waited for and how long it really ran:PASS ci.yml › e2e 3m00s (ran 2m20s · waited slot 5m00s, queue 40s). The job'stimeinresult.jsonand in--jsonhas the same split, in seconds:work_secs(the job running: its services' start and its steps),wait_lock_secs(the per-repository lock),wait_slot_secs(one of the--containersslots),wait_queue_secs(task-traffic-controller letting a step start, summed over the steps) andwait_parallel_secs(one of the--parallelplaces). The job'ssecsstill counts from its first step and so includeswait_queue_secs; the other waits come before it. The waits of a unit before its jobs start go to its first job. Jobs that did not run, and reused results, have notime. Steps of a shell other than bash or sh that print nothing count as waiting for task-traffic-controller until they end. - Commit status. The state is posted as the
local-cicommit status withghwhen the commit is on GitHub. Before you push it is not; runlocal-ci statusafter pushing.--no-statusskips this.
What is supported
- Triggers
pull_request/pull_request_target(withtypes,branches,paths,paths-ignore) andpush. A run pretends to be a non-draft pull request into the base branch.workflow_dispatch,scheduleand the rest are reported as not triggered, and so are workflows disabled on GitHub (read withghwhen it is available) unless--include-disabledor--allis given. run:steps withbash(GitHub'sbash --noprofile --norc -eo pipefail),sh,pythonor a customshell: ... {0};working-directory,env,if:,continue-on-error,timeout-minutes.- Expressions: contexts
github,env,matrix,steps,needs,job,runner,strategy,inputs,vars; operators;success(),failure(),always(),cancelled(),contains,startsWith,endsWith,format,join,toJSON,fromJSON,hashFiles(always empty). Anything else is an error, never a silentfalse. strategy.matrixwithinclude/exclude, matrices computed fromneeds.*.outputs,fail-fast.$GITHUB_OUTPUT,$GITHUB_ENV,$GITHUB_PATH,$GITHUB_STEP_SUMMARY; joboutputs.services:with Docker. Each container gets a free host port, andlocalhost:<port>/127.0.0.1:<port>in the job'senvandrun:scripts (and*PORT*variables holding the port) are rewritten to it, so a database you already run on 5432 is not in the way. A host port the workflow never names that way is left as declared, since then the code itself defaults to it.--health-cmdis waited for.- Fixed ports and Compose projects in exclusive jobs (below). A port the job
sets itself — a number in a
*_PORTvariable of itsenv, orTEST_DB_PORT=15432 docker compose ...in a script — is given a free port, and every place the job uses it is rewritten the same way.docker compose -p <name>andCOMPOSE_PROJECT_NAME=<name>get a suffix of the run, so two runs never share a project and the clean-up never stops one you started yourself. uses:—actions/upload-artifact@v4andactions/download-artifact@v4run for real within one run (next section);actions/checkoutand caches are skipped;setup-node,setup-python,setup-go,setup-java,setup-ruby,flutter-action,setup-dartandrust-toolchaincheck that the tool is installed and warn when its version differs. Other actions are skipped and listed undernot covered.
Artifacts (upload-artifact@v4, download-artifact@v4)
Within one workflow run, an upload copies its files into the area of its
workflow (<run dir>/artifacts/<workflow>/<name>/v<N>/, <workflow> being the
workflow file's path made safe as a directory name), read-only, and writes a
receipt (name, each file's relative path, size and SHA-256, the plan digest,
the attempt and the job) before the step completes. A download reads the
receipt, checks every file against it and only then places the files, so a job
that needs the uploading job gets exactly what was uploaded. As on GitHub,
artifacts belong to a workflow run: two workflows may each upload a coverage
without a conflict, and a job cannot download what a job of another workflow
uploaded (it fails as not found, pattern included). A run is not a success while an
artifact its plan requires (a literal name, a step that always runs — no if:,
or one that is only always(), success(), !cancelled() or true — and
if-no-files-found: error) has no receipt.
A step local-ci cannot run (the table below) does not stop planning: the jobs
of that workflow that the run would start (jobs a --job filter leaves out are
not looked at; jobs whose if: is decided when they run are) are not run and
are reported as an error, in the output and in --json, naming the option,
the workflow, the job and the step. The other workflows run as usual.
Units that use these actions are kept in the results cache. A kept result
carries the artifacts its unit uploaded (receipt and files); reusing it puts
them into the area of its workflow in the run, every file checked against its receipt first
(the receipt then carries this run's plan digest and attempt, and
restored_from says which attempt made it), and a file that does not match
makes it a miss: the unit runs again. A unit that downloads is reused only when
each artifact it took (named literally) is, in this run and workflow, the same artifact
(same files, sizes and SHA-256) the result was kept against, which is the case
when the unit that uploads it is reused too. A download by pattern, or by a
name that is an expression, is never taken from the cache.
| Supported | Not supported (the workflow's jobs fail before they run) | |
|---|---|---|
| Action | actions/upload-artifact@v4, actions/download-artifact@v4; a 40-character commit SHA is run as v4 (its version cannot be checked, so the run warns once) |
other major versions (@v3, @v5), sub-actions such as upload-artifact/merge |
name |
upload: a name without / \ : " < > | * ?, default artifact; download: one artifact by name |
|
path (upload) |
several lines, * ? ** globs, ! exclusions, a directory takes what is under it; stored relative to the common ancestor of the lines; hidden files only with include-hidden-files: true |
an absolute path, .., a backslash |
| Multiple files | yes (sorted, each with its own size and SHA-256) | symlinks are not followed or uploaded |
if-no-files-found |
warn (default: the step passes with a warning), error (the step fails), ignore |
other values |
overwrite |
a second upload of a name is a conflict by default; overwrite: true records a new version, and a download takes the newest |
|
| Matrix | the name must read every key of the matrix (name: report-${{ matrix.os }}-${{ matrix.node }}; keys that include only adds to a variant are not asked for) or ${{ strategy.job-index }}; with or without overwrite |
a name that leaves a key out, so two variants would upload one name; one that holds the whole matrix (${{ matrix }}, toJSON(matrix)), which is JSON and always fails |
path (download) |
a directory under the workspace; the default is the workspace itself | an absolute path, .., a path through a symlink |
pattern, merge-multiple |
yes: without merge-multiple each artifact goes to <path>/<name>/; two artifacts writing one file is an error |
|
retention-days |
1 to 90, recorded in the receipt (local runs are kept until pruned) | |
compression-level |
0 to 9: accepted, no effect (files are stored as they are); recorded in the receipt | other values |
| Across runs, GitHub's side | run-id, repository, github-token, artifact-ids, skip-decompress and any other option |
A download does not wait for the uploading job to finish: it needs the receipt
only, so it must run after the job that uploads (needs:); a download with no
receipt is an error that says so. Moving artifacts to and from another host is
not part of local-ci.
A step whose script holds github.token is run with bash, sh or python (the
default shell is bash); the script is handed over a pipe and never written to a
file. With another shell (shell: pwsh {0}, shellcheck {0} && bash {0}) such
a step is not run and the run is an error. The value is replaced by *** in
logs, labels and notes; a changed form of it (base64, say) is not hidden.
Not covered: steps that read a secret other than github.token (which gets
this machine's gh auth token, never written to a file of the run), steps that push,
publish or deploy (git push, gh release, npm publish, aws, kubectl,
terraform apply, ...), steps that install system packages (sudo,
apt-get, brew install, ...), container: jobs and reusable workflows. A
git push from inside a script is pointed at a URL that does not exist. pip install goes into a virtualenv of the run and npm install -g
into a prefix of the run, so neither changes your machine.
Working with other tools
- task-traffic-controller: when it is installed,
every
run:step, setup included, is wrapped intask-traffic-controller exec, so heavy steps wait for CPU instead of piling up. Timeouts start when the step gets its turn. - portool: in a repository with a
.portool.toml, each exclusive job withoutservices:asks portool for a port block of its own worktree copy and gets.env.portool(TEST_PORT=...) in its environment, so a script that falls back to a fixed port (TEST_PORT ?? 4000) uses one no other worktree has. The workflow's ownenvstill wins. The block is given back when the copy is removed.--no-portoolturns this off.
Splitting a test job into shards (library)
local_ci::shard divides the tests of one job among shards that run side by
side; nothing is split unless the caller asks (FrozenPlan::with_shards), and
the CLI never does. A runner adapter lists the tests, names each shard's tests in
a command and reads what a shard reported: cargo test, Vitest and Jest (by
file or test name), Playwright (by file, or by test where the suite is fully parallel)
and Cypress (by spec file). The shards must cover the listed tests exactly once, each shard may report
only what it was given, a report that cannot be read or holds no test is a
problem, and a job that cannot be split safely stays one job with the reasons
(NotSplit).
A job is not split when:
- its own command has a name filter, tag, skip or an argument that is not known to
leave the tests alone, when a test path is part of another, or when its step is
not one plain command in the directory the tests were listed in (
continue-on-errorincluded); - it collects coverage (
--coverage,--cov,nyc,COVERAGE=1, a coverage setting in the Vitest or Jest configuration orpackage.json):execdoes not collect the shards' reports.shard::coverage::mergeis a library function that nothing here calls; the caller that collects the reports wires it. It puts together Istanbulcoverage-final.jsonand LCOV reports, only for the same code in every shard (Vitest'sv8provider maps each shard's files differently, so it stops atMismatch);cargo llvm-covprofile data and other formats are anUnsupportederror; - it starts something the shards would share: job
services, a container tool (docker,podman,kubectl), a server or a port (npm start,pnpm dev,next dev,localhost:3000, aPORTvariable, a command sent to the background), a database tool (psql,prisma migrate) or a service action. That is a list of words over what the workflow says. The main defence is the type of the end-to-end adapters: they take anIsolation, which isNoneuntil the caller declares (Isolation::Declared { evidence }) that each shard has its own database, port and browser profile; - (Playwright) the configuration has a
webServer, a global setup or teardown,repeatEachor ashard; a project depends on another or has a teardown (the listing script compares--list --project Pwith and without--no-deps, and reads the configuration file by text); or the runner is older than 1.56 (no--test-list). Unless the suite is fully parallel, the tests of a file are one unit, and so are those of a file that declares serial tests; read a shard's report withcollect_givenso that each unit is reported once; - (Cypress) the configuration says which files are specs (
specPatternand friends), or the command has--config-fileor--project: the adapter listscypress/e2e/**/*.cy.{js,jsx,ts,tsx}and does not evaluate the configuration. A shard runs Cypress through its module API in a small script, which prints one JSON line with a result per spec file and exits non-zero when a test failed.
Capturing a working directory (library)
source::capture_source fixes the input of a run as the working directory is
right now (staged and unstaged changes, untracked files, deletions, modes,
symlinks, submodules, LFS payloads) in a private store, and describes it in a
SourceManifest. The repository itself is only read.
- The first capture of a repository copies the history of
HEADinto a private bare repository under the store, so a rewrite orgit gcof the original cannot break an export later; the next captures fetch only what is new. - The manifest records the settings that turned the captured bytes into Git's
blobs (
core.autocrlf,core.eol,core.safecrlf, the attribute rules that are not in the tree, and thefilter.<name>.*definitions in use). When the repository a run happens in already reads the same values (a run in the original itself always does) nothing is written. A worker whose settings differ repeats them in its worktree only (extensions.worktreeConfigis the one switch written to its shared config, and only in a clone that was not captured from); if the original's own settings changed after the capture the run stops withSourceError::OriginalConfigChangedinstead of writing to it. Either waygit statusagrees with the commit. One known limit: Git readsinfo/attributesbefore.gitattributes, but a worker repeats those rules where Git reads them last, so when they disagree about a path the result isSourceError::WorkspaceNotClean, never silently different content. A worker without the program of a filter the capture ran getsSourceError::FilterMissingand can be left out; a workspace that Git still sees as changed isSourceError::WorkspaceNotClean. - Not supported yet: shallow clones (
git fetch --unshallowfirst) and repositories that use SHA-256 object names. Both are refused with an explicit error.
source::capture_directory does the same for a directory that is not a
repository.
Secret files
CaptureOptions::secret_files (the [source] secret_files globs of
.local-ci.toml) names files a run needs that must not travel with the
source, a test .env for instance. They never enter the object store, the
manifest's entries or an exported bundle of objects: the manifest records
their paths and an HMAC of each under secret_key (16 bytes or more), and
their content goes to a secret bundle of its own (mode 0600), whose path
SourceSnapshot::secrets returns. materialize_secrets places them in a
workspace after checking each against its HMAC.
- In a repository, a secret file is an untracked file a declaration matches,
ignored or not. A tracked file is commit content and stays that (with a
warning). In a directory capture, any file a declaration matches is a
secret file;
excludeis applied first. - Only a regular file inside the root is read. A symlink (the file, or a
directory above it), a FIFO or a device at a secret path stops the capture
with an error; it is neither followed nor skipped. A
requireddeclaration that matches nothing stops it too (SourceError::RequiredSecretMissing); an optional one is a warning. - A secret file is at most 1 MiB and those of one capture together at most
8 MiB; above either the capture stops with
SourceError::SecretTooLarge(the file is not skipped). secret_root: take the secret files from another working tree than the one that is captured. This is for the capture of a commit, which runs in a clean checkout that has none of them: point it at the tree the commit came from. The files are chosen, read and re-checked there by the same rules, and a file there that the captured commit tracks is left out as commit content. A file that tree tracks and the captured commit does not is in neither place (not content, not a secret file); a warning names it. Only forcapture_source.secret_bundle: write the bundle to this path instead of<store>/secrets/<source_id>.json, which two captures of the same source share. The file is created, never replaced, and its directory is not made: either case isSourceError::SecretBundlePath, and a capture that fails after writing it removes it. Nothing is written when no secret file was found. The directory has to be on a filesystem with hard links. A process killed during the write can leave a.secrets.tmp-*file (0600, the secret files in plain) next to the path: sweep those when you keep the directory.
Files
The cache directory is ~/Library/Caches/local-ci on macOS and
$XDG_CACHE_HOME/local-ci (or ~/.cache/local-ci) elsewhere; set
LOCAL_CI_HOME to move it. It holds the worktrees while they run
(wt/<sha>-<pid>, one wt/<sha>-u<n>-<pid> per unit and one wt/<sha>-c<n>-<pid> per matrix entry run at once), the last 20
runs of each repository (runs/<repo>/<time>-<sha>/ with one log per step and
result.json), the results that may be reused (results/<repo>/, a day at
most), and the locks.
Development
( && ) # the shard adapter tests run real Vitest and Jest
( && && ) # and real Playwright
( && && ) # and real Cypress (its test is ignored off Linux)
The pure decision modules (src/matrix.rs, src/filter.rs, src/source/gate.rs,
src/dag.rs, src/frozen.rs, src/artifact.rs, src/shard.rs, src/shard/adapters.rs,
src/shard/coverage.rs, src/shard/isolation.rs, src/demand.rs, src/result_wire.rs) are gated on 100% line coverage over the whole test suite (src/wire.rs and src/digest.rs are held to the mutation gate only: the line counts of their generic and per-crate code are not stable enough for a 100% line gate).
All of them but src/dag.rs are also gated on zero surviving mutants. The coverage gate needs cargo-llvm-cov and the llvm-tools-preview
component. If cargo llvm-cov cannot find the LLVM tools, point it at them:
Mutation testing uses cargo-schemata, which reruns the
tests once per mutant. Each module is checked against the test targets that pin it (the exact
commands are in .github/workflows/ci.yml):
The wire gate leaves out the mutant wire_version -> 1 (-E): the version is 1, so it changes nothing.
cargo schemata copies the sources into target/schemata/ and points TMPDIR there, which is
inside the repository. Tests that need "not a git repository" therefore set
GIT_CEILING_DIRECTORIES.
cargo schemata --file exits 0 when the glob matches nothing, so CI first runs
scripts/mutation-targets-check.sh <file>... (built on --list) and fails if any target file
produces no mutants, for example after a rename.
License
MIT