github.1git.de/goreleaser/goreleaser@v0.92.0/Makefile (about)

     1  SOURCE_FILES?=./...
     2  TEST_PATTERN?=.
     3  TEST_OPTIONS?=
     4  
     5  export PATH := ./bin:$(PATH)
     6  
     7  # Install all the build and lint dependencies
     8  setup:
     9  	curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh
    10  	curl -sfL https://install.goreleaser.com/github.com/gohugoio/hugo.sh | sh
    11  	curl -sfL https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
    12  	dep ensure -vendor-only
    13  .PHONY: setup
    14  
    15  # Run all the tests
    16  test:
    17  	go test $(TEST_OPTIONS) -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=2m
    18  .PHONY: test
    19  
    20  # Run all the tests and opens the coverage report
    21  cover: test
    22  	go tool cover -html=coverage.txt
    23  .PHONY: cover
    24  
    25  # gofmt and goimports all go files
    26  fmt:
    27  	find . -name '*.go' -not -wholename './vendor/*' | while read -r file; do gofmt -w -s "$$file"; goimports -w "$$file"; done
    28  	# find . -name '*.md' -not -wholename './vendor/*' | xargs prettier --write
    29  .PHONY: fmt
    30  
    31  # Run all the linters
    32  lint:
    33  	# TODO: fix tests and lll issues
    34  	./bin/golangci-lint run --tests=false --enable-all --disable=lll ./...
    35  	# find . -name '*.md' -not -wholename './vendor/*' | xargs prettier -l
    36  .PHONY: lint
    37  
    38  # Run all the tests and code checks
    39  ci: build test lint
    40  .PHONY: ci
    41  
    42  # Build a beta version of goreleaser
    43  build:
    44  	go build
    45  .PHONY: build
    46  
    47  # Generate the static documentation
    48  static:
    49  	@hugo --enableGitInfo --source www
    50  .PHONY: static
    51  
    52  favicon:
    53  	wget -O www/static/avatar.png https://avatars2.githubusercontent.com/u/24697112
    54  	convert www/static/avatar.png -define icon:auto-resize=64,48,32,16 www/static/favicon.ico
    55  	convert www/static/avatar.png -resize x120 www/static/apple-touch-icon.png
    56  .PHONY: favicon
    57  
    58  serve:
    59  	@hugo server --enableGitInfo --watch --source www --disableFastRender
    60  .PHONY: serve
    61  
    62  depgraph:
    63  	go get github.com/kisielk/godepgraph
    64  	godepgraph -horizontal -s -o github.com/goreleaser/goreleaser . | dot -Tsvg -o www/static/deps.svg
    65  .PHONY: depgraph
    66  
    67  # Show to-do items per file.
    68  todo:
    69  	@grep \
    70  		--exclude-dir=vendor \
    71  		--exclude-dir=node_modules \
    72  		--exclude=Makefile \
    73  		--text \
    74  		--color \
    75  		-nRo -E ' TODO:.*|SkipNow' .
    76  .PHONY: todo
    77  
    78  
    79  .DEFAULT_GOAL := build