pcpm ci
Strict, fail-fast install for CI.
pcpm ci [options]
pcpm ci is the strict variant of pcpm install, designed for
continuous integration. It is identical to pcpm install in
what it does, but more strict in what it accepts.
What it does
- Reads
pcpm.lockdirectly, without re-resolving the graph. - Verifies that every package in the lockfile is present in the store (or downloadable).
- Materialises the lockfile into the store and
~/.nuget/packages. - Runs
dotnet restore. - Does not write to
pcpm.lock. If the lockfile is stale (i.e.Directory.Packages.propsandpcpm.lockdisagree),pcpm ciexits with a non-zero status.
Why it exists
The bug it catches is silent on developer machines but loud on
CI: someone bumps a version in Directory.Packages.props and
forgets to commit the updated pcpm.lock. On a developer
machine, pcpm install re-resolves and the new version slips
in. On CI, pcpm ci fails and the build is red.
Options
Same as pcpm install, plus:
| Flag | Effect |
|---|---|
--strict-hash | Re-hash every package in the store. Slower, but catches corruption. |
Example
# GitHub Actions
- name: Restore
run: pcpm ci
- name: Build
run: dotnet build --no-restore -c Release
Exit codes
In addition to the codes documented for
pcpm install, pcpm ci exits with:
4ifpcpm.lockis stale (i.e. CPM and the lockfile disagree).4ifpcpm.lockis missing entirely.4if--strict-hashis set and a store entry’s bytes don’t match its recorded hash.
See also
- CI integration — full CI guide.
pcpm install— the developer-facing command.