chore: use the toolchain for go builds (#317)

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
This commit is contained in:
Andrew Rynhard
2019-01-18 06:26:12 -08:00
committed by GitHub
parent 26c44185be
commit 1fe14494f0
3 changed files with 180 additions and 147 deletions

View File

@@ -5,21 +5,16 @@ set -e
CGO_ENABLED=1
GOPACKAGES=$(go list ./...)
lint_packages() {
echo "Linting packages"
golangci-lint run --config ${1}
}
perform_unit_tests() {
echo "Performing unit tests"
go test -v -short ./...
}
perform_integration_tests() {
echo "Performing integration tests"
perform_tests() {
echo "Performing tests"
go test -v ./...
}
perform_short_tests() {
echo "Performing short tests"
go test -v -short ./...
}
perform_coverage_tests() {
echo "Performing coverage tests"
local coverage_report="coverage.txt"
@@ -38,20 +33,14 @@ perform_coverage_tests() {
}
case $1 in
--lint)
lint_packages ${2}
;;
--unit)
perform_unit_tests
;;
--integration)
perform_integration_tests
--short)
perform_short_tests
;;
--coverage)
perform_coverage_tests
;;
*)
exit 1
perform_tests
;;
esac