From 11f136f98b34071bb7d880f878f3f1801b36a4b5 Mon Sep 17 00:00:00 2001 From: adria0 Date: Thu, 16 May 2024 11:53:21 +0200 Subject: [PATCH 1/8] Add code coverage --- .github/workflows/coverage.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000000..6d682e6f0b --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,22 @@ +name: coverage + +on: [push] +jobs: + test: + name: coverage + runs-on: ubuntu-latest + container: + image: xd009642/tarpaulin:develop-nightly + options: --security-opt seccomp=unconfined + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Generate code coverage + run: | + cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out xml + + - name: Upload to codecov.io + uses: codecov/codecov-action@v2 + with: + fail_ci_if_error: true From 649a95759facd830db39c4f0c809b5194b6eb79d Mon Sep 17 00:00:00 2001 From: adria0 Date: Thu, 16 May 2024 12:04:16 +0200 Subject: [PATCH 2/8] fixed tarpaulin --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 6d682e6f0b..50a786567d 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -6,7 +6,7 @@ jobs: name: coverage runs-on: ubuntu-latest container: - image: xd009642/tarpaulin:develop-nightly + image: xd009642/tarpaulin:0.30.0 options: --security-opt seccomp=unconfined steps: - name: Checkout repository From a5cc671b04fbdc1caffedcfa0926e9aeb532e3e7 Mon Sep 17 00:00:00 2001 From: adria0 Date: Thu, 16 May 2024 12:05:31 +0200 Subject: [PATCH 3/8] non-nightly --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 50a786567d..e12b6fbbe4 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -14,7 +14,7 @@ jobs: - name: Generate code coverage run: | - cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out xml + cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml - name: Upload to codecov.io uses: codecov/codecov-action@v2 From aa8bd468dc6d5ee4892559ba2af8ffa4b968d6c0 Mon Sep 17 00:00:00 2001 From: adria0 Date: Thu, 16 May 2024 12:25:25 +0200 Subject: [PATCH 4/8] Disable dhat when tarpaulin --- halo2_proofs/tests/frontend_backend_split.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/halo2_proofs/tests/frontend_backend_split.rs b/halo2_proofs/tests/frontend_backend_split.rs index 0c58069340..c1a620593f 100644 --- a/halo2_proofs/tests/frontend_backend_split.rs +++ b/halo2_proofs/tests/frontend_backend_split.rs @@ -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::{ @@ -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() From f693e9923375e4db3d95b5100f0dfa3ff1ae6b15 Mon Sep 17 00:00:00 2001 From: adria0 Date: Thu, 16 May 2024 15:47:00 +0200 Subject: [PATCH 5/8] Add codecov token --- .github/workflows/coverage.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index e12b6fbbe4..e15d30bdd1 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -17,6 +17,7 @@ jobs: cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml - name: Upload to codecov.io - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v4.0.1 with: + token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true From c560fd592d206e5e38374b1f6d3961bbb299ace7 Mon Sep 17 00:00:00 2001 From: adria0 Date: Thu, 16 May 2024 16:21:54 +0200 Subject: [PATCH 6/8] Add codecov workaround --- .github/workflows/coverage.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index e15d30bdd1..58080c5b8f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -15,9 +15,14 @@ jobs: - name: Generate code coverage run: | cargo tarpaulin --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/codecov-action@v4.0.1 with: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true + \ No newline at end of file From c9c620aa34395482d64028f06180c2cc2a489c86 Mon Sep 17 00:00:00 2001 From: adria0 Date: Thu, 16 May 2024 16:35:07 +0200 Subject: [PATCH 7/8] Update badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db13170372..b516829d31 100644 --- a/README.md +++ b/README.md @@ -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) From 04dbd3812103a59393f02b11eb3fae1b412c0cb0 Mon Sep 17 00:00:00 2001 From: adria0 Date: Thu, 16 May 2024 17:21:13 +0200 Subject: [PATCH 8/8] Add examples to coverage --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 58080c5b8f..2d24b246ce 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -14,7 +14,7 @@ jobs: - name: Generate code coverage run: | - cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml + cargo tarpaulin --tests --examples --verbose --all-features --workspace --timeout 120 --out xml - name: Workaround for codecov/feedback#263 run: |