This commit is contained in:
Rui Chen 2023-09-19 20:40:33 +00:00 committed by GitHub
commit b993ea40de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 19 deletions

View File

@ -17,7 +17,7 @@ jobs:
strategy: strategy:
matrix: matrix:
cache: [false, true] cache: [false, true]
go: [1.20.1] go: [1.21.0]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@ -42,7 +42,7 @@ Matching by [semver spec](https://github.com/npm/node-semver):
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '^1.13.1' # The Go version to download (if necessary) and use. go-version: '^1.13.1' # The Go version to download (if necessary) and use.
@ -51,7 +51,7 @@ steps:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '>=1.17.0' go-version: '>=1.17.0'
@ -59,17 +59,17 @@ steps:
``` ```
> **Note**: Due to the peculiarities of YAML parsing, it is recommended to wrap the version in single quotation marks: > **Note**: Due to the peculiarities of YAML parsing, it is recommended to wrap the version in single quotation marks:
> >
> ```yaml > ```yaml
> go-version: '1.20' > go-version: '1.21'
> ``` > ```
> >
> The recommendation is based on the YAML parser's behavior, which interprets non-wrapped values as numbers and, in the case of version 1.20, trims it down to 1.2, which may not be very obvious. > The recommendation is based on the YAML parser's behavior, which interprets non-wrapped values as numbers and, in the case of version 1.21, trims it down to 1.2, which may not be very obvious.
Matching an unstable pre-release: Matching an unstable pre-release:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '1.18.0-rc.1' # The Go version to download (if necessary) and use. go-version: '1.18.0-rc.1' # The Go version to download (if necessary) and use.
@ -78,7 +78,7 @@ steps:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '1.16.0-beta.1' # The Go version to download (if necessary) and use. go-version: '1.16.0-beta.1' # The Go version to download (if necessary) and use.
@ -93,7 +93,7 @@ See [action.yml](action.yml)
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '1.16.1' # The Go version to download (if necessary) and use. go-version: '1.16.1' # The Go version to download (if necessary) and use.
@ -114,7 +114,7 @@ want the most up-to-date Go version to always be used.
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '1.14' go-version: '1.14'
@ -135,7 +135,7 @@ set to `true`
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: 'stable' go-version: 'stable'
@ -144,7 +144,7 @@ steps:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: 'oldstable' go-version: 'oldstable'
@ -161,20 +161,20 @@ The action defaults to search for the dependency file - go.sum in the repository
the cache key. Use `cache-dependency-path` input for cases when multiple dependency files are used, or they are located the cache key. Use `cache-dependency-path` input for cases when multiple dependency files are used, or they are located
in different subdirectories. The input supports glob patterns. in different subdirectories. The input supports glob patterns.
If some problem that prevents success caching happens then the action issues the warning in the log and continues the execution of the pipeline. If some problem that prevents success caching happens then the action issues the warning in the log and continues the execution of the pipeline.
**Caching in monorepos** **Caching in monorepos**
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '1.17' go-version: '1.17'
check-latest: true check-latest: true
cache-dependency-path: | cache-dependency-path: |
subdir/go.sum subdir/go.sum
tools/go.sum tools/go.sum
# cache-dependency-path: "**/*.sum" # cache-dependency-path: "**/*.sum"
- run: go run hello.go - run: go run hello.go
@ -193,7 +193,7 @@ If both the `go-version` and the `go-version-file` inputs are provided then the
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version-file: 'path/to/go.mod' go-version-file: 'path/to/go.mod'
@ -211,7 +211,7 @@ jobs:
go: [ '1.14', '1.13' ] go: [ '1.14', '1.13' ]
name: Go ${{ matrix.go }} sample name: Go ${{ matrix.go }} sample
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- name: Setup go - name: Setup go
uses: actions/setup-go@v4 uses: actions/setup-go@v4
with: with: