perf: optimize CI workflows with caching and reduced parallelism

Changes:
- Add Rust caching (Swatinem/rust-cache) to all heavy build jobs
- Reduce cargo-check-each-crate from 7 to 4 parallel jobs
- Reduce tests-linux-stable matrix from 6 to 3 jobs
- Set CARGO_INCREMENTAL=0 for consistent caching
- Reduce timeouts from 60 to 45 minutes (cache makes builds faster)
- Remove redundant disk cleanup steps (cache handles this)

Expected improvements:
- 50-80% faster builds after cache is populated
- Lower VPS load (fewer parallel jobs)
- More consistent build times

Affected workflows:
- checks.yml (cargo-clippy, check-try-runtime)
- tests.yml (quick-benchmarks, cargo-check-all-benches)
- tests-misc.yml (test-pezframe-ui, cargo-check-each-crate)
- tests-linux-stable.yml (test-linux-stable)
- docs.yml (test-doc, build-rustdoc)
This commit is contained in:
2026-01-26 23:44:30 +03:00
parent e89b8f29b7
commit 63c23e9ac9
6 changed files with 110 additions and 74 deletions
+19 -5
View File
@@ -23,7 +23,7 @@ jobs:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_rust }}
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
timeout-minutes: 45
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
@@ -31,11 +31,20 @@ jobs:
RUST_BACKTRACE: "full"
WASM_BUILD_NO_COLOR: 1
WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings"
CARGO_INCREMENTAL: 0
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Rust Cache
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
with:
shared-key: quick-benchmarks
cache-on-failure: true
- name: Add wasm32v1-none target
run: rustup target add wasm32v1-none || true
- name: script
run: cargo run --locked --release -p pezstaging-node-cli --bin bizinikiwi-node --features runtime-benchmarks --quiet -- benchmark pezpallet --chain dev --pezpallet "*" --extrinsic "*" --steps 2 --repeat 1 --quiet
@@ -69,17 +78,22 @@ jobs:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_rust }}
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
timeout-minutes: 45
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
SKIP_WASM_BUILD: 1
CARGO_INCREMENTAL: 0
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Rust Cache
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
with:
shared-key: check-all-benches
cache-on-failure: true
- name: script
# Use --features runtime-benchmarks to ensure all crates have the feature enabled,
# avoiding feature unification issues where pezframe-support has the feature but
# implementing crates don't.
run: |
cargo check --workspace --benches --features runtime-benchmarks --quiet