From 1834f988033bcaee1538172fd0ad0e9f868ef3b0 Mon Sep 17 00:00:00 2001 From: Brad Edwards Date: Thu, 2 Jan 2025 07:36:13 +0000 Subject: [PATCH 1/8] Add CI/CD workflow for unit tests and coverage check --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..20212de --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ + +name: CI/CD + +on: + push: + branches: + - chore/basic-ci-cd + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Install dependencies + run: sudo apt-get install lcov + - name: Run tests + run: | + cargo test --manifest-path crates/cs/Cargo.toml + - name: Generate coverage report + run: | + cargo install cargo-tarpaulin + cargo tarpaulin --out Xml --manifest-path crates/cs/Cargo.toml + - name: Check coverage + run: | + bash <(curl -s https://codecov.io/bash) -f lcov.info + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Fail if coverage is below 90% + run: | + bash <(curl -s https://codecov.io/bash) -f lcov.info + if [ $(lcov --summary lcov.info | grep -Eo '[0-9]+\.[0-9]+' | head -1) -lt 90 ]; then + echo "Coverage is below 90%"; + exit 1; + fi From ea9c38019c7012f1b3f404c12e821c188a265449 Mon Sep 17 00:00:00 2001 From: Brad Edwards Date: Thu, 2 Jan 2025 07:49:51 +0000 Subject: [PATCH 2/8] Switch to cargo-llvm-cov for coverage reporting --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20212de..5d9aeee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,8 @@ jobs: cargo test --manifest-path crates/cs/Cargo.toml - name: Generate coverage report run: | - cargo install cargo-tarpaulin - cargo tarpaulin --out Xml --manifest-path crates/cs/Cargo.toml + cargo install cargo-llvm-cov + cargo llvm-cov --manifest-path crates/cs/blocks-cs-core/Cargo.toml --lcov --output-path lcov.info - name: Check coverage run: | bash <(curl -s https://codecov.io/bash) -f lcov.info From 05e0d65db2a5c1dbdff78e09a9b3ab5b2e98a085 Mon Sep 17 00:00:00 2001 From: Brad Edwards Date: Thu, 2 Jan 2025 08:41:26 +0000 Subject: [PATCH 3/8] Update workflow to test all crates in crates/cs --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d9aeee..03cdcdd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,10 @@ jobs: - name: Generate coverage report run: | cargo install cargo-llvm-cov - cargo llvm-cov --manifest-path crates/cs/blocks-cs-core/Cargo.toml --lcov --output-path lcov.info + for toml in $(find crates/cs -name "Cargo.toml"); do + echo "Running tests for $toml" + cargo llvm-cov --manifest-path $toml --lcov --output-path lcov.info + done - name: Check coverage run: | bash <(curl -s https://codecov.io/bash) -f lcov.info From 7a50182d89e83839c20a14d88c9adaa4177f8849 Mon Sep 17 00:00:00 2001 From: Brad Edwards Date: Thu, 2 Jan 2025 08:46:48 +0000 Subject: [PATCH 4/8] Set up separate CI/CD workflows for math, ml, shared, and stats crates --- .github/workflows/ci-math.yml | 46 +++++++++++++++++++++++++++++++++ .github/workflows/ci-ml.yml | 46 +++++++++++++++++++++++++++++++++ .github/workflows/ci-shared.yml | 46 +++++++++++++++++++++++++++++++++ .github/workflows/ci-stats.yml | 46 +++++++++++++++++++++++++++++++++ 4 files changed, 184 insertions(+) create mode 100644 .github/workflows/ci-math.yml create mode 100644 .github/workflows/ci-ml.yml create mode 100644 .github/workflows/ci-shared.yml create mode 100644 .github/workflows/ci-stats.yml diff --git a/.github/workflows/ci-math.yml b/.github/workflows/ci-math.yml new file mode 100644 index 0000000..e06ce6e --- /dev/null +++ b/.github/workflows/ci-math.yml @@ -0,0 +1,46 @@ + +name: CI/CD + +on: + push: + branches: + - chore/basic-ci-cd + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Install dependencies + run: sudo apt-get install lcov + - name: Run tests + run: | + cargo test --manifest-path crates/cs/Cargo.toml + - name: Generate coverage report + run: | + cargo install cargo-llvm-cov + for toml in $(find crates/math -name "Cargo.toml"); do + echo "Running tests for $toml" + cargo llvm-cov --manifest-path $toml --lcov --output-path lcov.info + done + - name: Check coverage + run: | + bash <(curl -s https://codecov.io/bash) -f lcov.info + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Fail if coverage is below 90% + run: | + bash <(curl -s https://codecov.io/bash) -f lcov.info + if [ $(lcov --summary lcov.info | grep -Eo '[0-9]+\.[0-9]+' | head -1) -lt 90 ]; then + echo "Coverage is below 90%"; + exit 1; + fi diff --git a/.github/workflows/ci-ml.yml b/.github/workflows/ci-ml.yml new file mode 100644 index 0000000..cdb6a59 --- /dev/null +++ b/.github/workflows/ci-ml.yml @@ -0,0 +1,46 @@ + +name: CI/CD + +on: + push: + branches: + - chore/basic-ci-cd + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Install dependencies + run: sudo apt-get install lcov + - name: Run tests + run: | + cargo test --manifest-path crates/cs/Cargo.toml + - name: Generate coverage report + run: | + cargo install cargo-llvm-cov + for toml in $(find crates/ml -name "Cargo.toml"); do + echo "Running tests for $toml" + cargo llvm-cov --manifest-path $toml --lcov --output-path lcov.info + done + - name: Check coverage + run: | + bash <(curl -s https://codecov.io/bash) -f lcov.info + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Fail if coverage is below 90% + run: | + bash <(curl -s https://codecov.io/bash) -f lcov.info + if [ $(lcov --summary lcov.info | grep -Eo '[0-9]+\.[0-9]+' | head -1) -lt 90 ]; then + echo "Coverage is below 90%"; + exit 1; + fi diff --git a/.github/workflows/ci-shared.yml b/.github/workflows/ci-shared.yml new file mode 100644 index 0000000..9c5543c --- /dev/null +++ b/.github/workflows/ci-shared.yml @@ -0,0 +1,46 @@ + +name: CI/CD + +on: + push: + branches: + - chore/basic-ci-cd + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Install dependencies + run: sudo apt-get install lcov + - name: Run tests + run: | + cargo test --manifest-path crates/cs/Cargo.toml + - name: Generate coverage report + run: | + cargo install cargo-llvm-cov + for toml in $(find crates/shared -name "Cargo.toml"); do + echo "Running tests for $toml" + cargo llvm-cov --manifest-path $toml --lcov --output-path lcov.info + done + - name: Check coverage + run: | + bash <(curl -s https://codecov.io/bash) -f lcov.info + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Fail if coverage is below 90% + run: | + bash <(curl -s https://codecov.io/bash) -f lcov.info + if [ $(lcov --summary lcov.info | grep -Eo '[0-9]+\.[0-9]+' | head -1) -lt 90 ]; then + echo "Coverage is below 90%"; + exit 1; + fi diff --git a/.github/workflows/ci-stats.yml b/.github/workflows/ci-stats.yml new file mode 100644 index 0000000..1604b47 --- /dev/null +++ b/.github/workflows/ci-stats.yml @@ -0,0 +1,46 @@ + +name: CI/CD + +on: + push: + branches: + - chore/basic-ci-cd + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Install dependencies + run: sudo apt-get install lcov + - name: Run tests + run: | + cargo test --manifest-path crates/cs/Cargo.toml + - name: Generate coverage report + run: | + cargo install cargo-llvm-cov + for toml in $(find crates/stats -name "Cargo.toml"); do + echo "Running tests for $toml" + cargo llvm-cov --manifest-path $toml --lcov --output-path lcov.info + done + - name: Check coverage + run: | + bash <(curl -s https://codecov.io/bash) -f lcov.info + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Fail if coverage is below 90% + run: | + bash <(curl -s https://codecov.io/bash) -f lcov.info + if [ $(lcov --summary lcov.info | grep -Eo '[0-9]+\.[0-9]+' | head -1) -lt 90 ]; then + echo "Coverage is below 90%"; + exit 1; + fi From bdce52bcbac5331853dbc9c6abcda4589d9c2306 Mon Sep 17 00:00:00 2001 From: Brad Edwards Date: Thu, 2 Jan 2025 08:47:52 +0000 Subject: [PATCH 5/8] Rename ci.yml to ci-cs.yml --- .github/workflows/ci-cs.yml | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/ci-cs.yml diff --git a/.github/workflows/ci-cs.yml b/.github/workflows/ci-cs.yml new file mode 100644 index 0000000..03cdcdd --- /dev/null +++ b/.github/workflows/ci-cs.yml @@ -0,0 +1,46 @@ + +name: CI/CD + +on: + push: + branches: + - chore/basic-ci-cd + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Install dependencies + run: sudo apt-get install lcov + - name: Run tests + run: | + cargo test --manifest-path crates/cs/Cargo.toml + - name: Generate coverage report + run: | + cargo install cargo-llvm-cov + for toml in $(find crates/cs -name "Cargo.toml"); do + echo "Running tests for $toml" + cargo llvm-cov --manifest-path $toml --lcov --output-path lcov.info + done + - name: Check coverage + run: | + bash <(curl -s https://codecov.io/bash) -f lcov.info + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Fail if coverage is below 90% + run: | + bash <(curl -s https://codecov.io/bash) -f lcov.info + if [ $(lcov --summary lcov.info | grep -Eo '[0-9]+\.[0-9]+' | head -1) -lt 90 ]; then + echo "Coverage is below 90%"; + exit 1; + fi From 81a53667067c27ce916fe9b72f6b1fff22ac85fa Mon Sep 17 00:00:00 2001 From: Brad Edwards Date: Sat, 11 Jan 2025 08:50:35 -0800 Subject: [PATCH 6/8] Fix path issue in workflows --- .github/workflows/ci-cs.yml | 6 ++++-- .github/workflows/ci-math.yml | 6 ++++-- .github/workflows/ci-ml.yml | 6 ++++-- .github/workflows/ci-stats.yml | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-cs.yml b/.github/workflows/ci-cs.yml index 03cdcdd..2e46ae9 100644 --- a/.github/workflows/ci-cs.yml +++ b/.github/workflows/ci-cs.yml @@ -1,4 +1,3 @@ - name: CI/CD on: @@ -24,7 +23,10 @@ jobs: run: sudo apt-get install lcov - name: Run tests run: | - cargo test --manifest-path crates/cs/Cargo.toml + for toml in $(find crates/cs -name "Cargo.toml"); do + echo "Running tests for $toml" + cargo test --manifest-path $toml + done - name: Generate coverage report run: | cargo install cargo-llvm-cov diff --git a/.github/workflows/ci-math.yml b/.github/workflows/ci-math.yml index e06ce6e..0ed38f6 100644 --- a/.github/workflows/ci-math.yml +++ b/.github/workflows/ci-math.yml @@ -1,4 +1,3 @@ - name: CI/CD on: @@ -24,7 +23,10 @@ jobs: run: sudo apt-get install lcov - name: Run tests run: | - cargo test --manifest-path crates/cs/Cargo.toml + for toml in $(find crates/cs -name "Cargo.toml"); do + echo "Running tests for $toml" + cargo test --manifest-path $toml + done - name: Generate coverage report run: | cargo install cargo-llvm-cov diff --git a/.github/workflows/ci-ml.yml b/.github/workflows/ci-ml.yml index cdb6a59..9ba3fdf 100644 --- a/.github/workflows/ci-ml.yml +++ b/.github/workflows/ci-ml.yml @@ -1,4 +1,3 @@ - name: CI/CD on: @@ -24,7 +23,10 @@ jobs: run: sudo apt-get install lcov - name: Run tests run: | - cargo test --manifest-path crates/cs/Cargo.toml + for toml in $(find crates/ml -name "Cargo.toml"); do + echo "Running tests for $toml" + cargo test --manifest-path $toml + done - name: Generate coverage report run: | cargo install cargo-llvm-cov diff --git a/.github/workflows/ci-stats.yml b/.github/workflows/ci-stats.yml index 1604b47..c52b94e 100644 --- a/.github/workflows/ci-stats.yml +++ b/.github/workflows/ci-stats.yml @@ -1,4 +1,3 @@ - name: CI/CD on: @@ -24,7 +23,10 @@ jobs: run: sudo apt-get install lcov - name: Run tests run: | - cargo test --manifest-path crates/cs/Cargo.toml + for toml in $(find crates/stats -name "Cargo.toml"); do + echo "Running tests for $toml" + cargo test --manifest-path $toml + done - name: Generate coverage report run: | cargo install cargo-llvm-cov From 8dbb1aeb5c49acc3e521312515b3a5d87e805a74 Mon Sep 17 00:00:00 2001 From: Brad Edwards Date: Sat, 11 Jan 2025 09:11:10 -0800 Subject: [PATCH 7/8] Update search for creates --- .github/workflows/ci-cs.yml | 22 +++++++++++----- .github/workflows/ci-math.yml | 22 +++++++++++----- .github/workflows/ci-ml.yml | 22 +++++++++++----- .github/workflows/ci-shared.yml | 22 +++++++++++----- .github/workflows/ci-stats.yml | 22 +++++++++++----- .github/workflows/ci.yml | 46 --------------------------------- 6 files changed, 76 insertions(+), 80 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci-cs.yml b/.github/workflows/ci-cs.yml index 2e46ae9..3a430d8 100644 --- a/.github/workflows/ci-cs.yml +++ b/.github/workflows/ci-cs.yml @@ -21,18 +21,26 @@ jobs: override: true - name: Install dependencies run: sudo apt-get install lcov - - name: Run tests + - name: Run tests for implemented crates run: | - for toml in $(find crates/cs -name "Cargo.toml"); do - echo "Running tests for $toml" - cargo test --manifest-path $toml + # First, find all implemented crates (those with src directory) + for crate_dir in crates/cs/blocks-cs-*/; do + if [ -d "${crate_dir}src" ]; then + echo "Testing implemented crate: ${crate_dir}" + cargo test --manifest-path "${crate_dir}Cargo.toml" + else + echo "Skipping unimplemented crate: ${crate_dir}" + fi done - name: Generate coverage report run: | cargo install cargo-llvm-cov - for toml in $(find crates/cs -name "Cargo.toml"); do - echo "Running tests for $toml" - cargo llvm-cov --manifest-path $toml --lcov --output-path lcov.info + # Only generate coverage for implemented crates + for crate_dir in crates/cs/blocks-cs-*/; do + if [ -d "${crate_dir}src" ]; then + echo "Generating coverage for: ${crate_dir}" + cargo llvm-cov --manifest-path "${crate_dir}Cargo.toml" --lcov --output-path lcov.info + fi done - name: Check coverage run: | diff --git a/.github/workflows/ci-math.yml b/.github/workflows/ci-math.yml index 0ed38f6..d07383a 100644 --- a/.github/workflows/ci-math.yml +++ b/.github/workflows/ci-math.yml @@ -21,18 +21,26 @@ jobs: override: true - name: Install dependencies run: sudo apt-get install lcov - - name: Run tests + - name: Run tests for implemented crates run: | - for toml in $(find crates/cs -name "Cargo.toml"); do - echo "Running tests for $toml" - cargo test --manifest-path $toml + # First, find all implemented crates (those with src directory) + for crate_dir in crates/math/blocks-math-*/; do + if [ -d "${crate_dir}src" ]; then + echo "Testing implemented crate: ${crate_dir}" + cargo test --manifest-path "${crate_dir}Cargo.toml" + else + echo "Skipping unimplemented crate: ${crate_dir}" + fi done - name: Generate coverage report run: | cargo install cargo-llvm-cov - for toml in $(find crates/math -name "Cargo.toml"); do - echo "Running tests for $toml" - cargo llvm-cov --manifest-path $toml --lcov --output-path lcov.info + # Only generate coverage for implemented crates + for crate_dir in crates/math/blocks-math-*/; do + if [ -d "${crate_dir}src" ]; then + echo "Generating coverage for: ${crate_dir}" + cargo llvm-cov --manifest-path "${crate_dir}Cargo.toml" --lcov --output-path lcov.info + fi done - name: Check coverage run: | diff --git a/.github/workflows/ci-ml.yml b/.github/workflows/ci-ml.yml index 9ba3fdf..e5c5bb8 100644 --- a/.github/workflows/ci-ml.yml +++ b/.github/workflows/ci-ml.yml @@ -21,18 +21,26 @@ jobs: override: true - name: Install dependencies run: sudo apt-get install lcov - - name: Run tests + - name: Run tests for implemented crates run: | - for toml in $(find crates/ml -name "Cargo.toml"); do - echo "Running tests for $toml" - cargo test --manifest-path $toml + # First, find all implemented crates (those with src directory) + for crate_dir in crates/ml/blocks-ml-*/; do + if [ -d "${crate_dir}src" ]; then + echo "Testing implemented crate: ${crate_dir}" + cargo test --manifest-path "${crate_dir}Cargo.toml" + else + echo "Skipping unimplemented crate: ${crate_dir}" + fi done - name: Generate coverage report run: | cargo install cargo-llvm-cov - for toml in $(find crates/ml -name "Cargo.toml"); do - echo "Running tests for $toml" - cargo llvm-cov --manifest-path $toml --lcov --output-path lcov.info + # Only generate coverage for implemented crates + for crate_dir in crates/ml/blocks-ml-*/; do + if [ -d "${crate_dir}src" ]; then + echo "Generating coverage for: ${crate_dir}" + cargo llvm-cov --manifest-path "${crate_dir}Cargo.toml" --lcov --output-path lcov.info + fi done - name: Check coverage run: | diff --git a/.github/workflows/ci-shared.yml b/.github/workflows/ci-shared.yml index 9c5543c..d4be06e 100644 --- a/.github/workflows/ci-shared.yml +++ b/.github/workflows/ci-shared.yml @@ -1,4 +1,3 @@ - name: CI/CD on: @@ -22,15 +21,26 @@ jobs: override: true - name: Install dependencies run: sudo apt-get install lcov - - name: Run tests + - name: Run tests for implemented crates run: | - cargo test --manifest-path crates/cs/Cargo.toml + # First, find all implemented crates (those with src directory) + for crate_dir in crates/shared/blocks-shared-*/; do + if [ -d "${crate_dir}src" ]; then + echo "Testing implemented crate: ${crate_dir}" + cargo test --manifest-path "${crate_dir}Cargo.toml" + else + echo "Skipping unimplemented crate: ${crate_dir}" + fi + done - name: Generate coverage report run: | cargo install cargo-llvm-cov - for toml in $(find crates/shared -name "Cargo.toml"); do - echo "Running tests for $toml" - cargo llvm-cov --manifest-path $toml --lcov --output-path lcov.info + # Only generate coverage for implemented crates + for crate_dir in crates/shared/blocks-shared-*/; do + if [ -d "${crate_dir}src" ]; then + echo "Generating coverage for: ${crate_dir}" + cargo llvm-cov --manifest-path "${crate_dir}Cargo.toml" --lcov --output-path lcov.info + fi done - name: Check coverage run: | diff --git a/.github/workflows/ci-stats.yml b/.github/workflows/ci-stats.yml index c52b94e..fcc3b91 100644 --- a/.github/workflows/ci-stats.yml +++ b/.github/workflows/ci-stats.yml @@ -21,18 +21,26 @@ jobs: override: true - name: Install dependencies run: sudo apt-get install lcov - - name: Run tests + - name: Run tests for implemented crates run: | - for toml in $(find crates/stats -name "Cargo.toml"); do - echo "Running tests for $toml" - cargo test --manifest-path $toml + # First, find all implemented crates (those with src directory) + for crate_dir in crates/stats/blocks-stats-*/; do + if [ -d "${crate_dir}src" ]; then + echo "Testing implemented crate: ${crate_dir}" + cargo test --manifest-path "${crate_dir}Cargo.toml" + else + echo "Skipping unimplemented crate: ${crate_dir}" + fi done - name: Generate coverage report run: | cargo install cargo-llvm-cov - for toml in $(find crates/stats -name "Cargo.toml"); do - echo "Running tests for $toml" - cargo llvm-cov --manifest-path $toml --lcov --output-path lcov.info + # Only generate coverage for implemented crates + for crate_dir in crates/stats/blocks-stats-*/; do + if [ -d "${crate_dir}src" ]; then + echo "Generating coverage for: ${crate_dir}" + cargo llvm-cov --manifest-path "${crate_dir}Cargo.toml" --lcov --output-path lcov.info + fi done - name: Check coverage run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 03cdcdd..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,46 +0,0 @@ - -name: CI/CD - -on: - push: - branches: - - chore/basic-ci-cd - pull_request: - branches: - - main - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - name: Install dependencies - run: sudo apt-get install lcov - - name: Run tests - run: | - cargo test --manifest-path crates/cs/Cargo.toml - - name: Generate coverage report - run: | - cargo install cargo-llvm-cov - for toml in $(find crates/cs -name "Cargo.toml"); do - echo "Running tests for $toml" - cargo llvm-cov --manifest-path $toml --lcov --output-path lcov.info - done - - name: Check coverage - run: | - bash <(curl -s https://codecov.io/bash) -f lcov.info - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - name: Fail if coverage is below 90% - run: | - bash <(curl -s https://codecov.io/bash) -f lcov.info - if [ $(lcov --summary lcov.info | grep -Eo '[0-9]+\.[0-9]+' | head -1) -lt 90 ]; then - echo "Coverage is below 90%"; - exit 1; - fi From e8e38dceea172fb3ef2b3a7db279c91e6d0a9855 Mon Sep 17 00:00:00 2001 From: Brad Edwards Date: Tue, 14 Jan 2025 00:16:16 -0800 Subject: [PATCH 8/8] WIP --- .github/workflows/ci-cs.yml | 12 ++++++------ .github/workflows/ci-ml.yml | 12 ++++++------ .github/workflows/ci-shared.yml | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci-cs.yml b/.github/workflows/ci-cs.yml index 3a430d8..b0aa879 100644 --- a/.github/workflows/ci-cs.yml +++ b/.github/workflows/ci-cs.yml @@ -13,12 +13,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Rust - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - override: true + components: llvm-tools-preview + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov - name: Install dependencies run: sudo apt-get install lcov - name: Run tests for implemented crates @@ -34,7 +35,6 @@ jobs: done - name: Generate coverage report run: | - cargo install cargo-llvm-cov # Only generate coverage for implemented crates for crate_dir in crates/cs/blocks-cs-*/; do if [ -d "${crate_dir}src" ]; then diff --git a/.github/workflows/ci-ml.yml b/.github/workflows/ci-ml.yml index e5c5bb8..433f35b 100644 --- a/.github/workflows/ci-ml.yml +++ b/.github/workflows/ci-ml.yml @@ -13,12 +13,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Rust - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - override: true + components: llvm-tools-preview + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov - name: Install dependencies run: sudo apt-get install lcov - name: Run tests for implemented crates @@ -34,7 +35,6 @@ jobs: done - name: Generate coverage report run: | - cargo install cargo-llvm-cov # Only generate coverage for implemented crates for crate_dir in crates/ml/blocks-ml-*/; do if [ -d "${crate_dir}src" ]; then diff --git a/.github/workflows/ci-shared.yml b/.github/workflows/ci-shared.yml index d4be06e..c737840 100644 --- a/.github/workflows/ci-shared.yml +++ b/.github/workflows/ci-shared.yml @@ -13,12 +13,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Rust - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - override: true + components: llvm-tools-preview + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov - name: Install dependencies run: sudo apt-get install lcov - name: Run tests for implemented crates @@ -34,7 +35,6 @@ jobs: done - name: Generate coverage report run: | - cargo install cargo-llvm-cov # Only generate coverage for implemented crates for crate_dir in crates/shared/blocks-shared-*/; do if [ -d "${crate_dir}src" ]; then