File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 84
84
- uses : crate-ci/typos@v1.24.1
85
85
with :
86
86
files : .
87
+
88
+ coverage :
89
+ if : ${{ !startsWith(github.head_ref, 'dependabot/') }}
90
+ runs-on : ubuntu-latest
91
+ env :
92
+ BEERUS_TEST_RUN : 1
93
+ BEERUS_TEST_STARKNET_URL : https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/v0_7/${{ secrets.ALCHEMY_KEY }}
94
+ steps :
95
+ - uses : actions/checkout@v3
96
+ - uses : dtolnay/rust-toolchain@stable
97
+ - uses : Swatinem/rust-cache@v2
98
+ - run : rm -rf /opt/hostedtoolcache
99
+ - name : Install Tarpaulin for code coverage
100
+ run : cargo install cargo-tarpaulin
101
+ # Exclude 'web' directory from coverage
102
+ - run : rm -rf ./web
103
+ - name : Run tests with coverage
104
+ run : cargo tarpaulin --out html
105
+ - name : View context attributes
106
+ uses : actions/github-script@v7
107
+ with :
108
+ script : console.log(context)
109
+ - name : Upload coverage to Codecov
110
+ uses : codecov/codecov-action@v4
111
+ with :
112
+ files : ./tarpaulin-report.html
113
+ # token: ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ use beerus::{
7
7
use tokio:: sync:: RwLock ;
8
8
use validator:: Validate ;
9
9
10
+ #[ cfg( not( tarpaulin_include) ) ] // exclude from coverage report
10
11
#[ tokio:: main]
11
12
async fn main ( ) -> eyre:: Result < ( ) > {
12
13
tracing_subscriber:: fmt:: init ( ) ;
@@ -56,6 +57,7 @@ async fn main() -> eyre::Result<()> {
56
57
Ok ( ( ) )
57
58
}
58
59
60
+ #[ cfg( not( tarpaulin_include) ) ] // exclude from coverage report
59
61
async fn get_config ( ) -> eyre:: Result < ServerConfig > {
60
62
let path = std:: env:: args ( ) . nth ( 1 ) ;
61
63
let config = if let Some ( path) = path {
Original file line number Diff line number Diff line change @@ -2,7 +2,10 @@ pub mod client;
2
2
pub mod config;
3
3
pub mod eth;
4
4
pub mod exe;
5
+
6
+ #[ cfg( not( tarpaulin_include) ) ] // exclude from coverage report
5
7
pub mod gen;
8
+
6
9
pub mod proof;
7
10
8
11
#[ cfg( not( target_arch = "wasm32" ) ) ]
You can’t perform that action at this time.
0 commit comments