ci: Generate html and cobertura coverage with a single command

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1709>
This commit is contained in:
Jordan Petridis 2024-08-12 19:40:29 +03:00 committed by GStreamer Marge Bot
parent bc930122ba
commit 3e97fef6ce

View file

@ -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