Cache tools and Rust build output in CI and release builds

This commit is contained in:
2026-10-14 22:40:54 +02:00
parent 7f9d27b8d1
commit 45ecc698c2
3 changed files with 45 additions and 2 deletions
+19
View File
@@ -14,6 +14,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Restore tool cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin
~/.cargo/registry
~/.cargo/git
~/.rustup
~/.local/bin/mise
~/.local/share/mise
key: tools-check-${{ hashFiles('scripts/ci-setup.sh', 'mise.toml') }}
- name: Restore build cache
uses: actions/cache@v4
with:
path: src-tauri/target
key: target-check-${{ hashFiles('src-tauri/Cargo.lock') }}-${{ github.sha }}
restore-keys: |
target-check-${{ hashFiles('src-tauri/Cargo.lock') }}-
target-check-
- name: Install tools
run: scripts/ci-setup.sh
- name: Unit tests
+21
View File
@@ -24,6 +24,27 @@ jobs:
CARGO_BUILD_JOBS: "2"
steps:
- uses: actions/checkout@v4
- name: Restore tool cache
uses: actions/cache@v4
with:
# ~/.cache/cargo-xwin holds the Windows SDK files cargo-xwin downloads.
path: |
~/.cargo/bin
~/.cargo/registry
~/.cargo/git
~/.rustup
~/.local/bin/mise
~/.local/share/mise
~/.cache/cargo-xwin
key: tools-release-${{ hashFiles('scripts/ci-setup.sh', 'mise.toml') }}
- name: Restore build cache
uses: actions/cache@v4
with:
path: src-tauri/target
key: target-release-${{ hashFiles('src-tauri/Cargo.lock') }}-${{ github.sha }}
restore-keys: |
target-release-${{ hashFiles('src-tauri/Cargo.lock') }}-
target-release-
- name: Install tools
run: scripts/ci-setup.sh --windows
- name: Take the version from the tag
+5 -2
View File
@@ -16,6 +16,9 @@ fi
$SUDO apt-get update -q
$SUDO apt-get install -yq --no-install-recommends "${packages[@]}"
# Rust, cargo-xwin and mise may already be here from the CI cache.
export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$PATH"
# Rust: not pinned in mise.toml, because mise needs rustup for it.
if ! command -v cargo >/dev/null; then
curl -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal
@@ -25,10 +28,10 @@ export PATH="$HOME/.cargo/bin:$PATH"
if [[ "${1:-}" == "--windows" ]]; then
rustup target add x86_64-pc-windows-msvc
cargo install --locked cargo-xwin
command -v cargo-xwin >/dev/null || cargo install --locked cargo-xwin
fi
curl -fsSL https://mise.run | MISE_VERSION=v2026.9.1 sh
command -v mise >/dev/null || curl -fsSL https://mise.run | MISE_VERSION=v2026.9.1 sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
echo "$HOME/.local/share/mise/shims" >> "$GITHUB_PATH"
export PATH="$HOME/.local/bin:$HOME/.local/share/mise/shims:$PATH"