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: script:
- cargo test --locked --color=always --all --all-features --exclude gst-plugin-gtk4 - cargo test --locked --color=always --all --all-features --exclude gst-plugin-gtk4
# generate html report # generate html report
- grcov . --binary-path ./target/debug/ -s . -t html --branch --ignore-not-existing --ignore "*target*" --ignore "*/build.rs" -o ./coverage/ - mkdir -p coverage
# generate cobertura report for gitlab integration - grcov . --binary-path ./target/debug/ -s . -t html,cobertura --branch --ignore-not-existing --ignore "*target*" --ignore "*/build.rs" -o ./coverage/
- 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. # output coverage summary for gitlab parsing.
# TODO: use grcov once https://github.com/mozilla/grcov/issues/556 is fixed # 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: artifacts:
paths: paths:
- 'coverage' - 'coverage'
reports: reports:
coverage_report: coverage_report:
coverage_format: cobertura coverage_format: cobertura
path: coverage.xml path: "coverage/cobertura.xml"
cerbero trigger: cerbero trigger:
image: $CERBERO_TRIGGER_IMAGE image: $CERBERO_TRIGGER_IMAGE