mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
Add coverage report sending to Code Climate
This commit is contained in:
committed by
GitHub
parent
0dcc12dad0
commit
52052f667c
@ -34,16 +34,23 @@ jobs:
|
|||||||
command: go test -v ./...
|
command: go test -v ./...
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
|
environment:
|
||||||
|
CC_TEST_REPORTER_ID: 22c636ecdefebc15bb4f014f29fd593204cb51102d8b46d00a1c0c273d7a99e9
|
||||||
executor: go
|
executor: go
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- gomod
|
- gomod
|
||||||
- run:
|
- run:
|
||||||
name: Create test coverage report
|
name: Setup Code Climate test-reporter
|
||||||
command: go test -race -coverprofile=coverage.txt ./...
|
command: |
|
||||||
|
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
||||||
|
chmod +x ./cc-test-reporter
|
||||||
- run:
|
- run:
|
||||||
name: Print test coverage report
|
name: Create test coverage report and send it to Code Climate
|
||||||
command: go tool cover -func=coverage.txt
|
command: |
|
||||||
|
./cc-test-reporter before-build
|
||||||
|
go test -race -coverprofile=coverage.txt ./...
|
||||||
|
./cc-test-reporter after-build --coverage-input-type cover --exit-code $?
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: ./coverage.txt
|
path: ./coverage.txt
|
||||||
destination: coverage.txt
|
destination: coverage.txt
|
||||||
|
Reference in New Issue
Block a user