Skip to content

Commit

Permalink
fix and cleanup a few workflows, use latest version of sqlc (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
capnspacehook authored Aug 11, 2023
1 parent 36cb2b7 commit 71832c8
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 24 deletions.
File renamed without changes.
5 changes: 1 addition & 4 deletions .github/workflows/check-generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/lint-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -67,16 +67,14 @@ jobs:
golangci-lint:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
pull-requests: read
steps:
- name: Checkout code
uses: actions/checkout@v3

- 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
Expand All @@ -87,5 +85,3 @@ jobs:

- name: Lint with golangci-lint
uses: golangci/[email protected]
with:
only-new-issues: true
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/vuln.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./...
2 changes: 1 addition & 1 deletion database/db.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion database/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion database/querier.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion database/query.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion db.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/capnspacehook/whalewall/database"
)

//go:generate sqlc generate
//go:generate go run github.com/sqlc-dev/sqlc/cmd/[email protected] generate

func (r *RuleManager) containerExists(ctx context.Context, db database.Querier, id string) (bool, error) {
exists, err := db.ContainerExists(ctx, id)
Expand Down

0 comments on commit 71832c8

Please sign in to comment.