CI: make all workflows get Go version from go.mod

The next time we update the toolchain, all of the CI
Actions will automatically use it when go.mod is updated.

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
This commit is contained in:
Denton Gentry 2022-08-30 04:41:08 -07:00 committed by Denton Gentry
parent 7e40071571
commit 78dbb59a00
14 changed files with 47 additions and 56 deletions

View File

@ -19,16 +19,15 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')" if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps: steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version-file: go.mod
id: go id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: macOS build cmd - name: macOS build cmd
env: env:
GOOS: darwin GOOS: darwin

View File

@ -19,16 +19,15 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')" if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps: steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version-file: go.mod
id: go id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: FreeBSD build cmd - name: FreeBSD build cmd
env: env:
GOOS: freebsd GOOS: freebsd

View File

@ -19,16 +19,15 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')" if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps: steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version-file: go.mod
id: go id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: OpenBSD build cmd - name: OpenBSD build cmd
env: env:
GOOS: openbsd GOOS: openbsd

View File

@ -19,16 +19,15 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')" if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps: steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version-file: go.mod
id: go id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Wasm client build - name: Wasm client build
env: env:
GOOS: js GOOS: js

View File

@ -19,16 +19,15 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')" if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps: steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version-file: go.mod
id: go id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Windows build cmd - name: Windows build cmd
env: env:
GOOS: windows GOOS: windows

View File

@ -17,13 +17,13 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version-file: go.mod
- name: Check out code
uses: actions/checkout@v3
- name: depaware - name: depaware
run: go run github.com/tailscale/depaware --check run: go run github.com/tailscale/depaware --check

View File

@ -18,16 +18,16 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Check out code - name: Check out code
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: check 'go generate' is clean - name: check 'go generate' is clean
run: | run: |
if [[ "${{github.ref}}" == release-branch/* ]] if [[ "${{github.ref}}" == release-branch/* ]]

View File

@ -17,13 +17,13 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version-file: go.mod
- name: Check out code
uses: actions/checkout@v3
- name: Run license checker - name: Run license checker
run: ./scripts/check_license_headers.sh . run: ./scripts/check_license_headers.sh .

View File

@ -19,16 +19,15 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')" if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps: steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version-file: go.mod
id: go id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Basic build - name: Basic build
run: go build ./cmd/... run: go build ./cmd/...

View File

@ -19,16 +19,15 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')" if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps: steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version-file: go.mod
id: go id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Basic build - name: Basic build
run: go build ./cmd/... run: go build ./cmd/...

View File

@ -19,16 +19,15 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')" if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps: steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version-file: go.mod
id: go id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Basic build - name: Basic build
run: GOARCH=386 go build ./cmd/... run: GOARCH=386 go build ./cmd/...

View File

@ -16,12 +16,12 @@ jobs:
gofmt: gofmt:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version-file: go.mod
- name: Check out code
uses: actions/checkout@v3
- name: Run gofmt (goimports) - name: Run gofmt (goimports)
run: go run golang.org/x/tools/cmd/goimports -d --format-only . run: go run golang.org/x/tools/cmd/goimports -d --format-only .
- uses: k0kubun/action-slack@v2.0.0 - uses: k0kubun/action-slack@v2.0.0

View File

@ -19,13 +19,13 @@ jobs:
- name: Set GOPATH - name: Set GOPATH
run: echo "GOPATH=$HOME/go" >> $GITHUB_ENV run: echo "GOPATH=$HOME/go" >> $GITHUB_ENV
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version-file: go.mod
- name: Checkout Code
uses: actions/checkout@v3
- name: Run VM tests - name: Run VM tests
run: go test ./tstest/integration/vms -v -no-s3 -run-vm-tests -run=TestRunUbuntu2004 run: go test ./tstest/integration/vms -v -no-s3 -run-vm-tests -run=TestRunUbuntu2004

View File

@ -19,14 +19,13 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')" if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps: steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go - name: Install Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19.x go-version-file: go.mod
- name: Checkout code
uses: actions/checkout@v3
- name: Restore Cache - name: Restore Cache
uses: actions/cache@v3 uses: actions/cache@v3