| 1 | name: Test coverage |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - main |
| 7 | pull_request: |
| 8 | |
| 9 | env: |
| 10 | CARGO_TERM_COLOR: always |
| 11 | RUST_BACKTRACE: full |
| 12 | |
| 13 | jobs: |
| 14 | coverage: |
| 15 | name: Coverage |
| 16 | runs-on: ubuntu-latest |
| 17 | steps: |
| 18 | - name: Checkout repository |
| 19 | uses: actions/checkout@v4 |
| 20 | |
| 21 | - name: Install Rust |
| 22 | uses: actions-rs/toolchain@v1 |
| 23 | with: |
| 24 | toolchain: nightly |
| 25 | profile: minimal |
| 26 | default: true |
| 27 | |
| 28 | - name: Restore cache |
| 29 | uses: Swatinem/rust-cache@v2 |
| 30 | |
| 31 | - name: Run cargo-tarpaulin |
| 32 | uses: actions-rs/[email protected] |
| 33 | with: |
| 34 | args: '--all-features --run-types Doctests,Tests' |
| 35 | timeout: 120 |
| 36 | |
| 37 | - name: Upload to codecov.io |
| 38 | uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d |
| 39 | with: |
| 40 | token: ${{ secrets.CODECOV_TOKEN }} |
| 41 | |
| 42 | - name: Archive code coverage results |
| 43 | uses: actions/upload-artifact@v3 |
| 44 | with: |
| 45 | name: code-coverage-report |
| 46 | path: cobertura.xml |
| 47 | retention-days: 30 |