Files
setup-go/docs/adrs/0000-caching-dependencies.md
signalhub-ci-mirror 224020d282
Validate Microsoft build of Go / Microsoft build of Go 1.24 on ubuntu-latest (push) Successful in 53s
Validate Microsoft build of Go / Microsoft build of Go 1.25 on ubuntu-latest (push) Failing after 31s
Validate Microsoft build of Go / Microsoft build of Go via env var on ubuntu-latest (push) Successful in 35s
Validate Microsoft build of Go / Microsoft build of Go arch x64 on ubuntu-latest (push) Successful in 6s
Validate Microsoft build of Go / Microsoft build of Go with caching on ubuntu-latest (push) Successful in 13s
Validate 'setup-go' / stable (ubuntu-latest) (push) Successful in 42s
Validate 'setup-go' / oldstable (ubuntu-latest) (push) Successful in 34s
Validate 'setup-go' / aliases-arch (x32, ubuntu-latest, oldstable) (push) Successful in 30s
Validate 'setup-go' / aliases-arch (x32, ubuntu-latest, stable) (push) Successful in 30s
Validate 'setup-go' / aliases-arch (x64, ubuntu-latest, oldstable) (push) Successful in 7s
Validate 'setup-go' / aliases-arch (x64, ubuntu-latest, stable) (push) Successful in 7s
Validate 'setup-go' / Setup local-cache version (1.21.13, ubuntu-latest) (push) Successful in 31s
Validate 'setup-go' / Setup local-cache version (1.22.8, ubuntu-latest) (push) Successful in 49s
Validate 'setup-go' / Setup local-cache version (1.23.2, ubuntu-latest) (push) Successful in 47s
Validate 'setup-go' / check-latest (1.20, ubuntu-latest) (push) Successful in 39s
Validate 'setup-go' / check-latest (1.21, ubuntu-latest) (push) Successful in 8s
Validate 'setup-go' / check-latest (1.22, ubuntu-latest) (push) Successful in 7s
Validate 'setup-go' / check-latest (1.23, ubuntu-latest) (push) Successful in 34s
Validate 'setup-go' / go-version-file (ubuntu-latest) (push) Failing after 31s
Validate 'setup-go' / go-version-file-with-gowork (ubuntu-latest) (push) Successful in 7s
Validate 'setup-go' / go-version-file-with-tool-versions (ubuntu-latest) (push) Successful in 6s
Validate 'setup-go' / go-version-file-with-go-version (ubuntu-latest) (push) Successful in 5m27s
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, ubuntu-latest) (push) Successful in 7s
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, ubuntu-latest) (push) Successful in 3m1s
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, ubuntu-latest) (push) Successful in 7s
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, ubuntu-latest) (push) Successful in 6s
Validate 'setup-go' / setup-versions-from-dist (1.11.12, ubuntu-latest) (push) Successful in 54s
Validate 'setup-go' / architecture (x64, 1.20.14, ubuntu-latest) (push) Successful in 7s
Validate 'setup-go' / architecture (x64, 1.21, ubuntu-latest) (push) Successful in 6s
Validate 'setup-go' / architecture (x64, 1.22, ubuntu-latest) (push) Successful in 6s
Validate 'setup-go' / architecture (x64, 1.23, ubuntu-latest) (push) Successful in 7s
Validate 'setup-go' / aliases-arch (x64, macos-latest, oldstable) (push) Canceled after 0s
Validate 'setup-go' / aliases-arch (x64, macos-latest, stable) (push) Canceled after 0s
Validate 'setup-go' / aliases-arch (x64, macos-latest-large, oldstable) (push) Canceled after 0s
Validate 'setup-go' / aliases-arch (x64, macos-latest-large, stable) (push) Canceled after 0s
Validate 'setup-go' / aliases-arch (x64, windows-latest, oldstable) (push) Canceled after 0s
Validate 'setup-go' / aliases-arch (x64, windows-latest, stable) (push) Canceled after 0s
Validate 'setup-go' / Setup local-cache version (1.20.14, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / Setup local-cache version (1.21.13, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / Setup local-cache version (1.21.13, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / Setup local-cache version (1.21.13, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / Setup local-cache version (1.22.8, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / Setup local-cache version (1.22.8, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / Setup local-cache version (1.22.8, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / Setup local-cache version (1.23.2, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / Setup local-cache version (1.23.2, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / check-latest (1.20, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / check-latest (1.20, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / check-latest (1.20, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / check-latest (1.21, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / check-latest (1.21, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / check-latest (1.21, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / check-latest (1.22, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / check-latest (1.22, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / check-latest (1.22, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / check-latest (1.23, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / check-latest (1.23, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / check-latest (1.23, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / go-version-file (macos-latest) (push) Canceled after 0s
Validate 'setup-go' / go-version-file (macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / go-version-file (windows-latest) (push) Canceled after 0s
Validate 'setup-go' / go-version-file-with-gowork (macos-latest) (push) Canceled after 0s
Validate 'setup-go' / go-version-file-with-gowork (macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / go-version-file-with-gowork (windows-latest) (push) Canceled after 0s
Validate 'setup-go' / go-version-file-with-go-version (windows-latest) (push) Canceled after 0s
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / architecture (arm64, 1.23, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / go-version-file-with-tool-versions (macos-latest) (push) Canceled after 0s
Validate 'setup-go' / go-version-file-with-tool-versions (macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / go-version-file-with-tool-versions (windows-latest) (push) Canceled after 0s
Validate 'setup-go' / go-version-file-with-go-version (macos-latest) (push) Canceled after 0s
Validate 'setup-go' / go-version-file-with-go-version (macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / setup-versions-from-dist (1.11.12, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / setup-versions-from-dist (1.11.12, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / architecture (arm64, 1.20.14, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / architecture (arm64, 1.21, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / architecture (arm64, 1.22, macos-latest) (push) Canceled after 0s
Validate 'setup-go' / architecture (x64, 1.20.14, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / architecture (x64, 1.21, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / architecture (x64, 1.21, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / architecture (x64, 1.22, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / architecture (x64, 1.22, windows-latest) (push) Canceled after 0s
Validate 'setup-go' / architecture (x64, 1.23, macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / architecture (x64, 1.23, windows-latest) (push) Canceled after 0s
Validate Windows installation / Validate if symlink is created (false, 1.20.1) (push) Canceled after 0s
Validate Windows installation / Validate if symlink is created (true, 1.20.1) (push) Canceled after 0s
Validate Windows installation / Find default go version (push) Canceled after 0s
Validate 'setup-go' / architecture (x64, 1.20.14, macos-latest-large) (push) Canceled after 0s
Validate Windows installation / Validate if symlink is not created for default go (false) (push) Canceled after 0s
Validate Windows installation / Validate if symlink is not created for default go (true) (push) Canceled after 0s
Validate Windows installation / Validate if hostedtoolcache works as expected (false, 1.20.1) (push) Canceled after 0s
Validate Microsoft build of Go / Microsoft build of Go 1.24 on macos-latest (push) Canceled after 0s
Validate Microsoft build of Go / Microsoft build of Go 1.24 on windows-latest (push) Canceled after 0s
Validate Microsoft build of Go / Microsoft build of Go 1.25 on macos-latest (push) Canceled after 0s
Validate Microsoft build of Go / Microsoft build of Go 1.25 on windows-latest (push) Canceled after 0s
Validate Microsoft build of Go / Microsoft build of Go arch arm64 on macos-latest (push) Canceled after 0s
Validate Microsoft build of Go / Microsoft build of Go arch x64 on macos-latest (push) Canceled after 0s
Validate Microsoft build of Go / Microsoft build of Go with caching on macos-latest (push) Canceled after 0s
Validate Microsoft build of Go / Microsoft build of Go with caching on windows-latest (push) Canceled after 0s
Validate 'setup-go' / stable (macos-latest) (push) Canceled after 0s
Validate 'setup-go' / aliases-arch (x32, windows-latest, oldstable) (push) Canceled after 0s
Validate Microsoft build of Go / Microsoft build of Go via env var on macos-latest (push) Canceled after 0s
Validate Microsoft build of Go / Microsoft build of Go via env var on windows-latest (push) Canceled after 0s
Validate 'setup-go' / stable (macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / stable (windows-latest) (push) Canceled after 0s
Validate 'setup-go' / oldstable (macos-latest) (push) Canceled after 0s
Validate 'setup-go' / oldstable (macos-latest-large) (push) Canceled after 0s
Validate 'setup-go' / oldstable (windows-latest) (push) Canceled after 0s
Validate 'setup-go' / aliases-arch (x32, windows-latest, stable) (push) Canceled after 0s
Vendored snapshot of setup-go@v6 (no upstream history)
2026-09-18 18:02:10 +00:00

70 lines
3.2 KiB
Markdown

# 0. Caching dependencies
Date: 2022-04-13
Status: Accepted
# Context
`actions/setup-go` is the one of the most popular action related to Golang in GitHub Actions. Many customers use it in conjunction with [actions/cache](https://github.com/actions/cache) to speed up dependency installation process.
See more examples on proper usage in [actions/cache documentation](https://github.com/actions/cache/blob/main/examples.md#go---modules).
# Goals & Anti-Goals
Integration of caching functionality into `actions/setup-go` action will bring the following benefits for action users:
- Decrease the entry threshold for using the cache for Go dependencies and simplify initial configuration
- Simplify YAML pipelines because there will be no need for additional steps to enable caching
- More users will use cache for Go so more customers will have fast builds!
We don't pursue the goal to provide wide customization of caching in scope of `actions/setup-go` action. The purpose of this integration is covering ~90% of basic use-cases. If user needs flexible customization, we should advice them to use `actions/cache` directly.
# Decision
- Add `cache` input parameter to `actions/setup-go`. For now, input will accept the following values:
- `true` - enable caching for go dependencies
- `false`- disable caching for go dependencies. This value will be set as default value
- Cache feature will be disabled by default to make sure that we don't break existing customers. We will consider enabling cache by default in next major releases
- Action will try to search a go.sum files in the repository and throw error in the scenario that it was not found
- The hash of found file will be used as cache key (the same approach like [actions/cache](https://github.com/actions/cache/blob/main/examples.md#go---modules) recommends)
- The following key cache will be used `${{ runner.os }}-go${{ go-version }}-${{ hashFiles('<go.sum-path>') }}`
- Action will cache global cache from the `go env GOMODCACHE` and `go env GOCACHE` commands.
- Add a `cache-dependency-path` input parameter to `actions/setup-go`. The new input will accept an array or regex of dependency files. The field will accept a path (relative to the repository root) to dependency files. If the provided path contains wildcards, the action will search all matching files and calculate a common hash like the ${{ hashFiles('**/go.sum') }} YAML construction does.
# Example of real use-cases
- With cache
```yml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: '18'
cache: true
```
- With cache-dependency-path
```yml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: '18'
cache: true
cache-dependency-path: **/go.sum
```
```yml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: '18'
cache: true
cache-dependency-path: |
**/go.sum
**/go.mod
```
# Release process
As soon as functionality is implemented, we will release minor update of action. No need to bump major version since there are no breaking changes for existing users.
After that, we will update [starter-workflows](https://github.com/actions/starter-workflows/blob/main/ci/go.yml)