Skip to content

Commit e120ef2

Browse files
feat(ci): Rely on go.mod to determine which Go version to use (#2971)
* feat(ci): Rely on go.mod to determine which Go version to use * try checking for latest
1 parent 41d7165 commit e120ef2

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ jobs:
1212
- uses: actions/checkout@v4
1313
- uses: actions/setup-go@v4
1414
with:
15-
go-version: '1.21.4'
15+
go-version-file: go.mod
16+
check-latest: true
1617
- run: go build ./...
1718

1819
darwin-build:
@@ -22,7 +23,8 @@ jobs:
2223
- uses: actions/checkout@v4
2324
- uses: actions/setup-go@v4
2425
with:
25-
go-version: '1.21.4'
26+
go-version-file: go.mod
27+
check-latest: true
2628
- run: go build ./...
2729

2830
build:
@@ -43,7 +45,8 @@ jobs:
4345
- uses: actions/checkout@v4
4446
- uses: actions/setup-go@v4
4547
with:
46-
go-version: '1.21.4'
48+
go-version-file: go.mod
49+
check-latest: true
4750

4851
- name: install gotestsum
4952
run: go install gotest.tools/gotestsum@latest
@@ -77,6 +80,7 @@ jobs:
7780
- uses: actions/checkout@v4
7881
- uses: actions/setup-go@v4
7982
with:
80-
go-version: '1.21.4'
83+
go-version-file: go.mod
84+
check-latest: true
8185
- run: go install golang.org/x/vuln/cmd/govulncheck@latest
8286
- run: govulncheck ./...

.github/workflows/gen.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ jobs:
2020
- uses: actions/checkout@v4
2121
- uses: actions/setup-go@v4
2222
with:
23-
go-version: '1.21.4'
23+
go-version-file: go.mod
24+
check-latest: true
2425
- run: go build -o sqlc-pg-gen ./internal/tools/sqlc-pg-gen
2526
- run: mkdir -p gen/contrib
2627
- run: ./sqlc-pg-gen gen

go.mod

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,26 @@ require (
2929

3030
require (
3131
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
32-
github.com/jackc/pgconn v1.14.1 // indirect
33-
github.com/jackc/puddle/v2 v2.2.1 // indirect
34-
github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c // indirect
35-
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
36-
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
37-
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
38-
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
39-
)
40-
41-
require (
4232
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
4333
github.com/fatih/structtag v1.2.0
4434
github.com/golang/protobuf v1.5.3 // indirect
4535
github.com/inconshreveable/mousetrap v1.1.0 // indirect
4636
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
37+
github.com/jackc/pgconn v1.14.1 // indirect
4738
github.com/jackc/pgio v1.0.0 // indirect
4839
github.com/jackc/pgpassfile v1.0.0 // indirect
4940
github.com/jackc/pgproto3/v2 v2.3.2 // indirect
5041
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
5142
github.com/jackc/pgtype v1.14.0 // indirect
43+
github.com/jackc/puddle/v2 v2.2.1 // indirect
5244
github.com/pingcap/errors v0.11.5-0.20210425183316-da1aaba5fb63 // indirect
45+
github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c // indirect
5346
github.com/pingcap/log v1.1.0 // indirect
5447
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
5548
github.com/rogpeppe/go-internal v1.10.0 // indirect
5649
github.com/stoewer/go-strcase v1.2.0 // indirect
50+
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
51+
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
5752
go.uber.org/atomic v1.11.0 // indirect
5853
go.uber.org/multierr v1.11.0 // indirect
5954
go.uber.org/zap v1.26.0 // indirect
@@ -62,5 +57,7 @@ require (
6257
golang.org/x/net v0.17.0 // indirect
6358
golang.org/x/sys v0.13.0 // indirect
6459
golang.org/x/text v0.14.0 // indirect
60+
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
61+
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
6562
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
6663
)

0 commit comments

Comments
 (0)