From 37a43dec3ee861672789ba5dc6bd5fc1f94fcd1e Mon Sep 17 00:00:00 2001 From: Isaac Elliott Date: Wed, 17 Jan 2024 07:30:42 +1000 Subject: [PATCH] build: set CARGO_HOME and CARGO_TARGET_DIR --- .github/workflows/tests.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d17c4b97..efd9b7bb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,10 +40,12 @@ jobs: - name: "tests" if: github.event_name == 'pull_request' - run: > - nix develop .#tests - --post-build-hook "$RUNNER_TEMP/postBuildHook-$GITHUB_RUN_ID-$GITHUB_RUN_NUMBER" - -c ./scripts/recheck origin/$GITHUB_BASE_REF $GITHUB_REF_NAME + run: | + export CARGO_HOME=/var/cache/github-runner/.cargo + export CARGO_TARGET_DIR=$(realpath --relative-to "$PWD" /var/cache/github-runner/target) + nix develop .#tests \ + --post-build-hook "$RUNNER_TEMP/postBuildHook-$GITHUB_RUN_ID-$GITHUB_RUN_NUMBER" \ + -c ./scripts/recheck origin/$GITHUB_BASE_REF $GITHUB_REF_NAME # `tests.yml` is currently set to run on pushes to `main`. When that happens, `$GITHUB_BASE_REF` # isn't set because it's not a pull request. Instead we use the most recent commit before the