Skip to content

Commit

Permalink
Print status and reorder make targets.
Browse files Browse the repository at this point in the history
  • Loading branch information
winder committed Jul 30, 2024
1 parent 363b12e commit 14b28e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Display Go version
run: go version
- name: Generate mocks
run: go generate ./...
run: make generate
- name: ensure no changes
run: |
[ -z git status --porcelain=v1 ] || echo "Modified files detected" && exit 1
[ -z git status --porcelain=v1 ] || echo "Modified files detected, run 'make generate'" && git status && exit 1
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
TEST_COUNT ?= 10
COVERAGE_FILE ?= coverage.out

build:
build: ensure_go_version
go build -v ./...

ensure_go_version:
@go version | grep -q 'go1.21' || (echo "Please use go1.21" && exit 1)

ensure_golangcilint_1_59:
@golangci-lint --version | grep -q '1.59' || (echo "Please use golangci-lint 1.59" && exit 1)
generate: ensure_go_version
go generate ./...

test: ensure_go_version
go test -race -fullpath -shuffle on -count $(TEST_COUNT) -coverprofile=$(COVERAGE_FILE) ./...

lint: ensure_go_version
golangci-lint run -c .golangci.yml

ensure_go_version:
@go version | grep -q 'go1.21' || (echo "Please use go1.21" && exit 1)

ensure_golangcilint_1_59:
@golangci-lint --version | grep -q '1.59' || (echo "Please use golangci-lint 1.59" && exit 1)

0 comments on commit 14b28e7

Please sign in to comment.