diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe7cfbc9..a4262ab2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/script/cibuild b/script/cibuild index 1ef790c7..6544bbe7 100755 --- a/script/cibuild +++ b/script/cibuild @@ -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