1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-06 03:13:48 +02:00
goreleaser/Makefile

80 lines
2.1 KiB
Makefile
Raw Normal View History

SOURCE_FILES?=./...
2017-01-02 12:23:28 +02:00
TEST_PATTERN?=.
TEST_OPTIONS?=
export PATH := ./bin:$(PATH)
2018-10-29 02:54:15 +02:00
export GO111MODULE := on
2017-09-10 22:07:28 +02:00
# Install all the build and lint dependencies
setup:
2018-05-29 14:17:17 +02:00
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh
2018-05-13 21:06:14 +02:00
curl -sfL https://install.goreleaser.com/github.com/gohugoio/hugo.sh | sh
2018-10-29 02:54:15 +02:00
go mod download
.PHONY: setup
2017-01-02 12:23:28 +02:00
2017-09-10 22:07:28 +02:00
# Run all the tests
test:
2018-08-21 20:55:35 +02:00
go test $(TEST_OPTIONS) -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=2m
.PHONY: test
2017-09-10 22:07:28 +02:00
# Run all the tests and opens the coverage report
cover: test
2017-04-22 02:22:11 +02:00
go tool cover -html=coverage.txt
.PHONY: cover
2017-04-14 20:39:32 +02:00
2017-09-10 22:07:28 +02:00
# gofmt and goimports all go files
fmt:
2017-01-30 18:24:32 +02:00
find . -name '*.go' -not -wholename './vendor/*' | while read -r file; do gofmt -w -s "$$file"; goimports -w "$$file"; done
2018-08-01 15:04:30 +02:00
# find . -name '*.md' -not -wholename './vendor/*' | xargs prettier --write
.PHONY: fmt
2017-01-02 12:23:28 +02:00
2017-09-10 22:07:28 +02:00
# Run all the linters
lint:
2018-07-04 09:42:24 +02:00
# TODO: fix tests and lll issues
./bin/golangci-lint run --tests=false --enable-all --disable=lll ./...
2018-08-01 15:04:30 +02:00
# find . -name '*.md' -not -wholename './vendor/*' | xargs prettier -l
.PHONY: lint
2017-01-02 12:23:28 +02:00
2017-09-10 22:07:28 +02:00
# Run all the tests and code checks
2017-12-18 13:28:36 +02:00
ci: build test lint
.PHONY: ci
2017-01-02 12:23:28 +02:00
2017-09-10 22:07:28 +02:00
# Build a beta version of goreleaser
build:
go build
.PHONY: build
2017-09-11 02:11:37 +02:00
2017-09-10 22:07:28 +02:00
# Generate the static documentation
static:
2018-06-25 19:51:10 +02:00
@hugo --enableGitInfo --source www
.PHONY: static
2018-06-20 05:16:04 +02:00
favicon:
wget -O www/static/avatar.png https://avatars2.githubusercontent.com/u/24697112
convert www/static/avatar.png -define icon:auto-resize=64,48,32,16 www/static/favicon.ico
convert www/static/avatar.png -resize x120 www/static/apple-touch-icon.png
.PHONY: favicon
2018-05-01 05:57:57 +02:00
serve:
2018-08-15 05:18:59 +02:00
@hugo server --enableGitInfo --watch --source www --disableFastRender
2018-05-01 05:57:57 +02:00
.PHONY: serve
2018-09-12 18:34:26 +02:00
depgraph:
go get github.com/kisielk/godepgraph
2018-09-12 19:18:01 +02:00
godepgraph -horizontal -s -o github.com/goreleaser/goreleaser . | dot -Tsvg -o www/static/deps.svg
2018-09-12 18:34:26 +02:00
.PHONY: depgraph
# Show to-do items per file.
todo:
@grep \
--exclude-dir=vendor \
--exclude-dir=node_modules \
--exclude=Makefile \
--text \
--color \
2018-03-05 01:23:38 +02:00
-nRo -E ' TODO:.*|SkipNow' .
.PHONY: todo
2017-01-02 12:23:28 +02:00
2017-01-02 17:57:36 +02:00
.DEFAULT_GOAL := build