Skip to content
Merged
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
23 changes: 18 additions & 5 deletions .github/workflows/sovereign-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Change once here → applies to all 38 repos instantly.
#
# Self-hosted jobs run inside the sovereign-ci container (built by forjar).
# Each job gets an isolated filesystem — no shared ~/.rustup/, no race conditions.

Check warning on line 7 in .github/workflows/sovereign-ci.yml

View workflow job for this annotation

GitHub Actions / validate

7:81 [line-length] line too long (82 > 80 characters)
# Image: localhost:5000/sovereign-ci:stable (local registry on mac-server)
# Rebuild: cd infra && make -f machines/intel/Makefile ci-image
#
Expand Down Expand Up @@ -48,7 +48,7 @@
default: false
type: boolean
extra_pkgs:
description: 'Extra apt packages to install in container (e.g. python3-dev libclang-dev)'

Check warning on line 51 in .github/workflows/sovereign-ci.yml

View workflow job for this annotation

GitHub Actions / validate

51:81 [line-length] line too long (97 > 80 characters)
required: false
default: ''
type: string
Expand All @@ -62,6 +62,11 @@
required: false
default: false
type: boolean
test_workspace:
description: 'PMAT-159: test all workspace members with `--workspace --lib` (not just root). Opt-in because workspace members may not build in the sovereign-ci container (e.g. aprender-gpu needs cuBLAS). Pair with test_args exclusions as needed.'
required: false
default: false
type: boolean

# HD-02: Least-privilege token — only escalate where needed
permissions:
Expand All @@ -78,7 +83,7 @@
jobs:
test:
name: test
runs-on: [self-hosted, clean-room]

Check failure on line 86 in .github/workflows/sovereign-ci.yml

View workflow job for this annotation

GitHub Actions / validate

label "clean-room" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2025-vs2026", "windows-2022", "windows-11-arm", "ubuntu-slim", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xlarge", "macos-latest-large", "macos-26-intel", "macos-26-xlarge", "macos-26-large", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xlarge", "macos-14-large", "macos-14", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
container:
image: localhost:5000/sovereign-ci:stable@sha256:10486da5daa3786f3264aa0e19fdde007e7ba1eca1d47ba587947946e42bd871
# Phase 3 §5.3 — sccache rustc cache + /var/log/ci-metrics for F9 stats.
Expand All @@ -94,7 +99,7 @@
persist-credentials: false
- name: Install extra packages
if: ${{ inputs.extra_pkgs != '' }}
run: |

Check failure on line 102 in .github/workflows/sovereign-ci.yml

View workflow job for this annotation

GitHub Actions / validate

shellcheck reported issue in this script: SC2015:info:2:25: Note that A && B || C is not if-then-else. C may run when A is true
apt-get update -qq && apt-get install -y -qq ${{ inputs.extra_pkgs }} 2>/dev/null || \
sudo apt-get update -qq && sudo apt-get install -y -qq ${{ inputs.extra_pkgs }} 2>/dev/null || true
- name: Checkout sibling repos (path deps)
Expand Down Expand Up @@ -142,7 +147,7 @@
# Note: generated contract macros may have unused variables (provable-contracts#64).
# This is handled by adding -A unused-variables to the clippy step.
- name: Generate contract assertions (pv codegen)
run: |

Check failure on line 150 in .github/workflows/sovereign-ci.yml

View workflow job for this annotation

GitHub Actions / validate

shellcheck reported issue in this script: SC2012:info:9:3: Use find instead of ls to better handle non-alphanumeric filenames
# pv is baked into sovereign-ci:stable at /usr/local/cargo/bin/pv
PV=""
for candidate in /usr/local/cargo/bin/pv /usr/local/bin/pv; do
Expand Down Expand Up @@ -192,20 +197,24 @@
RUSTC_WRAPPER: ${{ inputs.enable_sccache && 'rustc-sccache' || '' }}
SCCACHE_DIR: ${{ inputs.enable_sccache && '/sccache' || '' }}
USE_NEXTEST: ${{ inputs.use_nextest }}
TEST_SCOPE: ${{ inputs.test_workspace && '--workspace --lib' || '--lib' }}
run: |

Check failure on line 201 in .github/workflows/sovereign-ci.yml

View workflow job for this annotation

GitHub Actions / validate

shellcheck reported issue in this script: SC2086:info:17:36: Double quote to prevent globbing and word splitting

Check failure on line 201 in .github/workflows/sovereign-ci.yml

View workflow job for this annotation

GitHub Actions / validate

shellcheck reported issue in this script: SC2086:info:16:26: Double quote to prevent globbing and word splitting

Check failure on line 201 in .github/workflows/sovereign-ci.yml

View workflow job for this annotation

GitHub Actions / validate

shellcheck reported issue in this script: SC2086:info:16:14: Double quote to prevent globbing and word splitting

Check failure on line 201 in .github/workflows/sovereign-ci.yml

View workflow job for this annotation

GitHub Actions / validate

shellcheck reported issue in this script: SC2086:info:13:38: Double quote to prevent globbing and word splitting

Check failure on line 201 in .github/workflows/sovereign-ci.yml

View workflow job for this annotation

GitHub Actions / validate

shellcheck reported issue in this script: SC2086:info:12:28: Double quote to prevent globbing and word splitting

Check failure on line 201 in .github/workflows/sovereign-ci.yml

View workflow job for this annotation

GitHub Actions / validate

shellcheck reported issue in this script: SC2086:info:12:16: Double quote to prevent globbing and word splitting

Check failure on line 201 in .github/workflows/sovereign-ci.yml

View workflow job for this annotation

GitHub Actions / validate

shellcheck reported issue in this script: SC2086:info:10:43: Double quote to prevent globbing and word splitting
# Mark workspace as safe for git operations inside tests (dubious ownership in containers)
git config --global --add safe.directory "$GITHUB_WORKSPACE"
# Phase 2 §4.3 — nextest drops ~35% off test-job wall-clock on large suites.
# Fallback to cargo test if nextest fails for any reason (e.g. test harness quirks).
# PMAT-159 (2026-04-20): `test_workspace: true` opts into `--workspace --lib` so
# workspace-member lib tests are exercised. Default stays `--lib` (root only) for
# back-compat: many repos have workspace members that don't build in the sovereign-ci
# container. Opt-in callers pair this with `test_args` exclusions as needed.
if [ "$USE_NEXTEST" = "true" ]; then
cargo nextest run --lib $TEST_ARGS 2>&1 || \
cargo nextest run $TEST_SCOPE $TEST_ARGS 2>&1 || \
cargo nextest run --lib -p "$REPO_NAME" $TEST_ARGS 2>&1 || \
{ echo "::warning::nextest failed — falling back to cargo test"; \
cargo test --lib $TEST_ARGS 2>&1 || \
cargo test $TEST_SCOPE $TEST_ARGS 2>&1 || \
cargo test --lib -p "$REPO_NAME" $TEST_ARGS 2>&1 || \
{ echo "::error::Tests failed — check workspace path dependencies"; exit 1; }; }
else
cargo test --lib $TEST_ARGS 2>&1 || \
cargo test $TEST_SCOPE $TEST_ARGS 2>&1 || \
cargo test --lib -p "$REPO_NAME" $TEST_ARGS 2>&1 || \
{ echo "::error::Tests failed — check workspace path dependencies"; exit 1; }
fi
Expand Down Expand Up @@ -473,10 +482,14 @@
REPO_NAME: ${{ inputs.repo }}
RUSTC_WRAPPER: ${{ inputs.enable_sccache && 'rustc-sccache' || '' }}
SCCACHE_DIR: ${{ inputs.enable_sccache && '/sccache' || '' }}
TEST_SCOPE: ${{ inputs.test_workspace && '--workspace --lib' || '--lib' }}
run: |
# Mark workspace as safe for git operations inside tests (dubious ownership in containers)
git config --global --add safe.directory "$GITHUB_WORKSPACE"
cargo llvm-cov test --lib --no-cfg-coverage --no-cfg-coverage-nightly --lcov --output-path lcov.info $TEST_ARGS 2>&1 || \
# PMAT-159 (2026-04-20): `test_workspace: true` opts into `--workspace --lib` so
# coverage reflects all workspace members. Default stays `--lib` (root only) — see
# test job comment for back-compat rationale.
cargo llvm-cov test $TEST_SCOPE --no-cfg-coverage --no-cfg-coverage-nightly --lcov --output-path lcov.info $TEST_ARGS 2>&1 || \
cargo llvm-cov test --lib --no-cfg-coverage --no-cfg-coverage-nightly -p "$REPO_NAME" --lcov --output-path lcov.info 2>&1 || \
{ echo "::error::Coverage failed — check workspace path dependencies"; exit 1; }
- name: Record sccache stats
Expand Down
Loading