diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.com> | 2021-04-23 15:19:53 +0300 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.com> | 2021-04-23 17:41:06 +0300 |
commit | 40765f7c53237e798565f9568caed7f4a4d6373c (patch) | |
tree | e98c5cf1e2a540abae229324614b52f705554448 | |
parent | e9a08214bb61dbdc77a82b05471899917a9aee6e (diff) |
ci: coverage: generate cobertura report with grcov
It's supported with the latest version.
Also ignore build.rs when generating reports.
The new gitlab summary parsing regexp is now:
<abbr .*>(\d+.\d+) %<\/abbr>
-rw-r--r-- | .gitlab-ci.yml | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d62abbd8b..5b481397f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -230,13 +230,12 @@ coverage: script: - cargo test --locked --color=always --all-features # generate html report - - grcov . --binary-path ./target/debug/ -s . -t html --branch --ignore-not-existing --ignore "*target*" -o ./coverage/ + - grcov . --binary-path ./target/debug/ -s . -t html --branch --ignore-not-existing --ignore "*target*" --ignore "*/build.rs" -o ./coverage/ # generate cobertura report for gitlab integration - - grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "*target*" -o lcov - - python3 /usr/local/lib/python3.7/dist-packages/lcov_cobertura.py lcov - # output coverage summary for gitlab parsing - - lcov -r lcov "/*" 2&> out - - grep lines out + - grcov . --binary-path ./target/debug/ -s . -t cobertura --branch --ignore-not-existing --ignore "*target*" --ignore "*/build.rs" -o coverage.xml + # output coverage summary for gitlab parsing. + # TODO: use grcov once https://github.com/mozilla/grcov/issues/556 is fixed + - grep "%" coverage/index.html | head -1 || true artifacts: paths: - 'coverage' |