2017-10-02 19:23:41 +02:00
|
|
|
SOURCE_FILES?=./...
|
2017-01-02 12:23:28 +02:00
|
|
|
TEST_PATTERN?=.
|
|
|
|
TEST_OPTIONS?=
|
|
|
|
|
2018-04-25 07:20:12 +02:00
|
|
|
export PATH := ./bin:$(PATH)
|
2018-10-29 02:54:15 +02:00
|
|
|
export GO111MODULE := on
|
2019-10-29 03:33:01 +02:00
|
|
|
export GOPROXY = https://proxy.golang.org,direct
|
2018-04-25 07:20:12 +02:00
|
|
|
|
2017-09-10 22:07:28 +02:00
|
|
|
# Install all the build and lint dependencies
|
|
|
|
setup:
|
2020-05-10 21:34:55 +02:00
|
|
|
go mod download
|
|
|
|
go generate -v ./...
|
2017-12-06 01:59:57 +02:00
|
|
|
.PHONY: setup
|
2017-01-02 12:23:28 +02:00
|
|
|
|
2017-09-10 22:07:28 +02:00
|
|
|
# Run all the tests
|
|
|
|
test:
|
2020-06-06 20:48:04 +02:00
|
|
|
LC_ALL=C go test $(TEST_OPTIONS) -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=5m
|
2018-05-04 07:07:20 +02:00
|
|
|
.PHONY: test
|
2017-01-15 13:11:37 +02:00
|
|
|
|
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
|
2017-12-06 01:59:57 +02:00
|
|
|
.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
|
2017-12-06 01:59:57 +02:00
|
|
|
.PHONY: fmt
|
2017-01-02 12:23:28 +02:00
|
|
|
|
2017-09-10 22:07:28 +02:00
|
|
|
# Run all the linters
|
|
|
|
lint:
|
2019-09-13 14:53:56 +02:00
|
|
|
# TODO: fix tests issues
|
|
|
|
# TODO: fix lll issues
|
|
|
|
# TODO: fix funlen issues
|
2019-09-23 23:15:57 +02:00
|
|
|
# TODO: fix godox issues
|
2019-10-09 21:07:51 +02:00
|
|
|
# TODO: fix wsl issues
|
2020-05-10 21:34:55 +02:00
|
|
|
golangci-lint run ./...
|
|
|
|
misspell -error **/*
|
2017-12-06 01:59:57 +02:00
|
|
|
.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
|
2020-02-19 15:21:44 +02:00
|
|
|
ci: build test lint
|
2017-12-06 01:59:57 +02:00
|
|
|
.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:
|
2017-04-23 13:22:12 +02:00
|
|
|
go build
|
2017-12-06 01:59:57 +02:00
|
|
|
.PHONY: build
|
2017-09-11 02:11:37 +02:00
|
|
|
|
2019-04-23 11:18:22 +02:00
|
|
|
imgs:
|
2020-05-10 22:32:55 +02:00
|
|
|
wget -O www/docs/static/logo.png https://github.com/goreleaser/artwork/raw/master/goreleaserfundo.png
|
|
|
|
wget -O www/docs/static/card.png "https://og.caarlos0.dev/**GoReleaser**%20%7C%20Deliver%20Go%20binaries%20as%20fast%20and%20easily%20as%20possible.png?theme=light&md=1&fontSize=80px&images=https://github.com/goreleaser.png"
|
|
|
|
wget -O www/docs/static/avatar.png https://github.com/goreleaser.png
|
|
|
|
convert www/docs/static/avatar.png -define icon:auto-resize=64,48,32,16 docs/static/favicon.ico
|
|
|
|
convert www/docs/static/avatar.png -resize x120 www/docs/static/apple-touch-icon.png
|
2019-04-23 11:18:22 +02:00
|
|
|
.PHONY: imgs
|
2018-06-20 05:16:04 +02:00
|
|
|
|
2020-05-10 22:23:43 +02:00
|
|
|
serve:
|
2020-05-10 22:32:55 +02:00
|
|
|
@docker run --rm -it -p 8000:8000 -v ${PWD}/www:/docs squidfunk/mkdocs-material
|
2018-05-01 05:57:57 +02:00
|
|
|
.PHONY: serve
|
|
|
|
|
2020-06-08 21:48:10 +02:00
|
|
|
vercel:
|
2020-06-08 22:08:40 +02:00
|
|
|
yum install -y jq
|
2020-06-08 21:48:10 +02:00
|
|
|
pip install mkdocs-material mkdocs-minify-plugin
|
2020-06-08 22:08:40 +02:00
|
|
|
./scripts/get-releases.sh
|
|
|
|
(cd www && mkdocs build)
|
2020-06-08 21:48:10 +02:00
|
|
|
|
2017-10-19 14:50:49 +02:00
|
|
|
# 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' .
|
2017-10-19 14:50:49 +02:00
|
|
|
.PHONY: todo
|
|
|
|
|
2017-01-02 17:57:36 +02:00
|
|
|
.DEFAULT_GOAL := build
|