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

Separate CI/CD workflows for math, ml, shared, and stats crates #57

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
56 changes: 56 additions & 0 deletions .github/workflows/ci-cs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI/CD

on:
push:
branches:
- chore/basic-ci-cd
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
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
run: |
# 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: |
# 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: |
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
56 changes: 56 additions & 0 deletions .github/workflows/ci-math.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
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 for implemented crates
run: |
# 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
# 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: |
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
56 changes: 56 additions & 0 deletions .github/workflows/ci-ml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI/CD

on:
push:
branches:
- chore/basic-ci-cd
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
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
run: |
# 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: |
# 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: |
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
56 changes: 56 additions & 0 deletions .github/workflows/ci-shared.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI/CD

on:
push:
branches:
- chore/basic-ci-cd
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
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
run: |
# 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: |
# 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: |
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
56 changes: 56 additions & 0 deletions .github/workflows/ci-stats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
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 for implemented crates
run: |
# 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
# 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: |
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
Loading