Merge pull request #484 from twhiston/codacy_coverage

add codacy code review links, generate and export coverage info
This commit is contained in:
Tom Whiston 2018-03-11 14:06:07 +01:00 committed by GitHub
commit 43341d3dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 3 deletions

View File

@ -1,6 +1,8 @@
![semaphore](public/img/logo.png)
[![Circle CI](https://circleci.com/gh/ansible-semaphore/semaphore.svg?style=svg&circle-token=3702872acf2bec629017fa7dd99fdbea56aef7df)](https://circleci.com/gh/ansible-semaphore/semaphore)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/89e0129c6ba64fe2b1ebe983f72a4eff)](https://www.codacy.com/app/ansible-semaphore/semaphore?utm_source=github.com&utm_medium=referral&utm_content=ansible-semaphore/semaphore&utm_campaign=Badge_Grade)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/89e0129c6ba64fe2b1ebe983f72a4eff)](https://www.codacy.com/app/ansible-semaphore/semaphore?utm_source=github.com&utm_medium=referral&utm_content=ansible-semaphore/semaphore&utm_campaign=Badge_Coverage)
[![semaphore on discord](https://img.shields.io/badge/discord-semaphore%20community-738bd7.svg)](https://discord.gg/ZW7Qu6a)
- [Releases](https://github.com/ansible-semaphore/semaphore/releases)

View File

@ -26,6 +26,7 @@ tasks:
cmds:
- go get github.com/gobuffalo/packr/...
- go get github.com/mitchellh/gox
- go get -u github.com/haya14busa/goverage
deps:fe:
desc: Installs npm requirements for front end from package.json
@ -122,7 +123,9 @@ tasks:
desc: Run go code tests
cmds:
- go vet ./...
- go test ./...
# 2> /dev/null makes goverage less noisy about pattern matching
# if no tests exist but will still print failing test results
- goverage -v -coverprofile=coverage.out ./... 2> /dev/null
ci:artifacts:
cmds:

View File

@ -13,6 +13,7 @@ dependencies:
- sudo curl -L https://storage.googleapis.com/golang/go1.10.linux-amd64.tar.gz > /tmp/go.tar.gz
- sudo tar -C /usr/local -xzf /tmp/go.tar.gz
- go get -u -v github.com/go-task/task/cmd/task
- go get github.com/schrej/godacov
- task deps
override:
- task compile
@ -35,6 +36,9 @@ test:
EOF
- go run cli/main.go --migrate -config config.json
override:
- task test
- cd ${CPATH}/${CIRCLE_PROJECT_REPONAME} && task test
- task build
- task ci:artifacts
- task ci:artifacts
post:
# We don't export the coverage secret to forks so we need this to always return successfully
- godacov -t "${CODACY_TOKEN}" -r ./coverage.out -c "${CIRCLE_SHA1}" || true