add schedulable job to generate aggregated coverage

This commit is contained in:
trinity-1686a 2022-05-05 13:52:00 +02:00
parent 5bd38ab6dc
commit 9ed5983c76
1 changed files with 45 additions and 6 deletions

View File

@ -2,6 +2,7 @@ stages:
- check - check
- build - build
- test - test
- deploy
variables: variables:
# We don't need Husky to install the Git hooks for CI. # We don't need Husky to install the Git hooks for CI.
@ -35,8 +36,6 @@ rust-latest:
- ./maint/cargo_audit - ./maint/cargo_audit
- cp $CARGO_HOME/bin/cargo-audit . - cp $CARGO_HOME/bin/cargo-audit .
- cargo build --verbose --release -p arti-bench --target x86_64-unknown-linux-gnu - cargo build --verbose --release -p arti-bench --target x86_64-unknown-linux-gnu
tags:
- amd64
cache: cache:
paths: paths:
- cargo-audit - cargo-audit
@ -45,6 +44,8 @@ rust-latest:
- target/x86_64-unknown-linux-gnu/debug/arti - target/x86_64-unknown-linux-gnu/debug/arti
- target/x86_64-unknown-linux-gnu/release/arti-bench - target/x86_64-unknown-linux-gnu/release/arti-bench
expire_in: 1 hours expire_in: 1 hours
tags:
- amd64
rust-latest-async-std-rustls: rust-latest-async-std-rustls:
stage: build stage: build
@ -85,16 +86,15 @@ coverage:
- cp grcov $CARGO_HOME/bin/ || cargo install grcov - cp grcov $CARGO_HOME/bin/ || cargo install grcov
- cp $CARGO_HOME/bin/grcov . - cp $CARGO_HOME/bin/grcov .
# Generate report # Generate report
- ./maint/with_coverage cargo test --verbose --all-features - ./maint/with_coverage -f cobertura -o coverage.xml cargo test --verbose --all-features
- ./maint/with_coverage -f cobertura -o coverage.xml -c true
cache: cache:
paths: paths:
- grcov - grcov
artifacts: artifacts:
paths:
- 'coverage'
reports: reports:
cobertura: coverage.xml cobertura: coverage.xml
tags:
- amd64
minimal-versions: minimal-versions:
stage: test stage: test
@ -145,3 +145,42 @@ integration:
- benchmark_results.json - benchmark_results.json
tags: tags:
- amd64 - amd64
coverage-aggregated:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
stage: test
image: rust:latest
needs: []
script:
- apt update && apt install -y tor python3 python3-pip python3-setuptools curl
# install deps for report generation
- pip3 install beautifulsoup4 lxml
- rustup component add llvm-tools-preview
- cp grcov $CARGO_HOME/bin/ || cargo install grcov
- cp $CARGO_HOME/bin/grcov .
# Generate report
- ./maint/coverage all
cache:
paths:
- grcov
artifacts:
paths:
- coverage
tags:
- amd64
pages:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" # && $CI_COMMIT_REF_NAME == "main"
stage: deploy
image: debian:stable-slim
script:
- apt update && apt install -y git
# Export report as website, while keeping the existing public page
- git fetch
- git checkout origin/pages -- public/
- mv coverage public/
artifacts:
paths:
- public