Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/actions/environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ runs:
dotnet workload restore \
--temp-dir "${{ runner.temp }}" \
--skip-sign-check
dotnet workload restore test/AndroidTestApp/AndroidTestApp.csproj \
--temp-dir "${{ runner.temp }}" \
--skip-sign-check
# Restore the Android test app explicitly to ensure runtime packs are available
dotnet restore test/AndroidTestApp/AndroidTestApp.csproj -r android-x64 --nologo || true
# The Windows solution filters exclude the Android test app and the tests that build it
if [[ "$RUNNER_OS" != "Windows" ]]; then
dotnet workload restore test/AndroidTestApp/AndroidTestApp.csproj \
--temp-dir "${{ runner.temp }}" \
--skip-sign-check
# Restore the Android test app explicitly to ensure runtime packs are available
dotnet restore test/AndroidTestApp/AndroidTestApp.csproj -r android-x64 --nologo || true
fi
42 changes: 42 additions & 0 deletions .github/actions/windows-dotnet-drive/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Windows .NET drive
description: Installs .NET and the NuGet packages on a fast drive on Windows runners
runs:
using: composite

steps:
# The Windows images keep .NET under Program Files, where workloads install as MSI packages, and the NuGet cache
# in the user profile on C:. So .NET goes next to the workspace, where workloads install as plain files. The x64
# runners put the workspace on D:, so the NuGet packages go there too. The arm64 runners only have C:, so the
# NuGet packages and TEMP go on a Dev Drive there. Defender already excludes C:\ on these images.
- name: Install .NET and NuGet packages on a fast drive
shell: pwsh
run: |
$root = Split-Path $env:GITHUB_WORKSPACE
"DOTNET_INSTALL_DIR=$root\.dotnet" >> $env:GITHUB_ENV
if ($root.StartsWith('C:'))
{
# Only volumes mounted after this get no antivirus filters
fsutil devdrv enable /disallowAv | Out-Host
'create vdisk file="C:\devdrive.vhdx" maximum=81920 type=expandable', 'select vdisk file="C:\devdrive.vhdx"', 'attach vdisk', 'convert gpt', 'create partition primary' |
Set-Content "$env:RUNNER_TEMP\diskpart.txt"
diskpart /s "$env:RUNNER_TEMP\diskpart.txt" | Out-Host
if ($LASTEXITCODE -ne 0) { throw "diskpart failed with exit code $LASTEXITCODE" }
$partition = Get-DiskImage -ImagePath 'C:\devdrive.vhdx' | Get-Disk | Get-Partition | Where-Object Type -eq 'Basic'
$partition | Format-Volume -DevDrive -Confirm:$false -Force | Out-Host
$partition | Add-PartitionAccessPath -AccessPath 'X:\'
# Right after the mount, trust can fail with "Access is denied" while the volume is still in use
for ($attempt = 1; $attempt -le 5; $attempt++)
{
fsutil devdrv trust X: | Out-Host
if ($LASTEXITCODE -eq 0) { break }
Start-Sleep -Seconds 3
}
if ($LASTEXITCODE -ne 0) { Write-Warning "Couldn't mark X: as a trusted Dev Drive, so antivirus filters may still scan it" }
fsutil devdrv query X: | Out-Host
$root = 'X:'
New-Item -ItemType Directory "$root\tmp" | Out-Null
"TEMP=$root\tmp" >> $env:GITHUB_ENV
"TMP=$root\tmp" >> $env:GITHUB_ENV
}
"NUGET_PACKAGES=$root\.nuget\packages" >> $env:GITHUB_ENV
$global:LASTEXITCODE = 0
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ jobs:
if: ${{ !matrix.container }}
uses: ./.github/actions/freediskspace

- name: Install .NET and NuGet packages on a fast drive
if: runner.os == 'Windows'
uses: ./.github/actions/windows-dotnet-drive

- name: Setup Environment
uses: ./.github/actions/environment

Expand Down Expand Up @@ -347,6 +351,9 @@ jobs:
with:
submodules: recursive

- name: Install .NET and NuGet packages on a fast drive
uses: ./.github/actions/windows-dotnet-drive

- name: Download sentry-native (win-x64)
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/verify-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ jobs:
- name: Remove unused applications
uses: ./.github/actions/freediskspace

- name: Install .NET and NuGet packages on a fast drive
if: runner.os == 'Windows'
uses: ./.github/actions/windows-dotnet-drive

- name: Setup Environment
uses: ./.github/actions/environment

Expand Down
Loading