mirror of
https://github.com/actions/setup-go.git
synced 2025-12-12 16:31:15 +00:00
Merge f354f7a36d into 4dc6199c7b
This commit is contained in:
commit
94c2561e6d
1 changed files with 21 additions and 0 deletions
21
README.md
21
README.md
|
|
@ -353,6 +353,7 @@ The `go-version` input supports the following syntax:
|
||||||
| Wildcard (minor) | `1.*` | Latest available version in the major version |
|
| Wildcard (minor) | `1.*` | Latest available version in the major version |
|
||||||
| Pre-release | `1.24.0-rc.1` | Beta/RC versions for testing upcoming releases |
|
| Pre-release | `1.24.0-rc.1` | Beta/RC versions for testing upcoming releases |
|
||||||
| Aliases | `stable`, `oldstable` | Latest stable or previous stable release |
|
| Aliases | `stable`, `oldstable` | Latest stable or previous stable release |
|
||||||
|
| Empty string | `''` | No version specified; relies on `go-version-file` when provided |
|
||||||
|
|
||||||
For more information about semantic versioning, see the [semver documentation](https://semver.org/).
|
For more information about semantic versioning, see the [semver documentation](https://semver.org/).
|
||||||
|
|
||||||
|
|
@ -383,6 +384,26 @@ For more information about semantic versioning, see the [semver documentation](h
|
||||||
architecture: 'x64'
|
architecture: 'x64'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Matrix Testing with go-version-file fallback
|
||||||
|
|
||||||
|
You can combine go-version with go-version-file in a matrix strategy to test across latest supported Go versions, and the minimal version specified in `go.mod` of your project.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go-version: ['stable', 'oldstable', ''] # empty string to fall back on go-version-file
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: actions/setup-go@v6
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go-version }}
|
||||||
|
go-version-file: "go.mod" # this one is only used when go-version is not specified.
|
||||||
|
- run: go test ./...
|
||||||
|
```
|
||||||
|
|
||||||
## Using setup-go on GHES
|
## Using setup-go on GHES
|
||||||
|
|
||||||
setup-go comes pre-installed on GHES when Actions is enabled. For dynamic Go version downloads, the action fetches distributions from the [go-versions repository](https://github.com/actions/go-versions/) on github.com (external to your appliance).
|
setup-go comes pre-installed on GHES when Actions is enabled. For dynamic Go version downloads, the action fetches distributions from the [go-versions repository](https://github.com/actions/go-versions/) on github.com (external to your appliance).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue