chore: Report coverage in a separate CI job

This commit is contained in:
Robert Prehn 2021-07-23 11:08:31 -05:00
parent bd4b0feba9
commit de9831c2c2
2 changed files with 19 additions and 7 deletions

View file

@ -38,13 +38,9 @@ test:
<<: *test_template
image: "elixir:1.12.1-alpine"
script:
- script/cibuild
- script/coverage-json-to-metrics
- script/coverage-json-to-cobertura
- script/cibuild covered
artifacts:
reports:
metrics: metrics.txt
cobertura: cover/cobertura.xml
coverage_json: cover/excoveralls.json
credo:
stage: test
@ -94,6 +90,18 @@ build_image_for_commit:
script:
- script/ci-docker-build
report_coverage:
stage: deploy_tags
needs: ['test']
image: "elixir:1.12.1-alpine"
script:
- script/coverage-json-to-metrics
- script/coverage-json-to-cobertura
artifacts:
reports:
metrics: metrics.txt
cobertura: cover/cobertura.xml
# If tests pass, tag the commit and update package versions
deploy_to_tags:
stage: deploy_tags

View file

@ -12,6 +12,10 @@ mix deps.get
mix ecto.create
mix ecto.migrate
mix coveralls.json --umbrella
if [ $1 == 'covered' ]; then
mix coveralls.json --umbrella
else
mix test
fi;
script/restore-timestamps