adguardhome-sync/Makefile

42 lines
782 B
Makefile
Raw Normal View History

2021-03-28 06:40:59 +08:00
# Run go fmt against code
fmt:
go fmt ./...
gofmt -s -w .
# Run go vet against code
vet:
go vet ./...
# Run golangci-lint
lint:
golangci-lint run
# Run go mod tidy
tidy:
go mod tidy
# Run tests
2021-04-11 17:56:55 +08:00
test: mocks tidy fmt vet
2021-03-28 06:40:59 +08:00
go test ./... -coverprofile=coverage.out
go tool cover -func=coverage.out
2021-03-28 22:42:12 +08:00
2021-04-11 17:56:55 +08:00
mocks: mockgen
mockgen -destination pkg/mocks/client/mock.go github.com/bakito/adguardhome-sync/pkg/client Client
2021-03-29 01:31:11 +08:00
release: semver
@version=$$(semver); \
2021-03-28 22:42:12 +08:00
git tag -s $$version -m"Release $$version"
goreleaser --rm-dist
test-release:
2021-03-29 01:31:11 +08:00
goreleaser --skip-publish --snapshot --rm-dist
semver:
ifeq (, $(shell which semver))
$(shell go get -u github.com/bakito/semver)
2021-04-11 17:56:55 +08:00
endif
mockgen:
ifeq (, $(shell which mockgen))
$(shell go get github.com/golang/mock/mockgen@v1.5)
2021-03-29 01:31:11 +08:00
endif