Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ci-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ main-breakage rate (issues labelled `main-broken`) proves out.
| nix ci | — (PR proxy check is in the dedicated workflow below) | proxy port fallbacks + full flake-check (formatting auto-fixed on main by the auto-format workflow) | schedule in nix-ci.yml |
| proxy-port-fallbacks | `basic: proxy port fallbacks` on `pull_request` | — (main copy remains in nix-ci.yml) | — |
| workflow-lint | `basic: workflow lint` on `pull_request` (paths `.github/workflows/**`, `.github/actions/**`) | — | — |
| id | guard + affected-crate matrix (`id-pr-checks.txt`) | + full `nix flake check ./pkgs/id` job | schedule in id-check.yml + id-e2e-nightly.yml (full flake check) |
| id | guard only (contract tests; matrix + full tiers are main-only) | push: guard + matrix + aggregator; schedule/manual: guard + full flake check | schedule in id-check.yml + id-e2e-nightly.yml (full flake check) |
| mcpx conformance | spec-parity leg only (measured 28s exec, run 40801660942, 2026-10-29 — under the 5m fast-leg limit) | all conformance legs + records + spec-parity | — (main covers it) |
| id bench | — (removed) | yes | — |
| go modules build / identity build / map build / mcpx nix build | class-3 paths only (see each workflow) | always (push to main, no path filter) | — |
Expand Down
61 changes: 31 additions & 30 deletions .github/workflows/id-check.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# CI for pkgs/id — P2P file sharing CLI
#
# Runs on push to main and PRs that touch pkgs/id/ files.
# Uses nix flake checks to run all sandboxed CI checks:
# Pushes to main run the affected-check matrix below. Scheduled and manual
# runs execute the full pkgs/id flake check instead; the guard runs on every
# event.
# The full nix flake check covers all sandboxed CI checks:
# - Rust: fmt, clippy, cargo-check, unit tests, integration tests, doc
# - Web: biome fmt, biome lint, bun unit tests, TypeScript typecheck
# - Build: debug + release (web variant with embedded assets)
Expand Down Expand Up @@ -64,19 +66,18 @@ permissions:
# Push-to-main runs each get their own group (keyed by run_id), so a
# later merge can never cancel — or displace a pending — verification
# run for an earlier merge: every merged tree gets its own completed
# run. Pull-request runs keep sharing a per-ref group, so a new push
# to a PR still supersedes its stale run (#392). A conditional
# cancel-in-progress (the mcpx-conformance pattern) would still let a
# third rapid merge displace the second merge's pending run, so push
# runs are keyed by run_id here, matching dezren39/nix PR #495.
# run. Non-push runs share a per-ref group, so a newer run on that ref
# supersedes the older one. Push runs are keyed by run_id here, matching
# dezren39/nix PR #495.
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_id || github.ref }}
cancel-in-progress: true

jobs:
# Runs the flake-drift guard once and emits the PR check list as a
# JSON array for the matrix. The list file stays the single source of
# truth: adding a check to id-pr-checks.txt adds a parallel job.
# Runs the flake-drift guard once for every event and emits the basic
# check list as a JSON array for push runs. The list file stays the
# single source of truth: adding a check to id-pr-checks.txt adds a
# parallel job.
guard:
name: "basic: guard PR check list"
runs-on: ubuntu-latest
Expand All @@ -91,35 +92,35 @@ jobs:
extra-conf: |
accept-flake-config = true

# The PR list is enumerated, so guard it against the flake (#300):
# The basic check list is enumerated, so guard it against the flake (#300):
# a new flake check that is neither listed nor excluded fails here
# by name instead of silently getting no PR coverage.
# by name instead of silently getting no matrix coverage.
# The guard's own contract tests (#6881) run first (#7628):
# its misdiagnosis pins (duplicates, whitespace/CRLF) were
# verified nowhere — no workflow ran the .test.sh suite.
- name: Contract tests for the PR check list guard
run: bash .github/scripts/check-id-pr-checks.test.sh

- name: Guard PR check list against flake drift
- name: Guard basic check list against flake drift
run: .github/scripts/check-id-pr-checks.sh

# The crash-gate composition asserted in check-id-pr-checks.sh is
# itself checked (#1635): an #[ignore]d crash test matching none
# of the PR split filters fails here by name.
- name: Guard crash-gate PR partition coverage
- name: Guard crash-gate matrix coverage
run: .github/scripts/check-crash-gate-coverage.sh

- name: Test the crash-gate coverage guard enumeration
run: .github/scripts/check-crash-gate-coverage.test.sh

- name: Emit PR check list for the matrix
- name: Emit basic check list for the matrix
id: list
run: |
checks=$(grep -v -e '^[[:space:]]*#' -e '^[[:space:]]*$' .github/scripts/id-pr-checks.txt | jq -R . | jq -cs .)
echo "checks=$checks" >> "$GITHUB_OUTPUT"
echo "PR checks: $checks"
echo "Basic checks: $checks"

# One parallel job per PR check. Fast PR set: unit + integration
# One parallel job per basic check. Fast set: unit + integration
# tests, lint, format, typecheck, doc and the crash gates, listed in
# id-pr-checks.txt. The heavy remainder — test-e2e (Playwright),
# nixos-serve, nixos-e2e, nixos-integration and nixos-playwright-e2e —
Expand All @@ -131,6 +132,7 @@ jobs:
check_each:
name: "basic: nix flake check (${{ matrix.check }})"
needs: guard
if: github.event_name == 'push'
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
Expand All @@ -152,7 +154,7 @@ jobs:
extra-conf: |
accept-flake-config = true

# Cache the nix store on GitHub's cache so PRs do not rebuild
# Cache the nix store on GitHub's cache so main runs do not rebuild
# unchanged derivations from a cold store every run (#288).
- uses: DeterminateSystems/magic-nix-cache-action@84c0677f58dcedf3b91f8223ce36a9ea5b3c84b7 # v15
continue-on-error: true
Expand Down Expand Up @@ -183,14 +185,15 @@ jobs:
fi
.github/scripts/check-id-source-snapshot.sh verify "$GITHUB_WORKSPACE" "$RUNNER_TEMP/id-source-manifest.txt" "$src"

- name: Run PR check
- name: Run basic check
run: nix build -L --no-link "./pkgs/id#checks.x86_64-linux.${{ matrix.check }}"

# Replay the same checked-in WASM session natively on ARM64. This is a
# focused test, not a cross-compiled build: the fixture's per-event snapshot
# digests must match the x86_64-pinned values above.
world-snapshot-arm64:
name: "native arm64: world snapshot determinism"
if: github.event_name == 'push'
runs-on: ubuntu-24.04-arm
timeout-minutes: 30
env:
Expand Down Expand Up @@ -237,11 +240,11 @@ jobs:
check:
name: nix flake check
needs: [check_each, world-snapshot-arm64, no-world]
if: always()
if: always() && github.event_name == 'push'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require every PR check job to succeed
- name: Require every basic-tier job to succeed
run: |
matrix_result="${{ needs.check_each.result }}"
arm64_result="${{ needs.world-snapshot-arm64.result }}"
Expand All @@ -250,20 +253,18 @@ jobs:
echo "native arm64 snapshot result: $arm64_result"
echo "no-world result: $no_world_result"
if [ "$matrix_result" != "success" ] || [ "$arm64_result" != "success" ] || [ "$no_world_result" != "success" ]; then
echo "::error::the x86_64 PR checks, native arm64 determinism check, or no-world build did not succeed — see the jobs above."
echo "::error::the x86_64 basic checks, native arm64 determinism check, or no-world build did not succeed — see the jobs above."
exit 1
fi

# Main tier (Phase 2, #1781): the FULL flake check for pkgs/id. The PR
# tier above keeps guard + the affected-crate matrix from
# id-pr-checks.txt; the full check (including the heavy checks the PR
# list excludes) runs once per merge on main, plus the nightly
# schedule above -- and nightly in id-e2e-nightly.yml as a second
# backstop. Nothing from the old PR matrix is lost: the union of this
# job, id-e2e-nightly, and the PR matrix covers it.
# Full tier (Phase 2, #1781): run the complete pkgs/id flake check on
# schedule and manual dispatch. Pushes use the guard plus the affected-
# check matrix from id-pr-checks.txt instead. The full check includes
# the heavy checks excluded from that matrix; id-e2e-nightly.yml remains
# an independent nightly backstop.
full-flake-check:
name: "full (main tier): nix flake check"
if: github.event_name != 'pull_request'
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
Expand Down
Loading