File tree Expand file tree Collapse file tree 2 files changed +59
-1
lines changed Expand file tree Collapse file tree 2 files changed +59
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Code Coverage 
2+ 
3+ on :
4+   push :
5+     branches : [ 
6+       " master" , 
7+       " test_ci" 
8+     ] 
9+   pull_request :
10+ 
11+ env :
12+   CARGO_TERM_COLOR : always 
13+ 
14+ jobs :
15+   coverage :
16+     name : Code Coverage 
17+     runs-on : ubuntu-latest 
18+     env :
19+       RUSTFLAGS : " -Cinstrument-coverage" 
20+       RUSTDOCFLAGS : " -Cinstrument-coverage" 
21+       LLVM_PROFILE_FILE : " ./target/coverage/%p-%m.profraw" 
22+ 
23+     steps :
24+       - name : Checkout 
25+         uses : actions/checkout@v4 
26+         with :
27+           persist-credentials : false 
28+       - name : Install lcov tools 
29+         run : sudo apt-get install lcov -y 
30+       - name : Install Rust toolchain 
31+         uses : dtolnay/rust-toolchain@v1 
32+         with :
33+             toolchain : stable 
34+             components : llvm-tools-preview 
35+       - name : Rust Cache 
36+ 37+       - name : Install grcov 
38+         run : if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi 
39+       - name : Test 
40+         run : cargo test --all-features 
41+       - name : Make coverage directory 
42+         run : mkdir coverage 
43+       - name : Run grcov 
44+         run : grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' --ignore '**/tests/**' --ignore '**/examples/**' -o ./coverage/lcov.info 
45+       - name : Generate HTML report 
46+         run : genhtml -o coverage-report -s --highlight --ignore-errors source --legend ./coverage/lcov.info 
47+       - name : Coveralls upload 
48+         uses : coverallsapp/github-action@master 
49+         with :
50+           github-token : ${{ secrets.GITHUB_TOKEN }} 
51+       - name : Upload artifact 
52+         uses : actions/upload-artifact@v4 
53+         with :
54+           name : coverage-report 
55+           path : ./coverage/lcov.info 
Original file line number Diff line number Diff line change @@ -2,7 +2,10 @@ name: CI
22
33on :
44  push :
5-     branches : [ "master" ] 
5+     branches : [ 
6+       " master" , 
7+       " test_ci" , 
8+     ] 
69  pull_request :
710
811env :
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments