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
54 changes: 9 additions & 45 deletions .github/workflows/_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# - lane `ci-rust` bakes Rust 1.94.1 (= rust-toolchain.toml), rustfmt, clippy,
# cargo-deny 0.19.9 and typos 1.49; RUSTUP_HOME is READ-ONLY to the runner user,
# so this workflow never installs a toolchain (a toolchain action would fail).
# - pods are ephemeral with no volumes: the only cross-job caches are the
# Actions cache (rust-cache) and, when configured, sccache on Cloudflare R2.
# - pods are ephemeral with no volumes: cross-job Rust compilation caching uses
# kache backed by GitHub Actions cache.
# - pod CPU throttling enforces JOBS=2 (aligned with host and open source CI).
name: rust (reusable)

Expand Down Expand Up @@ -36,16 +36,6 @@ jobs:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "0"
CARGO_NET_RETRY: "10"
# sccache on R2: same secret names as cerebral-work/reverie ci.yml.
# Empty until the bucket and secrets exist; the sccache steps are then
# skipped (not fail-soft). Secrets cannot appear in `if:`, so they are
# surfaced through env and tested there.
SCCACHE_BUCKET: ${{ secrets.SCCACHE_R2_BUCKET }}
SCCACHE_ENDPOINT: ${{ secrets.SCCACHE_R2_ENDPOINT }}
SCCACHE_REGION: auto
SCCACHE_S3_USE_SSL: "true"
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

Expand All @@ -57,24 +47,14 @@ jobs:
cargo fmt --version
cargo clippy --version

- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
- name: Rust build cache (kache)
uses: kunobi-ninja/kache-action@ad7317540dcdd71c904f7a60a87b620a0c0e67ed # v2.0.0
with:
shared-key: rust
# Only the integration and release branches write the cache; PRs read it.
save-if: ${{ github.ref == 'refs/heads/development' || github.ref == 'refs/heads/main' }}
cache-on-failure: true

- name: sccache (R2)
if: env.SCCACHE_BUCKET != ''
uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11

- name: sccache start (hard)
if: env.SCCACHE_BUCKET != ''
run: |
set -euo pipefail
# A dead backend must fail the job, not silently disable the cache.
sccache --start-server
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
version: "2.0.0"
cache-executables: "false"
github-cache: "true"
manifest-key: rust-cargo
save-cache: ${{ github.ref == 'refs/heads/main' }}

- uses: taiki-e/install-action@ab6895351a88b908e96a4697860d4ffea5e57dbe # v2.87.27
with:
Expand All @@ -91,19 +71,3 @@ jobs:
path: target/nextest/${{ inputs.nextest-profile }}/junit.xml
if-no-files-found: ignore
retention-days: 14

- name: sccache stats (hard)
if: always() && env.SCCACHE_BUCKET != ''
run: |
set -euo pipefail
sccache --show-stats | tee sccache-stats.txt
errors=$(awk '/^Cache errors/ {print $NF; exit}' sccache-stats.txt)
location=$(awk -F' +' '/^Cache location/ {print $2; exit}' sccache-stats.txt)
{
echo "### sccache"
echo ""
echo "- location: ${location:-unknown}"
echo "- cache errors: ${errors:-unknown}"
} >> "$GITHUB_STEP_SUMMARY"
case "$location" in *s3*|*S3*) ;; *) echo "::error::sccache is not using the R2 backend (location: ${location:-none})"; exit 1 ;; esac
if [ "${errors:-1}" != "0" ]; then echo "::error::sccache reported ${errors} cache errors"; exit 1; fi
27 changes: 24 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Rust build cache (kache)
uses: kunobi-ninja/kache-action@ad7317540dcdd71c904f7a60a87b620a0c0e67ed # v2.0.0
with:
version: "2.0.0"
cache-executables: "false"
github-cache: "true"
manifest-key: ci-lint
save-cache: ${{ github.ref == 'refs/heads/main' }}
- name: cargo fmt check
run: cargo fmt --all -- --check
- name: cargo clippy
Expand All @@ -42,7 +49,14 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Rust build cache (kache)
uses: kunobi-ninja/kache-action@ad7317540dcdd71c904f7a60a87b620a0c0e67ed # v2.0.0
with:
version: "2.0.0"
cache-executables: "false"
github-cache: "true"
manifest-key: ci-test
save-cache: ${{ github.ref == 'refs/heads/main' }}
- name: cargo test
run: cargo test --workspace -j 2
- name: cargo test doc
Expand Down Expand Up @@ -71,6 +85,13 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Rust build cache (kache)
uses: kunobi-ninja/kache-action@ad7317540dcdd71c904f7a60a87b620a0c0e67ed # v2.0.0
with:
version: "2.0.0"
cache-executables: "false"
github-cache: "true"
manifest-key: ci-specs
save-cache: ${{ github.ref == 'refs/heads/main' }}
- name: run spec-check
run: cargo run -p xtask -j 2 -- spec-check
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed
- Migrate Rust CI build caching in `.github/workflows/ci.yml` and `.github/workflows/_rust.yml` from `Swatinem/rust-cache` and `sccache` to `kunobi-ninja/kache-action`.

### Added
- Signals framework, process supervision, and terminal hygiene (`unsigned-gg/kd`): Linux `pidfd` lifecycle management (`pidfd_open`, `pidfd_send_signal`), `PR_SET_CHILD_SUBREAPER` zombie adoption and reaping, negative PGID broadcast signaling, declarative 2-phase graceful shutdown state machine (Drain → Escalate → ForceKill), and RAII `TerminalGuard`. Dual-licensed Apache-2.0 OR MIT.
- Port the cas-substrate release follow-ups (CER-2670): drop the dead `release` trigger and the never-run `attach` job from `sbom.yml` (a release made with `GITHUB_TOKEN` starts no workflows, so neither ever fired), and set `git_release_name = "v{{ version }}"` in `release-plz.toml` so the GitHub release title matches the tag. Spec 0005 names both behaviors.
Expand Down
Loading