adguardhome-sync/Makefile

36 lines
745 B
Makefile
Raw Normal View History

2021-03-28 06:40:59 +08:00
# Run go fmt against code
fmt:
2021-11-30 05:25:01 +08:00
golangci-lint run --fix
2021-03-28 06:40:59 +08:00
# Run go mod tidy
tidy:
go mod tidy
# Run tests
2021-11-30 05:25:01 +08:00
test: test-ci fmt
# Run ci tests
test-ci: mocks tidy
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
2021-08-19 13:41:00 +08:00
mockgen -package client -destination pkg/mocks/client/mock.go github.com/bakito/adguardhome-sync/pkg/client Client
2021-04-11 17:56:55 +08:00
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))
2021-11-30 05:25:01 +08:00
$(shell go install github.com/bakito/semver@latest)
2021-04-11 17:56:55 +08:00
endif
mockgen:
ifeq (, $(shell which mockgen))
2022-01-31 01:54:22 +08:00
$(shell go install github.com/golang/mock/mockgen@v1.6.0)
2021-03-29 01:31:11 +08:00
endif