mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-05 15:32:49 +00:00
github: use the D:
drive on Windows
This commit is contained in:
parent
be432750bd
commit
fbb14a1b2f
46
.github/actions/setup-windows/action.yml
vendored
46
.github/actions/setup-windows/action.yml
vendored
@ -3,4 +3,48 @@ description: |
|
|||||||
This action configures the Windows builders to run tests.
|
This action configures the Windows builders to run tests.
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps: []
|
steps:
|
||||||
|
# The GitHub Actions hosted Windows runners have a slow persistent
|
||||||
|
# `C:` drive and a temporary `D:` drive with better throughput. The
|
||||||
|
# repository checkout is placed on `D:` by default, but the user
|
||||||
|
# profile is on `C:`, slowing down access to temporary directories
|
||||||
|
# and the Rust toolchain we install. Since our build environment is
|
||||||
|
# ephemeral anyway, we can save a couple minutes of CI time by
|
||||||
|
# placing everything on `D:`.
|
||||||
|
#
|
||||||
|
# Some projects have reported even bigger wins by mounting a VHDX
|
||||||
|
# virtual drive with a ReFS file system on it, with or without the
|
||||||
|
# native Dev Drive feature available in Windows 2025, but it seems
|
||||||
|
# to make things slightly slower for us overall compared to `D:`.
|
||||||
|
# Further investigation and experimentation would be welcome!
|
||||||
|
#
|
||||||
|
# See: <https://chadgolden.com/blog/github-actions-hosted-windows-runners-slower-than-expected-ci-and-you>
|
||||||
|
- name: 'Set up D: drive'
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
# Set up D: drive
|
||||||
|
|
||||||
|
# Short file names are disabled by default on the `D:` drive,
|
||||||
|
# which breaks some of our tests. Enable them.
|
||||||
|
#
|
||||||
|
# This has a slight performance penalty, and won’t be possible
|
||||||
|
# if we switch to ReFS/Dev Drives. The alternatives are to
|
||||||
|
# reduce CI coverage for the security mitigation the tests are
|
||||||
|
# checking, or arrange for those tests to take a separate path
|
||||||
|
# to a drive that supports short file names to use instead of
|
||||||
|
# the primary temporary directory.
|
||||||
|
fsutil 8dot3name set D: 0
|
||||||
|
|
||||||
|
# Move the temporary directory to `D:\Temp`.
|
||||||
|
New-Item -Path D:\ -Name Temp -ItemType directory
|
||||||
|
# Copy the effective permissions without inheritance.
|
||||||
|
$Acl = Get-Acl -Path $env:TMP
|
||||||
|
$Acl.SetAccessRuleProtection($true, $true)
|
||||||
|
Set-Acl -Path D:\Temp -AclObject $Acl
|
||||||
|
|
||||||
|
Add-Content -Path $env:GITHUB_ENV @"
|
||||||
|
TMP=D:\Temp
|
||||||
|
TEMP=D:\Temp
|
||||||
|
RUSTUP_HOME=D:\.rustup
|
||||||
|
CARGO_HOME=D:\.cargo
|
||||||
|
"@
|
||||||
|
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -69,6 +69,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Set up Windows Builders
|
- name: Set up Windows Builders
|
||||||
|
if: startswith(matrix.os, 'windows')
|
||||||
uses: ./.github/actions/setup-windows
|
uses: ./.github/actions/setup-windows
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
|
uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user