From f5772a2f059f997d0c82c48a7a150374bfef8e2d Mon Sep 17 00:00:00 2001 From: Jo <10510431+j178@users.noreply.github.com> Date: Fri, 27 Dec 2024 11:18:56 +0800 Subject: [PATCH] Try to use D drive on Windows CI (#157) * Try to use D drive on Windows CI * Simplify * CI cache --- .github/workflows/ci.yml | 23 ++--------------------- .github/workflows/setup-dev-drive.ps1 | 19 +++++++++---------- 2 files changed, 11 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c77f7fa..0ccd1f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,25 +51,15 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Create Dev Drive using ReFS + - name: Create Dev Drive run: ${{ github.workspace }}/.github/workflows/setup-dev-drive.ps1 - # actions/checkout does not let us clone into anywhere outside ${{ github.workspace }}, so we have to copy the clone... - - name: Copy Git Repo to Dev Drive - run: | - Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.PREFLIGIT_WORKSPACE }}" -Recurse - - uses: Swatinem/rust-cache@v2 - with: - # Add a key to invalidate previous caches. - key: 1 - workspaces: ${{ env.PREFLIGIT_WORKSPACE }} - name: "Install Rust toolchain" run: rustup component add clippy - name: "Clippy" - working-directory: ${{ env.PREFLIGIT_WORKSPACE }} run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings cargo-shear: @@ -145,20 +135,12 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Create Dev Drive using ReFS + - name: Create Dev Drive run: ${{ github.workspace }}/.github/workflows/setup-dev-drive.ps1 - # actions/checkout does not let us clone into anywhere outside ${{ github.workspace }}, so we have to copy the clone... - - name: Copy Git Repo to Dev Drive - run: | - Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.PREFLIGIT_WORKSPACE }}" -Recurse - - uses: Swatinem/rust-cache@v2 - with: - workspaces: ${{ env.PREFLIGIT_WORKSPACE }} - name: "Install Rust toolchain" - working-directory: ${{ env.PREFLIGIT_WORKSPACE }} run: rustup show - name: "Install cargo nextest" @@ -172,7 +154,6 @@ jobs: cache-local-path: ${{ env.DEV_DRIVE }}/uv-cache - name: "Cargo test" - working-directory: ${{ env.PREFLIGIT_WORKSPACE }} run: | cargo nextest show-config test-groups cargo nextest run --workspace --status-level skip --failure-output immediate --no-fail-fast -j 8 --final-status-level slow diff --git a/.github/workflows/setup-dev-drive.ps1 b/.github/workflows/setup-dev-drive.ps1 index e399aec..f8d17e4 100644 --- a/.github/workflows/setup-dev-drive.ps1 +++ b/.github/workflows/setup-dev-drive.ps1 @@ -1,16 +1,16 @@ # This creates a 10GB dev drive, and exports all required environment # variables so that rustup, prefligit and others all use the dev drive as much # as possible. -$Volume = New-VHD -Path C:/prefligit_dev_drive.vhdx -SizeBytes 10GB | - Mount-VHD -Passthru | - Initialize-Disk -Passthru | - New-Partition -AssignDriveLetter -UseMaximumSize | - Format-Volume -FileSystem ReFS -Confirm:$false -Force +# $Volume = New-VHD -Path C:/prefligit_dev_drive.vhdx -SizeBytes 10GB | +# Mount-VHD -Passthru | +# Initialize-Disk -Passthru | +# New-Partition -AssignDriveLetter -UseMaximumSize | +# Format-Volume -FileSystem ReFS -Confirm:$false -Force +# +# Write-Output $Volume -Write-Output $Volume - -$Drive = "$($Volume.DriveLetter):" -$Tmp = "$($Drive)/prefligit-tmp" +$Drive = "D:" +$Tmp = "$($Drive)\prefligit-tmp" # Create the directory ahead of time in an attempt to avoid race-conditions New-Item $Tmp -ItemType Directory @@ -22,5 +22,4 @@ Write-Output ` "PREFLIGIT_INTERNAL__TEST_DIR=$($Tmp)" ` "RUSTUP_HOME=$($Drive)/.rustup" ` "CARGO_HOME=$($Drive)/.cargo" ` - "PREFLIGIT_WORKSPACE=$($Drive)/prefligit" ` >> $env:GITHUB_ENV