CI
ngit-ci runs Nix workflows for your repositories and publishes signed results that you can view in ngit and GitWorkshop. To get started, set up a coordinator and a compute provider, or use a coordinator that already serves your repository.
The coordinator watches for pushes, pull requests and other workflow triggers, selects providers for jobs, and publishes the overall result. A compute provider supplies the resources and isolated environment that execute each job. You can run both roles on one machine, or use a coordinator with providers on separate Linux and Apple Silicon macOS machines.
You can also arrange to use someone else's coordinator or contribute a provider to a project you support. These arrangements require explicit operator configuration today. Later releases aim to make sharing compute easier; see Provide compute for other projects.
Understanding Grasp CI explains the protocol, roles and trust model in more detail. Why we moved from act to Nix explains the execution model and its trade-offs.
1. Set up your coordinator and provider
If you’re upgrading an existing installation, ngit-ci 0.3 runs Nix workflows only. Migrate any act workflows while still on 0.2.x and remove the obsolete runner settings before upgrading. See the migration guide.
Follow Run ngit-ci to choose a deployment and configure your coordinator, provider and repositories. The coordinator must approve the provider, and the provider must allow that coordinator to assign work. Configure a resource pool that leaves room for the host and any other services.
If another operator has already agreed to provide CI for your repository, you can use their coordinator instead. Once your own or their coordinator is configured, check that it advertises service for your repository.
Open your repository's coordinator directory on GitWorkshop:
text
https://gitworkshop.dev/<OWNER>/<REPO>/actions/coordinators<OWNER> is the maintainer's npub1... or NIP-05 address. The page lists only the coordinators that have advertised themselves as available for this specific repository, not every coordinator on the network:
| Badge | Meaning |
|---|---|
| Watching | It is acting for this repository now |
| Ready for this repo | It will start once a maintainer requests service |
| Offline | Its advertisement has expired; past runs are still shown |
If the directory is empty, check that your coordinator is running and configured to serve this repository. If you are using another operator's service, ask them to add it. There is no automatic hosted-CI signup or payment flow in this release.
2. Request service
A request is a standing instruction to one coordinator for one repository. It covers runs the coordinator starts after it and stays in force until you stop it.
On GitWorkshop, a confirmed maintainer presses Request coordinator service on the coordinator's page. From the CLI:
bash
ngit ci request <COORDINATOR> # npub or hex
ngit ci stop <COORDINATOR>Request as a confirmed maintainer of the repository, including when you run the coordinator yourself. This establishes that its results were requested by a maintainer; hosting the service alone does not establish that trust.
Confirmation arrives as a signed Repository Status from the coordinator. On GitWorkshop the badge changes to Watching and the coordinator page lists the workflow paths it will execute and the secret names it holds.
3. Add a workflow
Commit a root flake.nix and flake.lock defining the package you want to build, then add .grasp/nix/workflows/ci.yaml:
yaml
version: 1
name: Native build
system: x86_64-linux
on:
push:
branches: [main]
pull_request:
jobs:
build:
build: packages.x86_64-linux.defaultCheck the package locally with nix build .#packages.x86_64-linux.default. Keep workflow-only Nix definitions and helpers under .grasp/nix/, imported through the root flake. Shared product packages and Nix modules stay in their usual locations; see repository layout. For commands, multiple steps, artifacts and public outputs, follow the Nix workflow guide. A PR preview can expose its URL as an output named nsite or beginning with nsite_; use a disposable publishing identity rather than a maintainer key for untrusted PRs.
The preferred directory is .grasp/nix/workflows/. Existing .ngit/nix/ workflows remain supported; if both trees exist, .grasp wins as a whole, without mixing files from the two. Files under .github/ or .gitlab/ are not discovered by ngit-ci.
Size jobs and set their timeouts
The built-in coordinator baseline is four vCPUs and 8 GiB RAM, with no scratch minimum. Operators can configure a different baseline. Requirements are inherited per dimension: reducing RAM alone does not reduce the CPU minimum. To allow a smaller job, explicitly lower all relevant requirements:
yaml
jobs:
small-check:
build: checks.x86_64-linux.small
timeout: 10m
requirements:
resources:
vcpus: {gte: 1}
memory-mib: {gte: 2048}
scratch-mib: {gte: 4096}A larger job can override only the dimensions it needs, such as vcpus: {gte: 8}; its other requirements remain inherited. These are minimum resources, not a provider's offering name or a promise of an exact allocation. A job waits if no approved provider can satisfy them.
The default execution timeout is two hours, with an operator-configurable six-hour ceiling. Set timeout: 3h on a long build, or timeout: 10m on a short check. Requests over the ceiling are rejected rather than silently capped. The deadline includes provider preparation, so a very short timeout can expire before the command starts. A shorter timeout does not currently give queue priority. See job execution timeout for the exact boundary.
Push, and the run appears against that commit.
4. Read the results
On GitWorkshop, status icons sit beside commits, branches, tags, and PRs. The Actions tab lists every run for the repository, and the Checks panel on a commit or PR expands each run into its jobs, timings, coordinator, log tail, a link to the full log for each job, artifacts, and public outputs. Every run carries a trust label and the evidence behind it.
From the CLI:
bash
ngit ci status <COMMIT-ISH>
ngit ci status <COMMIT-ISH> --offline # cache only, after the first query
ngit ci inspect --target <COMMIT-ISH> --offline --logsThe target can be a commit-ish, a PR (#<prefix>, an nevent, or a full event id), or nothing for HEAD. Query the commit that introduced the change, not just the branch tip. A PR reports only the runs for its latest revision.
The response includes, for every run against the target:
- its state and conclusion
- the workflow path that produced it
- its trust level and the evidence behind it, such as which maintainer requested the coordinator
- an integrity check: whether the commit is present locally and the workflow file at that commit hashes to what the coordinator signed
- each job with its conclusion, the compute provider that executed it, a link to its full log, and a log tail for failed jobs
Use ngit ci inspect --target <COMMIT-ISH> for job details and failed-job log tails. Add --logs to include successful-job tails, or --no-logs to retain log links without embedded tails. Add --offline after refreshing the target when cached evidence is sufficient.
For automation, add --json to get the same information as one document. Each run's trust level is ci.runs[].classification, and maintainer-directed means a maintainer asked for it.
Two different successes
command_status: ok means ngit answered the question. Whether CI passed is ci.conclusion, and only once ci.state is concluded. Partial coverage is not evidence of success either.
When no run appears
Report it as "no matching CI event found" rather than as a pass. Then check, in order:
- Is a coordinator Watching the repository, and does it support the workflow's system and resource requirements through an approved provider?
- Did the workflow exist at that commit, and did its trigger match the event?
- Did the query refresh the repository relays, or was it
--offlineagainst a cold cache?
Only after all three should you conclude that CI genuinely did not run. Inspect any startup failure or queued state for its reported reason before changing the workflow.
5. Gate a merge on CI
To make a command exit non-zero unless CI is green and meets a trust floor:
bash
ngit ci status <COMMIT-ISH> \
--json \
--require-ci-trust maintainer-directed| Level | Meaning |
|---|---|
maintainer-directed | The result traces back to a maintainer's request for this coordinator or this run |
operationally-associated | A weaker link to infrastructure the repository lists or to a recognised coordinator |
The gate passes only if the result is a success and its weakest run meets the floor. It works on a merge, which is where it matters most:
bash
ngit pr merge <ID> --require-ci-trust maintainer-directed
git push origin <TARGET-BRANCH>ngit pr merge selects the PR's declared target, or the repository default, and creates the local no-ff merge commit there.
Without the flag, a failing, unfinished, or absent result will not block the merge, and neither will a signer with no known trust context. A successful push does not enforce CI by itself.
6. Run a workflow manually
A Manual Trigger asks a coordinator to run one workflow once, for one commit. It needs no standing request, and it replays a push or pull_request workflow even though the file declares no manual trigger, which is how you retry after a coordinator was offline.
bash
ngit ci trigger <COORDINATOR> --workflow .grasp/nix/workflows/ci.yaml
ngit ci trigger <COORDINATOR> <COMMIT-ISH> --workflow .grasp/nix/workflows/ci.yaml
ngit ci trigger <COORDINATOR> --workflow .grasp/nix/workflows/ci.yaml --ref refs/heads/mainThe workflow is identified by the SHA-256 of the file at the resolved commit, never your working tree, whose line endings or filters may hash differently from what the coordinator sees. --ref supplies the Git ref a workflow can read as context.
On GitWorkshop, a maintainer presses Retry workflow on any completed run, which publishes the same event for that run's commit and workflow.
7. Configure secrets
Native jobs explicitly declare secret names with secrets: [DEPLOY_TOKEN] and read their files from $NGIT_CI_SECRETS_DIR, for example $NGIT_CI_SECRETS_DIR/DEPLOY_TOKEN. A coordinator supplies secrets only for an authorized maintainer-authored trigger and an approved recipient provider. Third-party PRs cannot grant themselves access by changing the workflow. How secrets stay with maintainers explains the trust model; the Nix workflow guide describes the file interface.
Maintainers register secrets on GitWorkshop from Manage secrets on the coordinator's page. Each value is encrypted to the coordinator and sent over Nostr. For an authorized native job, only its declared values are delivered to the approved provider through the encrypted job-secret transport. For easy management, the coordinator publishes the names in use, with who added each and when, and GitWorkshop shows them as "Secrets in use".
Optionally, a maintainer can ask the coordinator to store their repository's values at rest only encrypted to a remote signer they supply, and to decrypt them on demand through that signer for each run. GitWorkshop marks those "Bunker-sealed". If the signer is unreachable, an authorised run fails with startup_failure rather than running without its secrets. All of this is managed from GitWorkshop; there is no ngit ci command for secrets in this release.
An operator can also set values directly in the coordinator's environment or as systemd credentials; see coordinator secret sources. An operator value shadows a maintainer value of the same name.
Provide compute for other projects
A volunteer can run jobs for a project using a spare machine. The repository maintainer chooses a coordinator. To add a machine to that coordinator, the two operators exchange public keys:
- The volunteer adds the coordinator’s public key to the provider’s
--allowed-coordinatorlist and chooses how much CPU, memory and disk to offer. See set up a native provider and choose an isolation backend. - The coordinator operator adds the provider’s public key to
--providersfor jobs without declared secrets. Permission to run jobs with secrets requires a separate decision. See coordinator provider permissions.
With both approvals in place, the coordinator can send the next compatible job to that machine when it has capacity.
The community compute experiment asks how much everyday CI free software projects can run on machines their communities offer. Who runs your tests? follows one pull request through this arrangement. Pick a flower in Grasp CI Meadow to see which coordinator assigned the job and who signed its result.
Today the operators make these arrangements directly. The roadmap describes proposals for wider sharing through a web of trust and for paid capacity.