File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Code coverage
2+ description : Generate code coverage and upload to codecov
3+ inputs :
4+ token :
5+ description : Codecov token
6+ required : true
7+
8+ runs :
9+ using : composite
10+ steps :
11+ - name : Install cargo-llvm-cov
12+ shell : bash
13+ run : cargo install cargo-llvm-cov
14+
15+ - name : Generate code coverage
16+ shell : bash
17+ run : cargo llvm-cov --codecov --output-path codecov.json
18+
19+ - name : Upload to codecov.io
20+ uses : codecov/codecov-action@v5
21+ with :
22+ token : ${{ inputs.token }}
23+ fail_ci_if_error : true
Original file line number Diff line number Diff line change 99 CARGO_TERM_COLOR : always
1010
1111jobs :
12- coverage :
13- name : Build and test with coverage
14- runs-on : ubuntu-latest
15- # Longer timeout because this job involves more steps
16- timeout-minutes : 20
17- env :
18- # Make warnings fatal
19- RUSTDOCFLAGS : -D warnings
20- steps :
21- - name : Checkout repository
22- uses : actions/checkout@v4
23-
24- - uses : actions-rust-lang/setup-rust-toolchain@v1
25- with :
26- toolchain : stable
27- - run : cargo test --verbose
28-
29- - name : Install cargo-llvm-cov
30- run : cargo install cargo-llvm-cov
31-
32- - name : Generate code coverage
33- run : |
34- cargo llvm-cov --codecov --output-path codecov.json
35-
36- - name : Upload to codecov.io
37- uses : codecov/codecov-action@v5
38- with :
39- token : ${{ secrets.CODECOV_TOKEN }}
40- fail_ci_if_error : true
41-
4212 build_and_test :
4313 name : Build and test
4414 runs-on : ${{ matrix.os }}
4515 timeout-minutes : 15
4616 strategy :
4717 fail-fast : false
4818 matrix :
49- os : [windows-latest, macos-latest]
19+ os : [ubuntu-latest, windows-latest, macos-latest]
5020 toolchain :
5121 - stable
5222 steps :
5525 with :
5626 toolchain : ${{ matrix.toolchain }}
5727 - run : cargo test --verbose
28+
29+ - if : ${{ matrix.os == 'ubuntu-latest' }}
30+ uses : ./.github/actions/codecov
31+ with :
32+ token : ${{ secrets.CODECOV_TOKEN }}
You can’t perform that action at this time.
0 commit comments