mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
9a417df940
## Description Add exponential backoff retries to all `go install` and `go mod download` commands across CI workflows and actions. ## Why Fixes [coder/internal#1276](https://github.com/coder/internal/issues/1276) - CI fails when `sum.golang.org` returns 500 errors during Go module verification. This is an infrastructure-level flake that can't be controlled. ## Changes - Created `.github/scripts/retry.sh` - reusable retry helper with exponential backoff (2s, 4s, 8s delays, max 3 attempts), using `scripts/lib.sh` helpers - Wrapped all `go install` and `go mod download` commands with retry in: - `.github/actions/setup-go/action.yaml` - `.github/actions/setup-sqlc/action.yaml` - `.github/actions/setup-go-tools/action.yaml` - `.github/workflows/ci.yaml` - `.github/workflows/release.yaml` - `.github/workflows/security.yaml` - Added GNU tools setup (bash 4+, GNU getopt, make 4+) for macOS in `test-go-pg` job, since `retry.sh` uses `lib.sh` which requires these tools
13 lines
420 B
YAML
13 lines
420 B
YAML
name: "Setup Go tools"
|
|
description: |
|
|
Set up tools for `make gen`, `offlinedocs` and Schmoder CI.
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: go install tools
|
|
shell: bash
|
|
run: |
|
|
./.github/scripts/retry.sh -- go install tool
|
|
# NOTE: protoc-gen-go cannot be installed with `go get`
|
|
./.github/scripts/retry.sh -- go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.30
|