Skip to content

Test Harness Reference

This reference documents the relationship between CI jobs and local test commands, enabling developers to reproduce CI behavior locally.

The following table maps each CI job to its local equivalent command. All local commands can be run from the repository root.

CI JobPurposeLocal EquivalentPlatformRuntime
secrets-scanGitleaks secret scanningnix run nixpkgs#gitleaks -- detect --verbose --redactAll~30s
set-variablesPackage discoveryjust list-packages-jsonAll~5s
preview-release-versionSemantic-release previewjust preview-version main packages/<name>All~30s
preview-docs-deployPreview docs deploymentjust docs-deploy-previewAll~2-3min
bootstrap-verificationMakefile bootstrap testmake bootstrap && make verify && make setup-userAll~2-3min
secrets-workflowSOPS mechanics testManual encrypt/decrypt test (see below)All~30s
flake-validationFlake check + justfilejust checkAll~5-7min
cache-overlay-packagesPre-cache packagesjust cache-overlay-packages <system>x86_64/aarch64-linux~5-10min
nix (packages)Build overlay packagesjust ci-build-category <system> packagesAll~3-5min
nix (checks-devshells)Build checks and devShellsjust ci-build-category <system> checks-devshellsAll~3-5min
nix (home)Build homeConfigurationsjust ci-build-category <system> homex86_64/aarch64-linux~3-5min
nix (nixos)Build nixosConfigurationsjust ci-build-category <system> nixos <config>x86_64-linux~5-10min
typescriptPackage tests (unit/e2e)just test-package docsAll~2-3min
production-release-packagesSemantic-releasejust release-package <pkg> true (dry run)All~1min
production-docs-deployProduction docsjust docs-deploy-productionAll~2-3min
  • Fast (~30s): Secret scanning, package discovery
  • Medium (~2-5min): Individual builds, documentation
  • Slow (~5-10min): Full flake check, NixOS builds

The secrets-workflow job tests SOPS encryption/decryption with ephemeral keys. To test locally:

Terminal window
# Create temporary directory
mkdir -p /tmp/sops-test && cd /tmp/sops-test
# Generate ephemeral age key
nix develop --command age-keygen -o test-key.txt
TEST_PUBLIC=$(nix develop --command age-keygen -y test-key.txt)
# Create .sops.yaml
cat > .sops.yaml <<EOF
creation_rules:
- path_regex: .*\.yaml$
key_groups:
- age:
- $TEST_PUBLIC
EOF
# Create and encrypt test secret
echo "test_secret: test-value" > test.yaml
nix develop --command sops -e -i test.yaml
# Verify decryption works
SOPS_AGE_KEY_FILE=test-key.txt nix develop --command sops -d test.yaml
# Cleanup
cd - && rm -rf /tmp/sops-test

The following justfile recipes are exercised by CI jobs:

RecipeCI JobNotes
checkflake-validationRuns nix flake check including VM tests
ci-build-categorynix (matrix)Category-based builds for disk space optimization
cache-overlay-packagescache-overlay-packagesPre-cache expensive packages
list-packages-jsonset-variablesPackage discovery for matrix jobs
test-packagetypescriptPer-package test suite
preview-versionpreview-release-versionSemantic-release dry run
docs-test-*typescriptDocs unit and E2E tests
docs-deploy-previewpreview-docs-deployCloudflare preview deployment
docs-deploy-productionproduction-docs-deployCloudflare production deployment

The following recipes are not exercised by CI:

RecipeRationale
activate*Requires physical machine access
check-fastCI runs full checks; fast mode is for local iteration
build-machineCI uses ci-build-category for disk optimization
build-allToo slow; CI builds machines individually
test-quickCI runs full check, not subset
test-integrationSubset of full check
darwin-*Requires darwin hardware (no CI runners)
nixos-bootstrapDestructive disk operations
cache-darwin-systemRequires darwin hardware
scan-secretsCI uses gitleaks directly
sops-*Requires Bitwarden access

Platform limitations:

  • Darwin builds cannot run on Linux CI runners
  • Some recipes require physical hardware (activation, bootstrap)

Performance:

  • build-all would exhaust CI disk space
  • CI uses matrix builds (ci-build-category) for parallelism

Security:

  • sops-* requires Bitwarden CLI authentication
  • Activation recipes would modify CI runner state

Redundancy:

  • check-fast is a subset of check
  • scan-secrets duplicates CI’s gitleaks invocation

CI jobs use content-addressed caching to skip unchanged work.

Each job defines hash-sources patterns that determine when the job should re-run:

JobHash sources
bootstrap-verificationMakefile .envrc .github/actions/setup-nix/action.yml
secrets-workflow.sops.yaml modules/secrets/**/*.nix flake.nix flake.lock
flake-validationjustfile flake.nix flake.lock
cache-overlay-packagespkgs/by-name/**/* modules/nixpkgs/overlays/**/*.nix flake.nix flake.lock
nixflake.nix flake.lock pkgs/by-name/**/* modules/**/*.nix justfile

When these files are unchanged, the job checks for a cached successful result and skips execution.

Skip conditionAffected jobs
VM tests on Darwinvm-* checks automatically excluded via lib.optionalAttrs isLinux
Darwin builds on LinuxNo CI runners for darwin; darwin configs not built in CI
aarch64 nixos configsNot in CI matrix; built on aarch64-linux only

Force execution:

Terminal window
# Via workflow dispatch
gh workflow run ci.yaml --ref $(git branch --show-current) -f force_run=true
# Via PR label
# Add "force-ci" label to PR

Skip patterns:

  • *.md files in root are ignored by push/PR triggers
  • paths-ignore in CI workflow skips on documentation-only changes

Cache keys combine:

  • Job name (e.g., flake-validation)
  • Matrix values (e.g., x86_64-linux, packages)
  • Content hash of hash-sources files
  • Repository ref

Example: flake-validation-x86_64-linux-a1b2c3d4-refs/heads/main

The nix job uses a matrix to distribute builds across runners and avoid disk space exhaustion.

CategoryConfigDescriptionRunner
packages-Overlay packagesubuntu-latest
checks-devshells-Checks and dev shellsubuntu-latest
home-homeConfigurationsubuntu-latest
nixoscinnabarZerotier controller VPSubuntu-latest
nixoselectrumZerotier peer VPSubuntu-latest
CategoryDescriptionRunner
packagesOverlay packagesubuntu-24.04-arm
checks-devshellsChecks and dev shellsubuntu-24.04-arm
homehomeConfigurationsubuntu-24.04-arm
ConfigurationReason
darwinConfigurationsNo darwin CI runners available
nixosConfigurations (galena, scheelite)GCP VMs toggled off by default
Terminal window
# Full reproduction
just check
# Fast mode (skip VM tests)
just check-fast x86_64-linux
# Specific check
nix build .#checks.x86_64-linux.nix-unit --print-build-logs
Terminal window
# Specific category
just ci-build-category x86_64-linux packages
# Specific nixos config
just ci-build-category x86_64-linux nixos cinnabar
# With verbose output
nix build .#nixosConfigurations.cinnabar.config.system.build.toplevel --print-build-logs
Terminal window
# Full package test
just test-package docs
# Individual test types
just docs-test-unit
just docs-test-e2e
just docs-test-coverage
Terminal window
# View latest run status
just ci-status
# View logs
just ci-logs
just ci-logs-failed
# Debug specific job
just ci-debug-job ci.yaml "nix (x86_64-linux, packages)"
# Force rerun
gh workflow run ci.yaml --ref $(git branch --show-current) -f force_run=true