diff --git a/Makefile b/Makefile index 52cca29a..3dd6ada9 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,7 @@ test-release: clean-release: cargo clean --release -ci-all: | ci-format ci-build ci-doc ci-lint ci-test +ci-all: | ci-format ci-build ci-doc ci-lint ci-test ci-coverage ci-format: cargo fmt --check --all @@ -80,3 +80,8 @@ ci-test: cargo test --workspace --all-features cargo clean cargo test --release --workspace --all-features + +ci-coverage: + rustup component add llvm-tools-preview + cargo install cargo-llvm-cov --locked || true + cargo llvm-cov --workspace --all-features --fail-under-lines 80 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0b7aec51..593e410b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -109,6 +109,10 @@ stages: make ci-test displayName: 'Test' + - script: | + make ci-coverage + displayName: 'Coverage (fail under 80% lines)' + - publish: $(System.DefaultWorkingDirectory)/ artifact: sonic-dash-ha displayName: 'Archive release binaries'