Add code coverage to CI

This commit is contained in:
Aron Wussler 2019-05-09 18:51:04 +02:00
parent fd27ec08fb
commit c9730189a7
2 changed files with 15 additions and 1 deletions

3
.gitignore vendored
View file

@ -3,3 +3,6 @@ bin
dist dist
vendor vendor
.vscode .vscode
.out
.html
reports

View file

@ -19,4 +19,15 @@ test-all:
stage: test stage: test
image: gitlab.protontech.ch:4567/protonmail/import-export/linux image: gitlab.protontech.ch:4567/protonmail/import-export/linux
script: script:
- go test ./... - go test -coverprofile cover.out ./...
- mkdir reports
- go tool cover -html=cover.out -o reports/cover.html
tags:
- coverage
artifacts:
paths:
- reports
reports:
junit: reports/cover.html
when: always
expire_in: 5 days