Skip to content

Commit

Permalink
Separate cache keys
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasEi committed Jul 13, 2024
1 parent 8009c5f commit 7d45fe4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/actions/prepare/action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: 'Prepare'
description: 'Prepare action runner'
inputs:
cache-key:
description: key for the cache
required: true
runs:
using: "composite"
steps:
Expand All @@ -15,7 +19,7 @@ runs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }}
key: ${{inputs.cache-key}}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare/
with:
cache-key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }}
- name: Build & run tests
run: cargo test -p bevy_asset_loader
- name: Build & run tests for derive package
run: cargo test -p bevy_asset_loader_derive
test-2d-3d-dynamic:
dynamic-2d-3d-test:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare/
with:
cache-key: ${{ runner.os }}-cargo-dynamic-2d-3d-test-${{ hashFiles('**/Cargo.toml') }}
- name: Build & run tests for 2d, 3d, standard
run: cargo test --features "2d, 3d, standard_dynamic_assets" -p bevy_asset_loader
- name: Build & run tests for derive package
Expand All @@ -37,6 +41,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare/
with:
cache-key: ${{ runner.os }}-cargo-progress-tracking-test-${{ hashFiles('**/Cargo.toml') }}
- name: Build & run tests progress tracking
run: cargo test --features "progress_tracking" -p bevy_asset_loader
full-test:
Expand All @@ -47,12 +53,16 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare/
with:
cache-key: ${{ runner.os }}-cargo-full-test-${{ hashFiles('**/Cargo.toml') }}
- name: Build & run tests progress tracking and 2d,3d,dynamic
run: cargo test --features "2d, 3d, standard_dynamic_assets, progress_tracking" -p bevy_asset_loader
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
cache-key: ubuntu-cargo-lint-${{ hashFiles('**/Cargo.toml') }}
- uses: ./.github/actions/prepare/
- uses: taiki-e/install-action@v2
with:
Expand Down

0 comments on commit 7d45fe4

Please sign in to comment.