mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-18 19:30:27 +08:00
Every patch saved its own Rust caches, up to 3 GB per patch, which pushed the repo past GitHub's 10 GB cache limit and evicted the ones master builds rely on. Patches now restore master's caches, and line-table-only debug info keeps the builds and caches smaller.
67 lines
2.2 KiB
YAML
67 lines
2.2 KiB
YAML
name: explorer-rust
|
|
# Only changes to the Rust workspace, or to this workflow, run it.
|
|
on:
|
|
push:
|
|
paths:
|
|
- "crates/**"
|
|
- "Cargo.toml"
|
|
- "Cargo.lock"
|
|
- "rust-toolchain"
|
|
- ".cargo/**"
|
|
- ".github/workflows/explorer-rust.yml"
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
# Debug info is most of a target/ directory. Line tables keep file:line in
|
|
# panics and backtraces, and make builds and caches much smaller.
|
|
CARGO_PROFILE_DEV_DEBUG: line-tables-only
|
|
|
|
jobs:
|
|
test:
|
|
name: Build & Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: dtolnay/rust-toolchain@1.97.1
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: ". -> target"
|
|
# Only master saves, so patches share its caches instead of each
|
|
# storing their own, which pushes the repo over GitHub's 10 GB limit.
|
|
save-if: ${{ github.ref == 'refs/heads/master' }}
|
|
- name: Build (all features)
|
|
run: cargo build --workspace --all-features
|
|
env:
|
|
RUSTFLAGS: -D warnings
|
|
- name: Test (all features)
|
|
run: cargo test --workspace --all-features
|
|
- name: Test httpd without search
|
|
run: cargo test -p radicle-httpd
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: dtolnay/rust-toolchain@1.97.1
|
|
with:
|
|
components: rustfmt, clippy
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: ". -> target"
|
|
# Only master saves, so patches share its caches instead of each
|
|
# storing their own, which pushes the repo over GitHub's 10 GB limit.
|
|
save-if: ${{ github.ref == 'refs/heads/master' }}
|
|
- name: Run clippy
|
|
run: cargo clippy --workspace --all-features --tests
|
|
env:
|
|
RUSTFLAGS: -D warnings
|
|
# Nothing else compiles the artifacts-off path, so it would rot.
|
|
- name: Run clippy on httpd without default features
|
|
run: cargo clippy -p radicle-httpd --no-default-features --tests
|
|
env:
|
|
RUSTFLAGS: -D warnings
|
|
- name: Check formatting
|
|
run: cargo fmt --all -- --check
|