Skip to content

Commit

Permalink
Compare to Dev Drive:
Browse files Browse the repository at this point in the history
  • Loading branch information
ichard26 committed Dec 25, 2024
1 parent daec881 commit 483859b
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,40 @@ jobs:
env:
TEMP: "C:\\Temp"

- run: rm .nox -r

- name: Create a Dev Drive
run: |
./tools/ci/devdrive.ps1 -Drive R -Size 4GB
mkdir R:/Temp
echo "TEMP=R:\\Temp" >> $env:GITHUB_ENV
Copy-Item -Path ${{ github.workspace }} -Destination "R:/pip" -Recurse
# Main check
- name: Run unit tests
if: matrix.group == 1
working-directory: R:/pip
run: >-
nox -s test-${{ matrix.python }} --
-m unit
--verbose --numprocesses auto --showlocals
- name: Run integration tests (group 1)
if: matrix.group == 1
working-directory: R:/pip
run: >-
nox -s test-${{ matrix.python }} --
-m integration -k "not test_install"
--verbose --numprocesses auto --showlocals
- name: Run integration tests (group 2)
if: matrix.group == 2
working-directory: R:/pip
run: >-
nox -s test-${{ matrix.python }} --
-m integration -k "test_install"
--verbose --numprocesses auto --showlocals
tests-zipapp:
name: tests / zipapp
runs-on: ubuntu-latest
Expand Down
39 changes: 39 additions & 0 deletions tools/ci/devdrive.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# A Powershell script to create a Dev Drive which tends to have significantly better
# performance in developer workloads. The goal is improve pip's Windows CI times.
#
# The implementation was borrowed from the uv project which also use a Dev Drive for
# better CI performance: https://github.com/astral-sh/uv/pull/3522
#
# Windows docs:
# https://learn.microsoft.com/en-us/windows/dev-drive/
# Related GHA reports:
# https://github.com/actions/runner-images/issues/7320 (Windows slowness report)
# https://github.com/actions/runner-images/issues/8698 (feature request for
# preprovisioned Dev Drives)

[CmdletBinding()]
param(
[Parameter(Mandatory=$true,
HelpMessage="Drive letter to use for the Dev Drive")]
[String]$drive,
[Parameter(Mandatory=$true,
HelpMessage="Size to allocate to the Dev Drive")]
[UInt64]$size
)
$ErrorActionPreference = "Stop"

$OSVersion = [Environment]::OSVersion.Version
$Partition = New-VHD -Path D:/pip_dev_drive.vhdx -SizeBytes $size |
Mount-VHD -Passthru |
Initialize-Disk -Passthru |
New-Partition -DriveLetter $drive -UseMaximumSize
# Dev Drives aren't supported on all GHA Windows runners, in which case fallback to
# a ReFS disk which still offer performance gains.
if ($OSVersion -ge (New-Object 'Version' 10.0.22621)) {
Write-Output "Dev Drives are supported, one will be created at ${drive}:"
$Volume = ($Partition | Format-Volume -DevDrive -Confirm:$false -Force)
} else {
Write-Output "Dev Drives are unsupported, only creating a ReFS disk at ${drive}:"
$Volume = ($Partition | Format-Volume -FileSystem ReFS -Confirm:$false -Force)
}
Write-Output $Volume

0 comments on commit 483859b

Please # to comment.