From 71832c8dd9225b2cf054e52be2600b7b1461132e Mon Sep 17 00:00:00 2001 From: Andrew LeFevre Date: Fri, 11 Aug 2023 19:53:40 -0400 Subject: [PATCH] fix and cleanup a few workflows, use latest version of sqlc (#128) --- .github/{workflows => }/constants.env | 0 .github/workflows/check-generated.yml | 5 +---- .github/workflows/lint-actions.yml | 2 +- .github/workflows/lint-go.yml | 10 +++------- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 6 +++--- .github/workflows/vuln.yml | 5 ++--- database/db.go | 2 +- database/models.go | 2 +- database/querier.go | 2 +- database/query.sql.go | 2 +- db.go | 2 +- 12 files changed, 16 insertions(+), 24 deletions(-) rename .github/{workflows => }/constants.env (100%) diff --git a/.github/workflows/constants.env b/.github/constants.env similarity index 100% rename from .github/workflows/constants.env rename to .github/constants.env diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index 420c17f..de9e336 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -23,7 +23,7 @@ jobs: - name: Export constant environmental variables uses: cardinalby/export-env-action@v2 with: - envFile: .github/workflows/constants.env + envFile: .github/constants.env - name: Install Go uses: actions/setup-go@v4 @@ -32,9 +32,6 @@ jobs: check-latest: true cache: true - - run: | - go install github.com/kyleconroy/sqlc/cmd/sqlc@latest - - name: Ensure 'go generate' is clean run: | # shellcheck disable=SC2046 diff --git a/.github/workflows/lint-actions.yml b/.github/workflows/lint-actions.yml index 76ab026..646327a 100644 --- a/.github/workflows/lint-actions.yml +++ b/.github/workflows/lint-actions.yml @@ -18,7 +18,7 @@ jobs: - name: Export constant environmental variables uses: cardinalby/export-env-action@v2 with: - envFile: .github/workflows/constants.env + envFile: .github/constants.env - name: Install Go uses: actions/setup-go@v4 diff --git a/.github/workflows/lint-go.yml b/.github/workflows/lint-go.yml index c7558b4..1dd6cb9 100644 --- a/.github/workflows/lint-go.yml +++ b/.github/workflows/lint-go.yml @@ -21,7 +21,7 @@ jobs: - name: Export constant environmental variables uses: cardinalby/export-env-action@v2 with: - envFile: .github/workflows/constants.env + envFile: .github/constants.env - name: Install Go uses: actions/setup-go@v4 @@ -50,7 +50,7 @@ jobs: - name: Export constant environmental variables uses: cardinalby/export-env-action@v2 with: - envFile: .github/workflows/constants.env + envFile: .github/constants.env - name: Install Go uses: actions/setup-go@v4 @@ -67,8 +67,6 @@ jobs: golangci-lint: runs-on: ubuntu-latest timeout-minutes: 15 - permissions: - pull-requests: read steps: - name: Checkout code uses: actions/checkout@v3 @@ -76,7 +74,7 @@ jobs: - name: Export constant environmental variables uses: cardinalby/export-env-action@v2 with: - envFile: .github/workflows/constants.env + envFile: .github/constants.env - name: Install Go uses: actions/setup-go@v4 @@ -87,5 +85,3 @@ jobs: - name: Lint with golangci-lint uses: golangci/golangci-lint-action@v3.6.0 - with: - only-new-issues: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba8084d..6d000c0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: - name: Export constant environmental variables uses: cardinalby/export-env-action@v2 with: - envFile: .github/workflows/constants.env + envFile: .github/constants.env - name: Checkout tags run: git fetch --force --tags diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c58cc3c..692d9b5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: - name: Export constant environmental variables uses: cardinalby/export-env-action@v2 with: - envFile: .github/workflows/constants.env + envFile: .github/constants.env - name: Install Go uses: actions/setup-go@v4 @@ -47,7 +47,7 @@ jobs: - name: Export constant environmental variables uses: cardinalby/export-env-action@v2 with: - envFile: .github/workflows/constants.env + envFile: .github/constants.env - name: Install Go uses: actions/setup-go@v4 @@ -75,7 +75,7 @@ jobs: - name: Export constant environmental variables uses: cardinalby/export-env-action@v2 with: - envFile: .github/workflows/constants.env + envFile: .github/constants.env - name: Install Docker buildx uses: docker/setup-buildx-action@v2 diff --git a/.github/workflows/vuln.yml b/.github/workflows/vuln.yml index cc571f5..decb71d 100644 --- a/.github/workflows/vuln.yml +++ b/.github/workflows/vuln.yml @@ -23,16 +23,15 @@ jobs: - name: Export constant environmental variables uses: cardinalby/export-env-action@v2 with: - envFile: .github/workflows/constants.env + envFile: .github/constants.env - name: Install Go uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }}.x check-latest: true - cache: true - name: Scan for known vulnerable dependencies run: | go install golang.org/x/vuln/cmd/govulncheck@latest - govulncheck -v ./... + govulncheck ./... diff --git a/database/db.go b/database/db.go index 5dc8500..35a04a7 100644 --- a/database/db.go +++ b/database/db.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.18.0 +// sqlc v1.20.0 package database diff --git a/database/models.go b/database/models.go index 9743bb7..7dea524 100644 --- a/database/models.go +++ b/database/models.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.18.0 +// sqlc v1.20.0 package database diff --git a/database/querier.go b/database/querier.go index f1eb615..5b387db 100644 --- a/database/querier.go +++ b/database/querier.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.18.0 +// sqlc v1.20.0 package database diff --git a/database/query.sql.go b/database/query.sql.go index 9fcaa4d..ca1ff4c 100644 --- a/database/query.sql.go +++ b/database/query.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.18.0 +// sqlc v1.20.0 // source: query.sql package database diff --git a/db.go b/db.go index c9482f2..17f8fd2 100644 --- a/db.go +++ b/db.go @@ -7,7 +7,7 @@ import ( "github.com/capnspacehook/whalewall/database" ) -//go:generate sqlc generate +//go:generate go run github.com/sqlc-dev/sqlc/cmd/sqlc@v1.20.0 generate func (r *RuleManager) containerExists(ctx context.Context, db database.Querier, id string) (bool, error) { exists, err := db.ContainerExists(ctx, id)