mirror of
https://github.com/hashicorp/setup-golang
synced 2026-04-05 19:06:15 +00:00
No description
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> |
||
|---|---|---|
| action.yaml | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| NOTICE.txt | ||
| README.md | ||
setup-golang (GitHub action)
A composite GitHub action for setting up Go compiler and module cache
- configures Go compiler using
actions/setup-go - configures Go modules cache using
actions/cache - configures GOBIN environment variable to be on
$PATH - compatible with
Linux,Darwin, andWindowsrunners
Inputs
version-file- Either.go-version(default) orgo.mod. Used to determine the version of Go compiler to configure.cache-key- Key used to share (or not share) module cache across later actions.
Environment
GOBIN- Sets$GOBINto a value on$PATH- currently uses
$(go env GOROOT)/bin
- currently uses
Cache Limit
Note that GitHub limits repositories to have up to 10GiB of caches. Once the limit is exceeded, older caches will be evicted on an LRU basis.
Usage
minimal example
This example uses the default values (uses .go-version for the Go version
and default as the cache key).
steps:
- uses: hashicorp/setup-golang@v1
This example uses custom values (uses go.mod for the Go version and
mykey as the cache key).
complete example
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-golang@v1
with:
version-file: go.mod
cache-key: mykey
Cross Platform
The cache automatically keys on operating system. The cache is not shared between Linux, Darwin, and Windows runners.