Skip to content

Commit

Permalink
ci: report coverage to codeclimate (#113)
Browse files Browse the repository at this point in the history
* ci: report coverage to codeclimate

* ci: codeclimate: remove debug flag

* ci: add codeclimate config file

* ci/codeclimate: removed coverageLocations workaround
paambaati/codeclimate-action#265 was fixed upstream
  • Loading branch information
Roberto Santalla authored Dec 14, 2020
1 parent c30461a commit 40979ce
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3,161 deletions.
10 changes: 10 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "2"
plugins:
golint:
enabled: true
config:
min_confidence: 0.9
gofmt:
enabled: true
govet:
enabled: true
21 changes: 21 additions & 0 deletions .github/workflows/push_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,24 @@ jobs:
- name: Scan code for vulnerabilities
run: make ci/snyk-test

coverage:
name: Report coverage analysis to codeclimate
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/setup-go@v2
with:
go-version: ${{env.GO_VERSION}}
- uses: actions/checkout@v2
- run: make compile-deps
# go test outputs a fully qualified package path on the report, which confuses codeclimate if repo is not in $GOPATH
- name: Set codeclimate prefix
run: |
echo "CC_PREFIX=$(go list -m)" >> $GITHUB_ENV
- name: Test & publish code coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: 286fd24e272c97116860791b9c4ed636092663dc665a6608c8aaa625e9c46b1b
with:
coverageCommand: go test -coverprofile=c.out ./...
prefix: ${{ env.CC_PREFIX }} # CC will strip this from the test report, leading to the correct file path
Loading

0 comments on commit 40979ce

Please sign in to comment.