-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split-out CI steps into stand-alone scripts
- Loading branch information
1 parent
6f0bb90
commit 01734b1
Showing
5 changed files
with
64 additions
and
47 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
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/bin/bash | ||
|
||
#!/usr/bin/env bash | ||
set -u -e -x -o pipefail | ||
|
||
go version | grep go1.12 || exit | ||
|
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,17 @@ | ||
#!/usr/bin/env bash | ||
set -u -e -x -o pipefail | ||
|
||
if [[ -n "${GOLANGCI_VERSION-}" ]]; then | ||
# Retrieve the golangci-lint linter binary. | ||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b ${GOPATH}/bin ${GOLANGCI_VERSION} | ||
fi | ||
|
||
# Run the linter. | ||
golangci-lint run | ||
|
||
if [[ "${GO111MODULE-off}" == "on" ]]; then | ||
# If Go modules are active then check that dependencies are correctly maintained. | ||
go mod tidy | ||
go mod vendor | ||
git diff --exit-code --quiet || (echo "Please run 'go mod tidy' to clean up the 'go.mod' and 'go.sum' files."; false) | ||
fi |
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,17 @@ | ||
#!/usr/bin/env bash | ||
set -u -e -x -o pipefail | ||
|
||
if [[ -n "${REPORT_COVERAGE+cover}" ]]; then | ||
# Retrieve and prepare CodeClimate's test coverage reporter. | ||
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | ||
chmod +x ./cc-test-reporter | ||
./cc-test-reporter before-build | ||
fi | ||
|
||
# Run all the tests with the race detector and generate coverage. | ||
go test -v -race -coverprofile c.out ./... | ||
|
||
if [[ -n "${REPORT_COVERAGE+cover}" && "${TRAVIS_SECURE_ENV_VARS}" == "true" ]]; then | ||
# Upload test coverage to CodeClimate. | ||
./cc-test-reporter after-build | ||
fi |