Dan Anglin
e4df5bfb8e
JUnit reports are useful for merge requests so it is generate only from commits to branches other than master. This solves the issue where the code coverage was missing from the badge and no testing logs are shown in the console output. Also fixed (hopefully) is the deployment of the coverage report to my GitLab pages site.
53 lines
844 B
YAML
53 lines
844 B
YAML
---
|
|
stages:
|
|
- test
|
|
- deploy
|
|
|
|
variables:
|
|
CGO_ENABLED: 0
|
|
|
|
test:junit:
|
|
artifacts:
|
|
expire_in: 1 hour
|
|
reports:
|
|
junit:
|
|
report.xml
|
|
before_script:
|
|
- apk add --no-cache make
|
|
- go get -u github.com/jstemmer/go-junit-report
|
|
except:
|
|
- master
|
|
image: golang:1.13.6-alpine
|
|
script:
|
|
- make test_junit_report
|
|
stage: test
|
|
|
|
test:unit:
|
|
artifacts:
|
|
expire_in: 30 minutes
|
|
paths:
|
|
- code-coverage.html
|
|
before_script:
|
|
- apk add --no-cache make
|
|
image: golang:1.13.6-alpine
|
|
only:
|
|
- master@dananglin/pominal
|
|
script:
|
|
- make test_cover_report
|
|
stage: test
|
|
|
|
pages:
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
expire_in: 30 days
|
|
dependencies:
|
|
- test:unit
|
|
only:
|
|
- master@dananglin/pominal
|
|
script:
|
|
- mkdir public
|
|
- mv code-coverage.html public
|
|
stage: deploy
|
|
variables:
|
|
GIT_STRATEGY: none
|