Skip to content

Commit

Permalink
Key cache with output from 'setup rust toolchain'
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeMan99 committed Apr 6, 2024
1 parent 5d275a1 commit 4c8389b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Rust
id: toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.config.rust_target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.config.rust_target }}
key: "${{ matrix.config.rust_target }}-${{ steps.toolchain.outputs.cachekey }}"
- name: Build
run: cargo build --tests
- name: Test
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: "Setup Rust"
id: toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.config.rust_target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.config.rust_target }}
key: "${{ matrix.config.rust_target }}-${{ steps.toolchain.outputs.cachekey }}"
- name: Cargo Build
run: cargo build --release --target ${{ matrix.config.rust_target }}
- name: Create Assets
Expand Down Expand Up @@ -70,8 +71,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain
id: toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: ${{ steps.toolchain.outputs.cachekey }}
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 comments on commit 4c8389b

Please sign in to comment.