From 3183417d959359be34aa535b8839d0c3a0a0291b Mon Sep 17 00:00:00 2001 From: paugier Date: Thu, 4 Jan 2024 09:43:56 +0100 Subject: [PATCH] report_coverage in .gitlab-ci.yml --- .gitlab-ci.yml | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2af9bba2..5cf2f48d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,14 @@ stages: - image - lint - test + - report + +workflow: + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS + when: never + - if: $CI_COMMIT_BRANCH variables: CODECOV_TOKEN: 4d2d8534-60ec-48b3-bf55-93b92f25913d @@ -56,13 +64,13 @@ validate_code: script: - nox -s validate_code -tests: - stage: test - needs: - - job: "CI image" - optional: true - script: - - tox -e py39-fft,codecov +# tests: +# stage: test +# needs: +# - job: "CI image" +# optional: true +# script: +# - tox -e py39-fft,codecov test_without_fft_and_pythran: stage: test @@ -71,3 +79,21 @@ test_without_fft_and_pythran: optional: true script: - nox -s test_without_fft_and_pythran + artifacts: + paths: + - .coverage/* + expire_in: 10 mins + +report_coverage: + stage: report + needs: + - job: "test_without_fft_and_pythran" + rules: + - if: "$CI_COMMIT_BRANCH == null" + variables: + CI_COMMIT_BRANCH: $CI_COMMIT_HG_BRANCH + script: + - pip install coverage codecov + - make _report_coverage + - codecov --file .coverage/coverage.xml --commit $CI_COMMIT_SHA \ + --branch $CI_COMMIT_BRANCH --name Heptapod$CI_JOB_ID