1- on : [push]
1+ on : [push, pull_request ]
22
33name : Code Coverage
44
55jobs :
6-
7- codecov :
6+ Codecov :
87 name : Code Coverage
98 runs-on : ubuntu-latest
109 env :
11- CARGO_INCREMENTAL : ' 0 '
12- RUSTFLAGS : ' -Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off '
13- RUSTDOCFLAGS : ' -Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off '
10+ RUSTFLAGS : " -Cinstrument-coverage "
11+ RUSTDOCFLAGS : " -Cinstrument-coverage "
12+ LLVM_PROFILE_FILE : " ./target/coverage/%p-%m.profraw "
1413
1514 steps :
1615 - name : Checkout
1716 uses : actions/checkout@v4
18-
19- - name : Install rustup
20- run : curl https://sh.rustup.rs -sSf | sh -s -- -y
21- - name : Set profile
22- run : rustup set profile minimal
23- - name : Update toolchain
24- run : rustup update
25- - name : Override the default toolchain
26- run : rustup override set nightly
27-
28-
29- - name : Test Compiler
30- run : cargo test --features compiler
31-
32- - name : Test Electrum
33- run : cargo test --features electrum
34-
35- - name : Test Esplora
36- run : cargo test --features esplora
37-
38- - name : Test Cbf
39- run : cargo test --features cbf
40-
41- - name : Test RPC
42- run : cargo test --features rpc
43-
44- - id : coverage
45- name : Generate coverage
46- uses :
actions-rs/[email protected] 47-
48- - name : Upload coverage to Codecov
49- uses : codecov/codecov-action@v2
5017 with :
51- file : ${{ steps.coverage.outputs.report }}
52- directory : ./coverage/reports/
18+ persist-credentials : false
19+ - name : Install lcov tools
20+ run : sudo apt-get install lcov -y
21+ - name : Install Rust toolchain
22+ uses : actions-rs/toolchain@v1
23+ with :
24+ toolchain : stable
25+ override : true
26+ profile : minimal
27+ components : llvm-tools-preview
28+ - name : Rust Cache
29+ 30+ - name : Install grcov
31+ run : if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi
32+ - name : Test
33+ run : cargo test --all-features
34+ - name : Make coverage directory
35+ run : mkdir coverage
36+ - name : Run grcov
37+ run : grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --keep-only './src/**' --ignore './tests/**' -o ./coverage/lcov.info
38+ # - name: Generate HTML coverage report
39+ # run: genhtml -o coverage-report.html --ignore-errors unmapped ./coverage/lcov.info
40+ # - name: Coveralls upload
41+ # uses: coverallsapp/github-action@master
42+ # with:
43+ # github-token: ${{ secrets.GITHUB_TOKEN }}
44+ - name : Check lcov.info
45+ run : cat ./coverage/lcov.info
46+ - name : Coveralls
47+ uses : coverallsapp/github-action@v2
48+ with :
49+ github-token : ${{ secrets.GITHUB_TOKEN }}
50+ file : ./coverage/lcov.info
51+ # - name: Upload artifact
52+ # uses: actions/upload-artifact@v4
53+ # with:
54+ # name: coverage-report
55+ # path: coverage-report.html
0 commit comments