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 <<: *test_template
image: "elixir:1.12.1-alpine" image: "elixir:1.12.1-alpine"
script: script:
- script/cibuild - script/cibuild covered
- script/coverage-json-to-metrics
- script/coverage-json-to-cobertura
artifacts: artifacts:
reports: coverage_json: cover/excoveralls.json
metrics: metrics.txt
cobertura: cover/cobertura.xml
credo: credo:
stage: test stage: test
@ -94,6 +90,18 @@ build_image_for_commit:
script: script:
- script/ci-docker-build - 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 # If tests pass, tag the commit and update package versions
deploy_to_tags: deploy_to_tags:
stage: deploy_tags stage: deploy_tags

View file

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