diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 068d76b8..dac7ce82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -163,38 +163,15 @@ jobs: - name: Lint uses: golangci/golangci-lint-action@v4 with: + # golangci-lint needs to be run separately for every Go module, and + # its GitHub Action doesn't provide any way to do that. Have it fetch + # the golangci-lint binary, trick it into not running by sending only + # `--help`, then run the full set of lints below. + args: --help version: ${{ env.GOLANGCI_LINT_VERSION }} - working-directory: . - - name: Lint cmd/river - uses: golangci/golangci-lint-action@v4 - with: - version: ${{ env.GOLANGCI_LINT_VERSION }} - working-directory: ./cmd/river - - - name: Lint riverdriver - uses: golangci/golangci-lint-action@v4 - with: - version: ${{ env.GOLANGCI_LINT_VERSION }} - working-directory: ./riverdriver - - - name: Lint riverdriver/riverdatabasesql - uses: golangci/golangci-lint-action@v4 - with: - version: ${{ env.GOLANGCI_LINT_VERSION }} - working-directory: ./riverdriver/riverdatabasesql - - - name: Lint riverdriver/riverpgxv5 - uses: golangci/golangci-lint-action@v4 - with: - version: ${{ env.GOLANGCI_LINT_VERSION }} - working-directory: ./riverdriver/riverpgxv5 - - - name: Lint rivertype - uses: golangci/golangci-lint-action@v3 - with: - version: ${{ env.GOLANGCI_LINT_VERSION }} - working-directory: ./rivertype + - name: Run lint + run: make lint producer_sample: runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 99b05391..2dbbe517 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ generate/sqlc: .PHONY: lint lint: cd . && golangci-lint run --fix - # cd cmd/river && golangci-lint run --fix + cd cmd/river && golangci-lint run --fix cd riverdriver && golangci-lint run --fix cd riverdriver/riverdatabasesql && golangci-lint run --fix cd riverdriver/riverpgxv5 && golangci-lint run --fix @@ -19,7 +19,7 @@ lint: .PHONY: test test: cd . && go test ./... -p 1 - # cd cmd/river && go test ./... + cd cmd/river && go test ./... cd riverdriver && go test ./... cd riverdriver/riverdatabasesql && go test ./... cd riverdriver/riverpgxv5 && go test ./...