Skip to content

Commit

Permalink
Add codecov support (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
mszostok committed May 11, 2020
1 parent a07509e commit 1951ba8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Ignore everything
**

# Allow files and directories
# Allow binary
!/codeowners-validator
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ scripts/
.idea
codeowners-validator
dist/
tmp/
tmp/
coverage.txt
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ jobs:
# - go test ./tests/integration/... -v -tags=integration
# os: windows
# go: 1.13.x

# push results to CodeCov
after_success:
- bash <(curl -s https://codecov.io/bash) || echo 'Codecov failed to upload'
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ test-hammer:
go test -count=100 ./...
.PHONY: test-hammer

cover-html:
go test -v -coverprofile=./tmp/coverage.out ./...
go tool cover -html=./tmp/coverage.out
cover-html: test-unit
go tool cover -html=./coverage.txt
.PHONY: cover-html
4 changes: 2 additions & 2 deletions hack/ci/run-test-unit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ readonly ROOT_PATH=${CURRENT_DIR}/../..

source "${CURRENT_DIR}/utilities.sh" || { echo 'Cannot load CI utilities.'; exit 1; }

pushd ${ROOT_PATH} > /dev/null
pushd "${ROOT_PATH}" > /dev/null

# Exit handler. This function is called anytime an EXIT signal is received.
# This function should never be explicitly called.
Expand Down Expand Up @@ -61,7 +61,7 @@ fi
# GO TEST
##
shout "? go test"
go test -race ./...
go test -race -coverprofile="${ROOT_PATH}/coverage.txt" ./...
# Check if tests passed
if [[ $? != 0 ]]; then
echo -e "${RED}✗ go test\n${NC}"
Expand Down

0 comments on commit 1951ba8

Please sign in to comment.