Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate lint steps in GitHub Actions #231

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 10 additions & 30 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,38 +163,18 @@ 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. DO NOT run separate
# modules as separate golangci-lint-action steps. Its post run caching
# can be extremely slow, and that's amplified in a very painful way if
# it needs to be run multiple times.
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
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ./...
Expand Down
Loading