From 3e97fef6ced80cf6b4d74fed2fd028bc2d7b2268 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Mon, 12 Aug 2024 19:40:29 +0300 Subject: [PATCH] ci: Generate html and cobertura coverage with a single command Part-of: --- .gitlab-ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 81ca699b..90254482 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -379,19 +379,18 @@ coverage: script: - cargo test --locked --color=always --all --all-features --exclude gst-plugin-gtk4 # generate html report - - 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 cobertura --branch --ignore-not-existing --ignore "*target*" --ignore "*/build.rs" -o coverage.xml + - mkdir -p coverage + - grcov . --binary-path ./target/debug/ -s . -t html,cobertura --branch --ignore-not-existing --ignore "*target*" --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" cerbero trigger: image: $CERBERO_TRIGGER_IMAGE