refactor GitHub Actions workflow to improve caching

This commit is contained in:
2025-11-06 22:33:57 +01:00
parent 355e8754a8
commit 1b0cd8913b

View File

@@ -28,12 +28,31 @@ jobs:
with:
targets: wasm32-unknown-unknown
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Cache cargo registry and git
uses: actions/cache@v4
with:
workspaces: schafkopf-logic
cache-directories: |
~/.cache/trunk
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('schafkopf-logic/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Cache trunk build artifacts
uses: actions/cache@v4
with:
path: |
~/.cache/trunk/
schafkopf-logic/target/wasm-bindgen/
schafkopf-logic/target/wasm-opt/
schafkopf-logic/target/wasm32-unknown-unknown/
~/.cache/.wasm-pack/
~/.cache/wasm-pack/
key: ${{ runner.os }}-trunk-${{ hashFiles('schafkopf-logic/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-trunk-
- name: Install trunk
run: cargo install trunk --locked