···33 This action configures the Windows builders to run tests.
44runs:
55 using: "composite"
66- steps: []
66+ steps:
77+ # The GitHub Actions hosted Windows runners have a slow persistent
88+ # `C:` drive and a temporary `D:` drive with better throughput. The
99+ # repository checkout is placed on `D:` by default, but the user
1010+ # profile is on `C:`, slowing down access to temporary directories
1111+ # and the Rust toolchain we install. Since our build environment is
1212+ # ephemeral anyway, we can save a couple minutes of CI time by
1313+ # placing everything on `D:`.
1414+ #
1515+ # Some projects have reported even bigger wins by mounting a VHDX
1616+ # virtual drive with a ReFS file system on it, with or without the
1717+ # native Dev Drive feature available in Windows 2025, but it seems
1818+ # to make things slightly slower for us overall compared to `D:`.
1919+ # Further investigation and experimentation would be welcome!
2020+ #
2121+ # See: <https://chadgolden.com/blog/github-actions-hosted-windows-runners-slower-than-expected-ci-and-you>
2222+ - name: 'Set up D: drive'
2323+ shell: pwsh
2424+ run: |
2525+ # Set up D: drive
2626+2727+ # Short file names are disabled by default on the `D:` drive,
2828+ # which breaks some of our tests. Enable them.
2929+ #
3030+ # This has a slight performance penalty, and won’t be possible
3131+ # if we switch to ReFS/Dev Drives. The alternatives are to
3232+ # reduce CI coverage for the security mitigation the tests are
3333+ # checking, or arrange for those tests to take a separate path
3434+ # to a drive that supports short file names to use instead of
3535+ # the primary temporary directory.
3636+ fsutil 8dot3name set D: 0
3737+3838+ # Move the temporary directory to `D:\Temp`.
3939+ New-Item -Path D:\ -Name Temp -ItemType directory
4040+ # Copy the effective permissions without inheritance.
4141+ $Acl = Get-Acl -Path $env:TMP
4242+ $Acl.SetAccessRuleProtection($true, $true)
4343+ Set-Acl -Path D:\Temp -AclObject $Acl
4444+4545+ Add-Content -Path $env:GITHUB_ENV @"
4646+ TMP=D:\Temp
4747+ TEMP=D:\Temp
4848+ RUSTUP_HOME=D:\.rustup
4949+ CARGO_HOME=D:\.cargo
5050+ "@
+1
.github/workflows/ci.yml
···6969 with:
7070 persist-credentials: false
7171 - name: Set up Windows Builders
7272+ if: startswith(matrix.os, 'windows')
7273 uses: ./.github/actions/setup-windows
7374 - name: Install Rust
7475 uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0