Skip to content

Commit

Permalink
Try to use D drive on Windows CI (#157)
Browse files Browse the repository at this point in the history
* Try to use D drive on Windows CI

* Simplify

* CI cache
  • Loading branch information
j178 authored Dec 27, 2024
1 parent 310477e commit f5772a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 31 deletions.
23 changes: 2 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand All @@ -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
19 changes: 9 additions & 10 deletions .github/workflows/setup-dev-drive.ps1
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

0 comments on commit f5772a2

Please sign in to comment.