From c76719de85ced7e9d88f772f641f4dffc304c6d9 Mon Sep 17 00:00:00 2001 From: Andrew Benton Date: Mon, 13 Nov 2023 15:29:26 -0800 Subject: [PATCH 1/2] feat(ci): Rely on go.mod to determine which Go version to use --- .github/workflows/ci.yml | 12 ++++++++---- .github/workflows/gen.yml | 3 ++- go.mod | 17 +++++++---------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef8a6c202c..33107902f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: '1.21.4' + go-version-file: go.mod + cache-dependency-path: go.sum - run: go build ./... darwin-build: @@ -22,7 +23,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: '1.21.4' + go-version-file: go.mod + cache-dependency-path: go.sum - run: go build ./... build: @@ -43,7 +45,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: '1.21.4' + go-version-file: go.mod + cache-dependency-path: go.sum - name: install gotestsum run: go install gotest.tools/gotestsum@latest @@ -77,6 +80,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: '1.21.4' + go-version-file: go.mod + cache-dependency-path: go.sum - run: go install golang.org/x/vuln/cmd/govulncheck@latest - run: govulncheck ./... diff --git a/.github/workflows/gen.yml b/.github/workflows/gen.yml index bf9200f4a2..c5195ab483 100644 --- a/.github/workflows/gen.yml +++ b/.github/workflows/gen.yml @@ -20,7 +20,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: '1.21.4' + go-version-file: go.mod + cache-dependency-path: go.sum - run: go build -o sqlc-pg-gen ./internal/tools/sqlc-pg-gen - run: mkdir -p gen/contrib - run: ./sqlc-pg-gen gen diff --git a/go.mod b/go.mod index 3f69503bf4..fa2da759e6 100644 --- a/go.mod +++ b/go.mod @@ -29,31 +29,26 @@ require ( require ( github.com/antlr4-go/antlr/v4 v4.13.0 // indirect - github.com/jackc/pgconn v1.14.1 // indirect - github.com/jackc/puddle/v2 v2.2.1 // indirect - github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c // indirect - github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect - github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect -) - -require ( github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect github.com/fatih/structtag v1.2.0 github.com/golang/protobuf v1.5.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect + github.com/jackc/pgconn v1.14.1 // indirect github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgproto3/v2 v2.3.2 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/pgtype v1.14.0 // indirect + github.com/jackc/puddle/v2 v2.2.1 // indirect github.com/pingcap/errors v0.11.5-0.20210425183316-da1aaba5fb63 // indirect + github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c // indirect github.com/pingcap/log v1.1.0 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/stoewer/go-strcase v1.2.0 // indirect + github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect + github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect @@ -62,5 +57,7 @@ require ( golang.org/x/net v0.17.0 // indirect golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) From dff2e4c3551ed2b6960609c09804821939a18582 Mon Sep 17 00:00:00 2001 From: Andrew Benton Date: Mon, 13 Nov 2023 15:41:24 -0800 Subject: [PATCH 2/2] try checking for latest --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/gen.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33107902f8..ec4b44a008 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version-file: go.mod - cache-dependency-path: go.sum + check-latest: true - run: go build ./... darwin-build: @@ -24,7 +24,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version-file: go.mod - cache-dependency-path: go.sum + check-latest: true - run: go build ./... build: @@ -46,7 +46,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version-file: go.mod - cache-dependency-path: go.sum + check-latest: true - name: install gotestsum run: go install gotest.tools/gotestsum@latest @@ -81,6 +81,6 @@ jobs: - uses: actions/setup-go@v4 with: go-version-file: go.mod - cache-dependency-path: go.sum + check-latest: true - run: go install golang.org/x/vuln/cmd/govulncheck@latest - run: govulncheck ./... diff --git a/.github/workflows/gen.yml b/.github/workflows/gen.yml index c5195ab483..e553c2e563 100644 --- a/.github/workflows/gen.yml +++ b/.github/workflows/gen.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version-file: go.mod - cache-dependency-path: go.sum + check-latest: true - run: go build -o sqlc-pg-gen ./internal/tools/sqlc-pg-gen - run: mkdir -p gen/contrib - run: ./sqlc-pg-gen gen