Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic code coverage #328

Merged
merged 8 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: coverage

on: [push]
jobs:
test:
name: coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:0.30.0
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Generate code coverage
run: |
cargo tarpaulin --tests --examples --verbose --all-features --workspace --timeout 120 --out xml

- name: Workaround for codecov/feedback#263
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Upload to codecov.io
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# halo2 [![Crates.io](https://img.shields.io/crates/v/halo2.svg)](https://crates.io/crates/halo2) #
# halo2 [![Crates.io](https://img.shields.io/crates/v/halo2.svg)](https://crates.io/crates/halo2) [![codecov](https://codecov.io/github/privacy-scaling-explorations/halo2/graph/badge.svg?token=6WX7KBHFIP)](https://codecov.io/github/privacy-scaling-explorations/halo2)

## [Documentation](https://privacy-scaling-explorations.github.io/halo2/halo2_proofs)

Expand Down
4 changes: 2 additions & 2 deletions halo2_proofs/tests/frontend_backend_split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ const WIDTH_FACTOR: usize = 1;

#[test]
fn test_mycircuit_full_legacy() {
#[cfg(feature = "heap-profiling")]
#[cfg(all(feature = "heap-profiling", not(tarpaulin)))]
let _profiler = dhat::Profiler::new_heap();

use halo2_proofs::plonk::{
Expand Down Expand Up @@ -566,7 +566,7 @@ fn test_mycircuit_full_legacy() {
fn test_mycircuit_full_split() {
use halo2_middleware::zal::impls::{H2cEngine, PlonkEngineConfig};

#[cfg(feature = "heap-profiling")]
#[cfg(all(feature = "heap-profiling", not(tarpaulin)))]
let _profiler = dhat::Profiler::new_heap();

let engine = PlonkEngineConfig::new()
Expand Down
Loading