diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 25bd5f4d6..f7c4d5456 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -55,7 +55,7 @@ jobs: pip3 install wheel - name: Run tests - run: make testonly + run: make test golangci: name: lint diff --git a/Makefile b/Makefile index 7dca3b2cf..2e7e34299 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,24 @@ default: build -lint: vendor +PACKAGES=./libs/... ./internal/... ./cmd/... ./bundle/... . + +lint: @echo "✓ Linting source code with https://golangci-lint.run/ (with --fix)..." @./lint.sh ./... -lintcheck: vendor +lintcheck: @echo "✓ Linting source code with https://golangci-lint.run/ ..." @golangci-lint run ./... -test: lint testonly - -testonly: +test: @echo "✓ Running tests ..." - @gotestsum --format pkgname-and-test-fails --no-summary=skipped --raw-command go test -v -json -short -coverprofile=coverage.txt ./... + @gotestsum --format pkgname-and-test-fails --no-summary=skipped -- ${PACKAGES} -coverage: test +cover: + @echo "✓ Running tests with coverage..." + @gotestsum --format pkgname-and-test-fails --no-summary=skipped -- -coverprofile=coverage.txt ${PACKAGES} + +showcover: @echo "✓ Opening coverage for unit tests ..." @go tool cover -html=coverage.txt @@ -42,4 +46,4 @@ integration: integration-short: $(INTEGRATION) -short -.PHONY: lint lintcheck test testonly coverage build snapshot vendor schema integration integration-short +.PHONY: lint lintcheck test cover showcover build snapshot vendor schema integration integration-short