ci: cache Rust toolchain, registry and build directories

Every Rust job restores the stable toolchain, Cargo registry and its own
target directories from the runner cache. Keys combine the ISO week and
all Cargo.lock files, so dependencies are reused across pushes while
stale build output and old toolchains expire weekly. Release jobs keep
separate entries per plugin.
This commit is contained in:
nvrl committed 2026-11-06 01:43:17 +01:00
1 parent 17c6fe3ab9
commit abd37fd4fe
4 files changed
+89 -10

No files matched your search

+13
View File
@@ -10,7 +10,10 @@ permissions:
env:
CARGO_HOME: ${{ gitea.workspace }}/.cargo-ci
RUSTUP_HOME: ${{ gitea.workspace }}/.rustup-ci
CARGO_TERM_COLOR: always
# Incremental data is not reused between CI runs; it only inflates the cache.
CARGO_INCREMENTAL: "0"
jobs:
check:
@@ -26,6 +29,11 @@ jobs:
token: ${{ secrets.GITEA_TOKEN }}
persist-credentials: false
- uses: ./.gitea/actions/setup
with:
cache-name: check-${{ matrix.plugin }}
target-paths: |
target
plugins/${{ matrix.plugin }}/plugin/target
- run: python3 -m unittest discover -s scripts/tests -v
- run: python3 scripts/check-plugin.py --plugin "${{ matrix.plugin }}"
@@ -38,6 +46,9 @@ jobs:
token: ${{ secrets.GITEA_TOKEN }}
persist-credentials: false
- uses: ./.gitea/actions/setup
with:
cache-name: previews
target-paths: tools/editor-check/target
- run: |
cargo fmt --all -- --check
cargo fmt --manifest-path tools/editor-check/Cargo.toml -- --check
@@ -65,6 +76,8 @@ jobs:
- uses: ./.gitea/actions/setup
with:
windows: "true"
cache-name: windows-preview
target-paths: target/windows
- run: |
python3 scripts/build-plugin.py --plugin rivet --target x86_64-pc-windows-gnu
python3 scripts/build-plugin.py --plugin patina --target x86_64-pc-windows-gnu
+6
View File
@@ -8,7 +8,9 @@ permissions:
env:
CARGO_HOME: ${{ gitea.workspace }}/.cargo-ci
RUSTUP_HOME: ${{ gitea.workspace }}/.rustup-ci
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "0"
RELEASE_REF: ${{ gitea.ref }}
jobs:
@@ -44,6 +46,10 @@ jobs:
- uses: ./.gitea/actions/setup
with:
windows: "true"
# CARGO_TARGET_DIR holds both the native checks and the Windows build.
# Kept apart from branch builds; a release never reuses preview output.
cache-name: release-${{ needs.plan.outputs.plugin }}
target-paths: target/windows
- run: |
python3 -m unittest discover -s scripts/tests -v
python3 scripts/check-plugin.py --plugin "$PLUGIN"