Skip to content

Commit

Permalink
report_coverage in .gitlab-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jan 4, 2024
1 parent c6189c2 commit 3183417
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit 3183417

Please sign in to comment.