Skip to content

Commit 20646fb

Browse files
authored
chore: Use larger runners and disable setup-go caching on Windows for CI (#1133)
Reference: actions/setup-go#495 This improves PR testing from >15 minutes to <5 minutes by using larger runners (in runner group so we can tune them without adjusting workflow configuration) and by disabling setup-go caching on Windows. Previously, it could take up to 10 minutes to download and unarchive the setup-go cache on Windows runners due to an acknowledged issue. While this could potentially introduce transient network issues downloading the Go modules from Google's proxies, those issues are generally pretty rare in my experience. We could alternatively change the module cache environment variables on Windows to point at the second hard drive on the runner, but that seemed more likely to break at some point outside our control. Ideally GitHub will fix the setup-go action and we'll just remove the Windows-specific `cache: false` after upgrading.
1 parent 3e80ac5 commit 20646fb

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ permissions:
1111
jobs:
1212
release:
1313
name: Release
14-
runs-on: windows-latest-16-cores
14+
runs-on:
15+
group: windows-latest-large
1516
steps:
1617
- name: Setup environment
1718
run: |-
@@ -32,6 +33,8 @@ jobs:
3233
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
3334
with:
3435
go-version-file: "go.mod"
36+
# Reference: https://github.com/actions/setup-go/issues/495
37+
cache: false
3538
# More assembly might be required: Docker logins, GPG, etc. It all depends
3639
# on your needs.
3740
- name: Configure git for private modules

.github/workflows/validate.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ name: Validate
22

33
on:
44
pull_request:
5-
types:
6-
- opened
7-
- reopened
8-
- edited
9-
- synchronize
105

116
jobs:
127
build:
@@ -30,15 +25,25 @@ jobs:
3025
fail-fast: false
3126
matrix:
3227
os: [ubuntu-latest, windows-latest]
33-
runs-on: ${{ matrix.os }}
28+
runs-on:
29+
group: "${{ matrix.os }}-large"
3430

3531
steps:
3632
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3733

38-
- name: Set up Go
34+
- name: Set up Go (Linux)
35+
if: runner.os == 'Linux'
36+
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
37+
with:
38+
go-version-file: "go.mod"
39+
40+
- name: Set up Go (Windows)
41+
if: runner.os == 'Windows'
3942
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
4043
with:
4144
go-version-file: "go.mod"
45+
# Reference: https://github.com/actions/setup-go/issues/495
46+
cache: false
4247

4348
- name: Set up Python
4449
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
@@ -69,7 +74,6 @@ jobs:
6974
- name: Build
7075
run: go build ./...
7176

72-
- name: ${{ matrix.test-group }}
73-
run: go test -json -v -p 1 ./... | gotestfmt
77+
- run: go test -json -v -p 1 ./... | gotestfmt
7478
env:
7579
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}

0 commit comments

Comments
 (0)