mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
chore: update setup-go action to fix Go download failures (#22306)
setup-go has been sporadically failing to download Go, and we were advised by a member of the Go team that downloading Go from `storage.googleapis.com` is not guaranteed (which is what setup-go <= v5.6.0 does). Also remove the use-preinstalled-go optimization for Windows runners. setup-go v6 sets GOTOOLCHAIN=local, which prevents the pre-installed Go from auto-downloading the toolchain specified in go.mod. The windows optimization with v5 relied on GOTOOLCHAIN=auto. setup-go uses the runner cache, which is a different caching path but should serve the same purpose.
This commit is contained in:
@@ -5,9 +5,6 @@ inputs:
|
||||
version:
|
||||
description: "The Go version to use."
|
||||
default: "1.25.7"
|
||||
use-preinstalled-go:
|
||||
description: "Whether to use preinstalled Go."
|
||||
default: "false"
|
||||
use-cache:
|
||||
description: "Whether to use the cache."
|
||||
default: "true"
|
||||
@@ -15,9 +12,9 @@ runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
|
||||
with:
|
||||
go-version: ${{ inputs.use-preinstalled-go == 'false' && inputs.version || '' }}
|
||||
go-version: ${{ inputs.version }}
|
||||
cache: ${{ inputs.use-cache }}
|
||||
|
||||
- name: Install gotestsum
|
||||
|
||||
@@ -422,10 +422,6 @@ jobs:
|
||||
- name: Setup Go
|
||||
uses: ./.github/actions/setup-go
|
||||
with:
|
||||
# Runners have Go baked-in and Go will automatically
|
||||
# download the toolchain configured in go.mod, so we don't
|
||||
# need to reinstall it. It's faster on Windows runners.
|
||||
use-preinstalled-go: ${{ runner.os == 'Windows' }}
|
||||
use-cache: true
|
||||
|
||||
- name: Setup Terraform
|
||||
|
||||
@@ -64,11 +64,6 @@ jobs:
|
||||
|
||||
- name: Setup Go
|
||||
uses: ./.github/actions/setup-go
|
||||
with:
|
||||
# Runners have Go baked-in and Go will automatically
|
||||
# download the toolchain configured in go.mod, so we don't
|
||||
# need to reinstall it. It's faster on Windows runners.
|
||||
use-preinstalled-go: ${{ runner.os == 'Windows' }}
|
||||
|
||||
- name: Setup Terraform
|
||||
uses: ./.github/actions/setup-tf
|
||||
|
||||
Reference in New Issue
Block a user