From 5d68ef312a36b8d9839acce42038b0938f915b35 Mon Sep 17 00:00:00 2001 From: Matt Keeter Date: Sat, 8 Jun 2024 09:42:32 -0400 Subject: [PATCH] Run Windows CI on a separate ReFS drive (see astral-sh/uv#3522) --- .github/workflows/test.yml | 44 +++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 86c159b2..f3068bf5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: test: strategy: matrix: - os: ["ubuntu-latest", "macos-14", "windows-latest"] + os: ["ubuntu-latest", "macos-14"] runs-on: ${{ matrix.os }} timeout-minutes: 15 steps: @@ -25,3 +25,45 @@ jobs: run: cargo test --verbose --package fidget --lib - name: Run doc tests run: cargo test --verbose --package fidget --doc + + test-windows: + runs-on: windows-latest + timeout-minutes: 15 + steps: + - name: Create dev drive using ReFS + run: | + $Volume = New-VHD -Path C:/fidget_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 "DEV_DRIVE=$($Volume.DriveLetter):" >> $env:GITHUB_ENV + - uses: actions/checkout@v4 + - name: Copy repo to dev drive + run: | + Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.DEV_DRIVE }}/fidget" -Recurse + - uses: Swatinem/rust-cache@v2 + with: + workspaces: ${{ env.DEV_DRIVE }}/fidget + env: + CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo + RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup + - name: Build tests + working-directory: ${{ env.DEV_DRIVE }}/fidget + env: + CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo + RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup + run: cargo test --verbose --package fidget --no-run + - name: Run crate tests + working-directory: ${{ env.DEV_DRIVE }}/fidget + env: + CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo + RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup + run: cargo test --verbose --package fidget --lib + - name: Run doc tests + working-directory: ${{ env.DEV_DRIVE }}/fidget + env: + CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo + RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup + run: cargo test --verbose --package fidget --doc