Merge pull request #177 from tommilligan/cache-ci-more

ci: cache more cargo target dir
This commit is contained in:
Tom Milligan
2024-05-19 17:38:27 +01:00
committed by GitHub
3 changed files with 18 additions and 3 deletions

View File

@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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

View File

@@ -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
@@ -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
@@ -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
@@ -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

View File

@@ -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
@@ -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