github.com/tomsquest/goreleaser@v0.34.3-0.20171008022654-7d6ef4d338b3/Makefile (about) 1 SOURCE_FILES?=./... 2 TEST_PATTERN?=. 3 TEST_OPTIONS?= 4 5 # Install all the build and lint dependencies 6 setup: 7 go get -u github.com/alecthomas/gometalinter 8 go get -u github.com/golang/dep/cmd/dep 9 go get -u github.com/pierrre/gotestcover 10 go get -u golang.org/x/tools/cmd/cover 11 dep ensure 12 gometalinter --install 13 14 # Run all the tests 15 test: 16 gotestcover $(TEST_OPTIONS) -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=2m 17 18 # Run all the tests and opens the coverage report 19 cover: test 20 go tool cover -html=coverage.txt 21 22 # gofmt and goimports all go files 23 fmt: 24 find . -name '*.go' -not -wholename './vendor/*' | while read -r file; do gofmt -w -s "$$file"; goimports -w "$$file"; done 25 26 # Run all the linters 27 lint: 28 gometalinter --vendor ./... 29 30 # Run all the tests and code checks 31 ci: test lint 32 33 # Build a beta version of goreleaser 34 build: 35 go build 36 37 HIGHLIGHT=https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0 38 39 # Generate the static documentation 40 static: 41 @static-docs \ 42 --in docs \ 43 --out ../goreleaser.github.io \ 44 --title GoReleaser \ 45 --subtitle "Deliver Go binaries as fast and easily as possible" \ 46 --google UA-106198408-1 \ 47 --script "$(HIGHLIGHT)/highlight.min.js" \ 48 --script "$(HIGHLIGHT)/languages/go.min.js" \ 49 --script "$(HIGHLIGHT)/languages/yaml.min.js" \ 50 --script "$(HIGHLIGHT)/languages/dockerfile.min.js" \ 51 --style "$(HIGHLIGHT)/styles/atom-one-dark.min.css" \ 52 --inline-script 'hljs.initHighlightingOnLoad();' \ 53 --inline-style 'pre { padding: 0; }' 54 55 56 .DEFAULT_GOAL := build