template / ci-testing / files / Makefile
Branch ci-testing · default branch · all branches
Makefile
| 1 | .PHONY: test |
| 2 | |
| 3 | all: build test lint install |
| 4 | |
| 5 | prep: |
| 6 | go mod tidy |
| 7 | |
| 8 | clean: |
| 9 | go clean |
| 10 | |
| 11 | build: prep |
| 12 | go build . |
| 13 | |
| 14 | lint: build |
| 15 | go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest |
| 16 | golangci-lint --version |
| 17 | golangci-lint run |
| 18 | |
| 19 | test: build |
| 20 | go test -v ./... -coverprofile="./test-coverage.out" |
| 21 | |
| 22 | test_coverage: test |
| 23 | go tool cover -html="./test-coverage.out" -o "./test-coverage.html" |
| 24 | |
| 25 | test_coverage_html: test_coverage |
| 26 | open "./test-coverage.html" |
| 27 | |
| 28 | install: build test lint |
| 29 | go install |
| 30 | template reset |
| 31 | |
| 32 | uninstall: |
| 33 | go clean -i gitlab.com/fuzzy-rp/template... |
| 34 | |
| 35 | release-dry-run: build test lint |
| 36 | go install github.com/goreleaser/goreleaser@latest |
| 37 | goreleaser release --snapshot --rm-dist |
| 38 | |
| 39 | release-local: build test lint |
| 40 | go install github.com/goreleaser/goreleaser@latest |
| 41 | goreleaser build --single-target |