Skip to content

chore: update CI runners #17326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
yeah
  • Loading branch information
deansheather committed Apr 10, 2025
commit e475a61775ad1ca2fbb02a94c6db851d9cc6f791
48 changes: 34 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -348,23 +348,43 @@ jobs:
if: runner.os == 'Windows'
shell: pwsh
run: |
$files = Get-ChildItem -Path $env:RUNNER_TEMP -Recurse -File
foreach ($file in $files) {
Write-Output "$($file.FullName) $($file.Length)"
}
$size = ($files | Measure-Object -Property Length -Sum).Sum
Write-Output "Total Size: $size bytes"
Move-Item -Path $env:RUNNER_TOOL_CACHE -Destination "$env:RUNNER_TOOL_CACHE.old" -Force -ErrorAction SilentlyContinue
Move-Item -Path $env:RUNNER_TEMP -Destination "$env:RUNNER_TEMP.old" -Force -ErrorAction SilentlyContinue
"RUNNER_TEMP=R:\tmp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# "RUNNER_TOOL_CACHE=R:\toolcache" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
New-Item -ItemType Directory -Path "R:\toolcache" -Force -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Path "R:\tmp" -Force -ErrorAction SilentlyContinue
New-Item -ItemType SymbolicLink -Path $env:RUNNER_TOOL_CACHE -Target "R:\toolcache" -Force
New-Item -ItemType SymbolicLink -Path $env:RUNNER_TEMP -Target "R:\tmp" -Force
$ErrorActionPreference = "Stop"

# Copy RUNNER_TEMP to the ramdisk. We can't delete the contents
# because it contains some important files for the workflow.
$runnerTemp = "R:\tmp"
New-Item -ItemType Directory -Path $runnerTemp -Force
Copy-Item -Path $env:RUNNER_TEMP -Destination $runnerTemp -Force -Recurse
# Move to .old so we don't need to waste I/O deleting it.
Move-Item -Path $env:RUNNER_TEMP -Destination "$($env:RUNNER_TEMP).old" -Force
# Create a symbolic link from the old path to the new path. You can't
# just update RUNNER_TEMP because it gets overridden by the runner.
New-Item -ItemType SymbolicLink -Path $env:RUNNER_TEMP -Target $runnerTemp -Force

# Move the toolcache directory to .old since the current contents
# don't matter.
$toolCache = "R:\toolcache"
Move-Item -Path $env:RUNNER_TOOL_CACHE -Destination "$($env:RUNNER_TOOL_CACHE).old" -Force
New-Item -ItemType Directory -Path $toolCache -Force
# RUNNER_TOOL_CACHE also gets overridden by the runner, so symlink.
New-Item -ItemType SymbolicLink -Path $env:RUNNER_TOOL_CACHE -Target $toolCache -Force

# Update the GOPATH to the ramdisk. We don't care about the contents
# since we haven't installed anything yet.
"GOPATH=R:\go" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"R:\go\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Verify windows paths
if: runner.os == 'Windows'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
Write-Output "RUNNER_TEMP: $env:RUNNER_TEMP"
Write-Output "RUNNER_TEMP symlink target: $((Get-Item $env:RUNNER_TEMP).Target)"
Write-Output "RUNNER_TOOL_CACHE: $env:RUNNER_TOOL_CACHE"
Write-Output "RUNNER_TOOL_CACHE symlink target: $((Get-Item $env:RUNNER_TOOL_CACHE).Target)"
Write-Output "GOPATH: $env:GOPATH"

- name: Setup Go
uses: ./.github/actions/setup-go

Expand Down
Loading