From 80d1066a20c1c3e7a5a85ef3347b0c1c812a5b91 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Mon, 12 Aug 2024 19:34:00 +0300 Subject: [PATCH] ci: Generate html and cobertura coverage with a single command Part-of: --- .gitlab-ci.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 02f37e157..1e68a97bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -408,20 +408,19 @@ coverage: LLVM_PROFILE_FILE: "gstreamer-rs-%p-%m.profraw" script: - *cargo_test - # generate html report - - grcov . --binary-path ./target/debug/ -s . -t html --branch --ignore-not-existing --ignore "*target*" --ignore "*/sys/*" --ignore "examples/*" --ignore "tutorials/*" --ignore "*/build.rs" -o ./coverage/ - # generate cobertura report for gitlab integration - - grcov . --binary-path ./target/debug/ -s . -t cobertura --branch --ignore-not-existing --ignore "*target*" --ignore "*/sys/*" --ignore "examples/*" --ignore "tutorials/*" --ignore "*/build.rs" -o coverage.xml + # generate html and cobertura report for gitlab integration + - mkdir -p coverage + - grcov . --binary-path ./target/debug/ -s . -t html,cobertura --branch --ignore-not-existing --ignore "*target*" --ignore "*/sys/*" --ignore "examples/*" --ignore "tutorials/*" --ignore "*/build.rs" -o ./coverage/ # 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 + - grep % coverage/html/index.html | head -1 ; true artifacts: paths: - 'coverage' reports: coverage_report: coverage_format: cobertura - path: coverage.xml + path: "coverage/cobertura.xml" doc-stripping: variables: