From 262e60d66ecfaa85ded2fa31d93a050eb7db03b3 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Tue, 19 Dec 2023 21:48:14 +0000 Subject: [PATCH 1/3] ci: make test-go-pg depend on sqlc-vet --- .github/workflows/ci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f2c070b70ab8f..920a75fd9ea06 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -322,7 +322,9 @@ jobs: test-go-pg: runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} - needs: changes + needs: + - changes + - sqlc-vet # No point in testing the DB if the queries are invalid if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' # This timeout must be greater than the timeout set by `go test` in # `make test-postgres` to ensure we receive a trace of running From 4bdbf05fb53a9c7342dc575f0af260f95fc82c74 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Tue, 19 Dec 2023 21:51:57 +0000 Subject: [PATCH 2/3] fixup! ci: make test-go-pg depend on sqlc-vet --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 920a75fd9ea06..6a6a452e5767f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -323,8 +323,8 @@ jobs: test-go-pg: runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} needs: - - changes - - sqlc-vet # No point in testing the DB if the queries are invalid + - changes + - sqlc-vet # No point in testing the DB if the queries are invalid if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' # This timeout must be greater than the timeout set by `go test` in # `make test-postgres` to ensure we receive a trace of running From 8fcdd83789cce17c80ec61f0b0a3406e1bc801ce Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Tue, 19 Dec 2023 21:56:50 +0000 Subject: [PATCH 3/3] run sqlc-vet if ci changes --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6a6a452e5767f..add1d38dee599 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -898,7 +898,7 @@ jobs: sqlc-vet: runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} needs: changes - if: needs.changes.outputs.db == 'true' || github.ref == 'refs/heads/main' + if: needs.changes.outputs.db == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' steps: - name: Checkout uses: actions/checkout@v4