mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-15 15:16:37 +00:00
Fix caching: Do not mount dev drive at target
Since it contains files that are not accessible. Also remove use of dev drive for cargo/rustup home since it prevents caching (rust-cache does not read from env). Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
parent
16cc536fab
commit
6687219cd0
1 changed files with 9 additions and 11 deletions
20
.github/actions/just-setup/action.yml
vendored
20
.github/actions/just-setup/action.yml
vendored
|
@ -23,14 +23,19 @@ runs:
|
||||||
run: sudo spctl developer-mode enable-terminal
|
run: sudo spctl developer-mode enable-terminal
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- name: Export CARGO_TARGET_DIR
|
||||||
|
if: runner.os != 'Windows'
|
||||||
|
run: |
|
||||||
|
echo "CARGO_TARGET_DIR=${{ github.workspace }}/target" >> "$GITHUB_ENV"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- uses: samypr100/setup-dev-drive@v3
|
- uses: samypr100/setup-dev-drive@v3
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
with:
|
with:
|
||||||
drive-type: Fixed
|
drive-type: Fixed
|
||||||
drive-size: 2GB
|
drive-size: 3GB
|
||||||
env-mapping: |
|
env-mapping: |
|
||||||
CARGO_HOME,{{ DEV_DRIVE }}/.cargo
|
CARGO_TARGET_DIR,{{ DEV_DRIVE }}/target
|
||||||
RUSTUP_HOME,{{ DEV_DRIVE }}/.rustup
|
|
||||||
|
|
||||||
- name: Exclude workspace and cargo/rustup home from windows defender
|
- name: Exclude workspace and cargo/rustup home from windows defender
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
|
@ -38,14 +43,6 @@ runs:
|
||||||
Add-MpPreference -ExclusionPath '${{ env.DEV_DRIVE }},${{ github.workspace }}'
|
Add-MpPreference -ExclusionPath '${{ env.DEV_DRIVE }},${{ github.workspace }}'
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|
||||||
- uses: samypr100/setup-dev-drive@v3
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
with:
|
|
||||||
mount-path: ${{ github.workspace }}/target
|
|
||||||
drive-size: 3GB
|
|
||||||
drive-type: Fixed
|
|
||||||
drive-path: D:\target_drive.vhdx
|
|
||||||
|
|
||||||
- name: Add just to tools to install
|
- name: Add just to tools to install
|
||||||
run: echo "tools=just" >>"$GITHUB_ENV"
|
run: echo "tools=just" >>"$GITHUB_ENV"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
@ -88,6 +85,7 @@ runs:
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
env-vars: "CARGO CC CFLAGS CXX CMAKE RUST JUST"
|
env-vars: "CARGO CC CFLAGS CXX CMAKE RUST JUST"
|
||||||
|
workspaces: . -> ${{ env.CARGO_TARGET_DIR }}
|
||||||
env:
|
env:
|
||||||
RUSTFLAGS: ${{ steps.retrieve-rustflags.outputs.RUSTFLAGS }}
|
RUSTFLAGS: ${{ steps.retrieve-rustflags.outputs.RUSTFLAGS }}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue