forked from lindenlab/env
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c053be
commit d246903
Showing
6 changed files
with
67 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cover.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
PKGS := $(shell go list ./... | grep -v -E mocks) | ||
SRCS := $(shell find . go.mod -name '*.go') go.mod | ||
export GO111MODULE=on | ||
|
||
VERSION := $(shell cat Version) | ||
|
||
# Set the code coverage target for this project | ||
COVER_TARGET ?= 85 | ||
|
||
LINT_OPTS ?= --fix | ||
LINTERS=-E gofmt -E govet -E errcheck -E staticcheck -E gosimple -E structcheck \ | ||
-E varcheck -E ineffassign -E typecheck | ||
|
||
.PHONEY: build | ||
build: ${SRCS} | ||
@go build | ||
.PHONY: tests | ||
tests: ## Run test suite | ||
@go test -race ${PKGS} | ||
|
||
.PHONY: cover | ||
cover: ## Generate test coverage results | ||
@go test --covermode=count -coverprofile cover.profile ${PKGS} | ||
@go tool cover -html cover.profile -o cover.html | ||
@go tool cover -func cover.profile -o cover.func | ||
@tail -n 1 cover.func | awk '{if (int($$3) > ${COVER_TARGET}) {print "Coverage good: " $$3} else {print "Coverage is less than ${COVER_TARGET}%: " $$3; exit 1}}' | ||
|
||
|
||
.PHONY: lint | ||
lint: ## Run golint and go fmt on source base | ||
@golangci-lint run ${LINT_OPTS} --no-config --disable-all ${LINTERS} ./... | ||
|
||
.PHONY: clean | ||
clean: ## Clean up any generated files | ||
@rm -f cover.* | ||
|
||
.DEFAULT_GOAL := help | ||
.PHONY: help | ||
help: ## Display this help message | ||
@grep -E '^[ a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \ | ||
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' | ||
|
||
.PHONY: version | ||
version: ## Show the version the Makefile will build | ||
@echo ${VERSION} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
git checkout master | ||
git pull | ||
while IFS='' read -r line || [[ -n "$line" ]]; do | ||
git tag v$line | ||
done < "$1" | ||
git push --tags origin master | ||
|
||
|