Skip to content
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
33 changes: 4 additions & 29 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,46 +57,21 @@ jobs:
- name: Publish test coverage
uses: codecov/codecov-action@v4

fmt:
golangci:
name: lint
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.23.2

# No need to download cached dependencies when running gofmt.
cache: false

- name: Install goimports
run: |
go install golang.org/x/tools/cmd/goimports@latest

- name: Run make fmt
run: |
make fmt

- name: Run go mod tidy
run: |
go mod tidy

- name: Fail on differences
run: |
# Exit with status code 1 if there are differences (i.e. unformatted files)
git diff --exit-code

golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.23.2
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
Expand Down
8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
default: build

fmt:
@echo "✓ Formatting source code with goimports ..."
@goimports -w $(shell find . -type f -name '*.go' -not -path "./vendor/*")
@echo "✓ Formatting source code with gofmt ..."
@gofmt -w $(shell find . -type f -name '*.go' -not -path "./vendor/*")

lint: vendor
@echo "✓ Linting source code with https://golangci-lint.run/ (with --fix)..."
@golangci-lint run --fix ./...
Expand Down Expand Up @@ -39,4 +33,4 @@ vendor:
integration:
gotestsum --format github-actions --rerun-fails --jsonfile output.json --packages "./integration/..." -- -parallel 4 -timeout=2h

.PHONY: fmt lint lintcheck test testonly coverage build snapshot vendor integration
.PHONY: lint lintcheck test testonly coverage build snapshot vendor integration
Loading