Skip to content

Commit

Permalink
WIP: feat(cov): use llvm-cov
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-melnychuk committed Oct 23, 2024
1 parent b24f5cc commit ffc244b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,24 +90,24 @@ jobs:
runs-on: ubuntu-latest
env:
BEERUS_TEST_RUN: 1
BEERUS_TEST_STARKNET_URL: https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/v0_7/${{ secrets.ALCHEMY_KEY }}
STARKNET_MAINNET_URL: https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/v0_7/${{ secrets.ALCHEMY_KEY }}
STARKNET_SEPOLIA_URL: https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/${{ secrets.ALCHEMY_KEY }}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: rm -rf /opt/hostedtoolcache
- name: Install Tarpaulin for code coverage
run: cargo install cargo-tarpaulin
# Exclude 'web' directory from coverage
- run: rm -rf ./web
- name: Run tests with coverage
run: cargo tarpaulin --out html
- name: View context attributes
uses: actions/github-script@v7
with:
script: console.log(context)
# - name: (Free disk space)
# run: rm -rf /opt/hostedtoolcache
- uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate coverage report
run: cargo llvm-cov --json --output-path coverage.json
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./tarpaulin-report.html
files: ./coverage.json
#token: ${{ secrets.CODECOV_TOKEN }}

# - name: View context attributes
# uses: actions/github-script@v7
# with:
# script: console.log(context)
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,3 @@ wiremock = "0.6.2"

[patch.crates-io]
starknet-core = { git = "https://github.com/kariy/starknet-rs", branch = "dojo-patch" }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] }
2 changes: 0 additions & 2 deletions src/bin/beerus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use beerus::{
use tokio::sync::RwLock;
use validator::Validate;

#[cfg(not(tarpaulin_include))] // exclude from coverage report
#[tokio::main]
async fn main() -> eyre::Result<()> {
tracing_subscriber::fmt::init();
Expand Down Expand Up @@ -57,7 +56,6 @@ async fn main() -> eyre::Result<()> {
Ok(())
}

#[cfg(not(tarpaulin_include))] // exclude from coverage report
async fn get_config() -> eyre::Result<ServerConfig> {
let path = std::env::args().nth(1);
let config = if let Some(path) = path {
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pub mod config;
pub mod eth;
pub mod exe;

#[cfg(not(tarpaulin_include))] // exclude from coverage report
pub mod gen;

pub mod proof;
Expand Down

0 comments on commit ffc244b

Please sign in to comment.