Merge pull request #184 from tommilligan/fix-cargo-target-dir-release

ci: be more limited with CARGO_TARGET_DIR
This commit is contained in:
Tom Milligan
2024-05-24 15:05:19 +01:00
committed by GitHub
3 changed files with 8 additions and 20 deletions

View File

@@ -7,8 +7,6 @@ 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
@@ -19,7 +17,6 @@ jobs:
~/.cargo/registry
~/.cargo/git
target
/tmp/cargo-install-target-dir
key: fast-test-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
@@ -35,8 +32,6 @@ 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
@@ -63,7 +58,7 @@ jobs:
cache-dependency-path: compile_assets/yarn.lock
- name: Install additional test dependencies
env:
CARGO_TARGET_DIR: cargo_target
CARGO_TARGET_DIR: "/tmp/cargo-install-target-dir"
run: ./scripts/install
- name: Run check script
run: ./scripts/check
@@ -99,8 +94,6 @@ 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
@@ -117,7 +110,6 @@ 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: dtolnay/rust-toolchain@master

View File

@@ -37,8 +37,6 @@ 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
@@ -47,20 +45,18 @@ jobs:
- name: Setup | Cache Cargo
uses: actions/cache@v4
with:
# Note that we don't cache the `target` directory here
# so we do a completely clean rebuild for artefacts
path: |
~/.cargo/registry
~/.cargo/git
/tmp/cargo-install-target-dir
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup | Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Create target directory
run: mkdir target
target: ${{ matrix.target }}
- name: Setup | cross
if: endsWith(matrix.target, '-unknown-linux-musl')
@@ -137,7 +133,6 @@ jobs:
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@v4
@@ -147,7 +142,6 @@ jobs:
~/.cargo/git
target
~/.cargo/bin
/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,8 +12,6 @@ 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@v4
@@ -31,8 +29,12 @@ jobs:
with:
toolchain: stable
- name: Install mdbook
env:
CARGO_TARGET_DIR: "/tmp/cargo-install-target-dir"
run: ./scripts/install-mdbook
- name: Install mdbook extras
env:
CARGO_TARGET_DIR: "/tmp/cargo-install-target-dir"
run: ./book/scripts/install-mdbook-extras
- name: Build book
run: ./scripts/build-book