Skip to content
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

Improve CI performance for Windows #2600

Merged
merged 5 commits into from
Nov 17, 2023
Merged
Changes from 3 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
12 changes: 7 additions & 5 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,25 @@ jobs:
test:
env:
DOWNLOAD_CACHE: 'd:\downloadcache'
GOPATH: 'd:\a\_temp\go\work'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what we're after is putting both the go build/test cache and mod cache in this directory. I think I'd rather we use GOMODCACHE instead of GOPATH here then (just in case anything else sneaks in under GOPATH).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, sounds good. Since this basically involves breaking the cache again, I'm going to go ahead and give a shot at making the setup-go@v4 path work; these are the two directories that setup-go@v4 caches, so it ought to be at least similar.

GOCACHE: 'd:\a\_temp\go\cache'
runs-on: windows-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: go-cache
uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
path: D:/a/_temp/go
jchadwick-buf marked this conversation as resolved.
Show resolved Hide resolved
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-v2
restore-keys: |
${{ runner.os }}-go-
- name: setup-go
uses: actions/setup-go@v4 # this contains a fix for Windows file extraction
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
# This runs very slowly and inconsistently on Windows for undetermined reasons.
# We manually cache in the GitHub Actions _temp directory instead.
cache: false
- name: windows-cache
uses: actions/cache@v3
Expand Down