Skip to content

Commit 78dbb59

Browse files
committed
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>
1 parent 7e40071 commit 78dbb59

14 files changed

+47
-56
lines changed

.github/workflows/cross-darwin.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ jobs:
1919
if: "!contains(github.event.head_commit.message, '[ci skip]')"
2020

2121
steps:
22+
- name: Check out code into the Go module directory
23+
uses: actions/checkout@v3
2224

2325
- name: Set up Go
2426
uses: actions/setup-go@v3
2527
with:
26-
go-version: 1.19
28+
go-version-file: go.mod
2729
id: go
2830

29-
- name: Check out code into the Go module directory
30-
uses: actions/checkout@v3
31-
3231
- name: macOS build cmd
3332
env:
3433
GOOS: darwin

.github/workflows/cross-freebsd.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ jobs:
1919
if: "!contains(github.event.head_commit.message, '[ci skip]')"
2020

2121
steps:
22+
- name: Check out code into the Go module directory
23+
uses: actions/checkout@v3
2224

2325
- name: Set up Go
2426
uses: actions/setup-go@v3
2527
with:
26-
go-version: 1.19
28+
go-version-file: go.mod
2729
id: go
2830

29-
- name: Check out code into the Go module directory
30-
uses: actions/checkout@v3
31-
3231
- name: FreeBSD build cmd
3332
env:
3433
GOOS: freebsd

.github/workflows/cross-openbsd.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ jobs:
1919
if: "!contains(github.event.head_commit.message, '[ci skip]')"
2020

2121
steps:
22+
- name: Check out code into the Go module directory
23+
uses: actions/checkout@v3
2224

2325
- name: Set up Go
2426
uses: actions/setup-go@v3
2527
with:
26-
go-version: 1.19
28+
go-version-file: go.mod
2729
id: go
2830

29-
- name: Check out code into the Go module directory
30-
uses: actions/checkout@v3
31-
3231
- name: OpenBSD build cmd
3332
env:
3433
GOOS: openbsd

.github/workflows/cross-wasm.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ jobs:
1919
if: "!contains(github.event.head_commit.message, '[ci skip]')"
2020

2121
steps:
22+
- name: Check out code into the Go module directory
23+
uses: actions/checkout@v3
2224

2325
- name: Set up Go
2426
uses: actions/setup-go@v3
2527
with:
26-
go-version: 1.19
28+
go-version-file: go.mod
2729
id: go
2830

29-
- name: Check out code into the Go module directory
30-
uses: actions/checkout@v3
31-
3231
- name: Wasm client build
3332
env:
3433
GOOS: js

.github/workflows/cross-windows.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ jobs:
1919
if: "!contains(github.event.head_commit.message, '[ci skip]')"
2020

2121
steps:
22+
- name: Check out code into the Go module directory
23+
uses: actions/checkout@v3
2224

2325
- name: Set up Go
2426
uses: actions/setup-go@v3
2527
with:
26-
go-version: 1.19
28+
go-version-file: go.mod
2729
id: go
2830

29-
- name: Check out code into the Go module directory
30-
uses: actions/checkout@v3
31-
3231
- name: Windows build cmd
3332
env:
3433
GOOS: windows

.github/workflows/depaware.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
runs-on: ubuntu-latest
1818

1919
steps:
20+
- name: Check out code
21+
uses: actions/checkout@v3
22+
2023
- name: Set up Go
2124
uses: actions/setup-go@v3
2225
with:
23-
go-version: 1.19
24-
25-
- name: Check out code
26-
uses: actions/checkout@v3
26+
go-version-file: go.mod
2727

2828
- name: depaware
2929
run: go run github.com/tailscale/depaware --check

.github/workflows/go_generate.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
steps:
21-
- name: Set up Go
22-
uses: actions/setup-go@v3
23-
with:
24-
go-version: 1.19
25-
2621
- name: Check out code
2722
uses: actions/checkout@v3
2823
with:
2924
fetch-depth: 0
3025

26+
- name: Set up Go
27+
uses: actions/setup-go@v3
28+
with:
29+
go-version-file: go.mod
30+
3131
- name: check 'go generate' is clean
3232
run: |
3333
if [[ "${{github.ref}}" == release-branch/* ]]

.github/workflows/license.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
runs-on: ubuntu-latest
1818

1919
steps:
20+
- name: Check out code
21+
uses: actions/checkout@v3
22+
2023
- name: Set up Go
2124
uses: actions/setup-go@v3
2225
with:
23-
go-version: 1.19
24-
25-
- name: Check out code
26-
uses: actions/checkout@v3
26+
go-version-file: go.mod
2727

2828
- name: Run license checker
2929
run: ./scripts/check_license_headers.sh .

.github/workflows/linux-race.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ jobs:
1919
if: "!contains(github.event.head_commit.message, '[ci skip]')"
2020

2121
steps:
22+
- name: Check out code into the Go module directory
23+
uses: actions/checkout@v3
2224

2325
- name: Set up Go
2426
uses: actions/setup-go@v3
2527
with:
26-
go-version: 1.19
28+
go-version-file: go.mod
2729
id: go
2830

29-
- name: Check out code into the Go module directory
30-
uses: actions/checkout@v3
31-
3231
- name: Basic build
3332
run: go build ./cmd/...
3433

.github/workflows/linux.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ jobs:
1919
if: "!contains(github.event.head_commit.message, '[ci skip]')"
2020

2121
steps:
22+
- name: Check out code into the Go module directory
23+
uses: actions/checkout@v3
2224

2325
- name: Set up Go
2426
uses: actions/setup-go@v3
2527
with:
26-
go-version: 1.19
28+
go-version-file: go.mod
2729
id: go
2830

29-
- name: Check out code into the Go module directory
30-
uses: actions/checkout@v3
31-
3231
- name: Basic build
3332
run: go build ./cmd/...
3433

0 commit comments

Comments
 (0)