Skip to content

Commit

Permalink
Merge pull request #177 from tommilligan/cache-ci-more
Browse files Browse the repository at this point in the history
ci: cache more cargo target dir
  • Loading branch information
tommilligan authored May 19, 2024
2 parents 278d177 + 9f221ab commit 294af24
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
fast-test:
name: Fast test
runs-on: ubuntu-20.04
env:
CARGO_TARGET_DIR: "/tmp/cargo-install-target-dir"
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -17,6 +19,7 @@ jobs:
~/.cargo/registry
~/.cargo/git
target
/tmp/cargo-install-target-dir
key: fast-test-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Install toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -33,6 +36,8 @@ jobs:
needs: fast-test
name: Test main target
runs-on: ubuntu-20.04
env:
CARGO_TARGET_DIR: "/tmp/cargo-install-target-dir"
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -44,7 +49,7 @@ jobs:
~/.cargo/git
target
~/.cargo/bin
cargo_target
/tmp/cargo-install-target-dir
key: detailed-test-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Install toolchain
uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -95,6 +100,8 @@ jobs:
experimental: false
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
env:
CARGO_TARGET_DIR: "/tmp/cargo-install-target-dir"
steps:
# This is required, otherwise we get files with CRLF on Windows
# Which causes tests relying on data loaded from files to fail
Expand All @@ -111,6 +118,7 @@ jobs:
~/.cargo/registry
~/.cargo/git
target
/tmp/cargo-install-target-dir
key: test-${{ matrix.os }}-${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Install toolchain
uses: actions-rs/toolchain@v1
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
os: windows-latest
name: x86_64-pc-windows-msvc.zip
runs-on: ${{ matrix.os }}
env:
CARGO_TARGET_DIR: "/tmp/cargo-install-target-dir"
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
Expand All @@ -48,6 +50,7 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
/tmp/cargo-install-target-dir
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Setup | Rust
Expand Down Expand Up @@ -132,6 +135,8 @@ jobs:
name: Publish to crates.io
needs: github_release
runs-on: ubuntu-20.04
env:
CARGO_TARGET_DIR: "/tmp/cargo-install-target-dir"
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
Expand All @@ -141,7 +146,7 @@ jobs:
~/.cargo/git
target
~/.cargo/bin
cargo_target
/tmp/cargo-install-target-dir
# We reuse the cache from our detailed test environment, if available
key: detailed-test-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Install toolchain
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ permissions:
jobs:
publish:
runs-on: ubuntu-20.04
env:
CARGO_TARGET_DIR: "/tmp/cargo-install-target-dir"
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
Expand All @@ -21,7 +23,7 @@ jobs:
~/.cargo/git
target
~/.cargo/bin
cargo_target
/tmp/cargo-install-target-dir
# We reuse the cache from our detailed test environment, if available
key: detailed-test-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Install toolchain
Expand Down

0 comments on commit 294af24

Please sign in to comment.