all: start suggesting Go 1.21 and testing on it

Also note that the first release is now 1.21.0,
so we no longer need to use the awkward 1.21.x notation in warnings.
pull/800/head
Daniel Martí 10 months ago committed by lu4p
parent 344cdd5e7b
commit 716322cdf8

@ -25,7 +25,7 @@ jobs:
test: test:
strategy: strategy:
matrix: matrix:
go-version: [1.20.x] go-version: [1.20.x, 1.21.x]
os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
@ -53,17 +53,17 @@ jobs:
# Static checks from this point forward. Only run on one Go version and on # Static checks from this point forward. Only run on one Go version and on
# linux, since it's the fastest platform, and the tools behave the same. # linux, since it's the fastest platform, and the tools behave the same.
- name: Test third-party project builds - name: Test third-party project builds
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.20.x' if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x'
run: | run: |
go install go install
./scripts/check-third-party.sh ./scripts/check-third-party.sh
- if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.20.x' - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x'
run: ./scripts/crlf-test.sh run: ./scripts/crlf-test.sh
- if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.20.x' - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x'
run: diff <(echo -n) <(gofmt -d .) run: diff <(echo -n) <(gofmt -d .)
- if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.20.x' - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x'
run: go vet ./... run: go vet ./...
- if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.20.x' - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x'
uses: dominikh/staticcheck-action@v1 uses: dominikh/staticcheck-action@v1
with: with:
version: "2023.1.3" version: "2023.1.3"
@ -81,11 +81,12 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: 1.20.x go-version: 1.21.x
cache: false cache: false
- run: go test -short ./... - run: go test -short ./...
test-gotip: test-gotip:
if: false # let tip for 1.22 settle first
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

@ -268,7 +268,7 @@ func (e errJustExit) Error() string { return fmt.Sprintf("exit: %d", e) }
func goVersionOK() bool { func goVersionOK() bool {
const ( const (
minGoVersionSemver = "v1.20.0" minGoVersionSemver = "v1.20.0"
suggestedGoVersion = "1.20.x" suggestedGoVersion = "1.21"
) )
// rxVersion looks for a version like "go1.2" or "go1.2.3" // rxVersion looks for a version like "go1.2" or "go1.2.3"

@ -7,30 +7,30 @@ env PATH=${WORK}/.bin${:}${PATH}
# An empty go version. # An empty go version.
env TOOLCHAIN_GOVERSION='' env TOOLCHAIN_GOVERSION=''
! exec garble build ! exec garble build
stderr 'Go version is too old; please upgrade to Go 1\.20\.x or newer' stderr 'Go version is too old; please upgrade to Go 1\.21 or newer'
# We should error on a devel version that's too old. # We should error on a devel version that's too old.
# Note that they lacked the "goN.M-" prefix. # Note that they lacked the "goN.M-" prefix.
env TOOLCHAIN_GOVERSION='devel +afb5fca Sun Aug 07 00:00:00 2020 +0000' env TOOLCHAIN_GOVERSION='devel +afb5fca Sun Aug 07 00:00:00 2020 +0000'
! exec garble build ! exec garble build
stderr 'Go version is too old; please upgrade to Go 1\.20\.x or newer' stderr 'Go version is too old; please upgrade to Go 1\.21 or newer'
# Another form of old version; with an old "goN.M-" prefix. # Another form of old version; with an old "goN.M-" prefix.
env TOOLCHAIN_GOVERSION='devel go1.15-afb5fca Sun Aug 07 00:00:00 2020 +0000' env TOOLCHAIN_GOVERSION='devel go1.15-afb5fca Sun Aug 07 00:00:00 2020 +0000'
! exec garble build ! exec garble build
stderr 'Go version "devel go1\.15-.*2020.*" is too old; please upgrade to Go 1\.20\.x' stderr 'Go version "devel go1\.15-.*2020.*" is too old; please upgrade to Go 1\.21'
# A current devel version should be fine. # A current devel version should be fine.
# Note that we don't look at devel version timestamps. # Note that we don't look at devel version timestamps.
env GARBLE_TEST_GOVERSION='go1.20' env GARBLE_TEST_GOVERSION='go1.21'
env TOOLCHAIN_GOVERSION='devel go1.20-ad97d204f0 Sun Sep 12 16:46:58 2023 +0000' env TOOLCHAIN_GOVERSION='devel go1.21-ad97d204f0 Sun Sep 12 16:46:58 2023 +0000'
! exec garble build ! exec garble build
stderr 'mocking the real build' stderr 'mocking the real build'
# We should error on a stable version that's too old. # We should error on a stable version that's too old.
env TOOLCHAIN_GOVERSION='go1.14' env TOOLCHAIN_GOVERSION='go1.14'
! exec garble build ! exec garble build
stderr 'Go version "go1\.14" is too old; please upgrade to Go 1\.20\.x or newer' stderr 'Go version "go1\.14" is too old; please upgrade to Go 1\.21 or newer'
# We should accept a future stable version. # We should accept a future stable version.
# Note that we need to bump the version of Go that supposedly built it, too. # Note that we need to bump the version of Go that supposedly built it, too.

Loading…
Cancel
Save