Arturo Marquez 2022-01-06 14:05:17 -06:00
parent 40f96ad932
commit 3c853126de
No known key found for this signature in database
GPG Key ID: 4770F4929D4B560A
1 changed files with 25 additions and 0 deletions

View File

@ -50,6 +50,31 @@ rust-nightly:
tags:
- amd64
coverage:
stage: test
image: rustlang/rust:nightly
variables:
RUSTFLAGS: "-Zinstrument-coverage"
LLVM_PROFILE_FILE: "coverage-%p-%m.profraw"
script:
- rustup component add llvm-tools-preview
- cargo test
# generate html report
- cargo install grcov
- grcov . --binary-path ./target/debug/ -s . -t html --branch --ignore-not-existing --ignore "*cargo*" -o ./coverage/
# generate cobertura report for gitlab integration
- pip3 install lcov_cobertura
- grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "*cargo*" -o coverage.lcov
- python3 /usr/local/lib/python3.5/dist-packages/lcov_cobertura.py coverage.lcov
# output coverage summary for gitlab parsing
- apt-get update && apt-get install -y lcov
- lcov --summary coverage.lcov
artifacts:
paths:
- 'coverage'
reports:
cobertura: coverage.xml
minimal-versions:
stage: test
image: rust:1.53