| 1 | name: Coverage |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [ "master" ] |
| 6 | pull_request: |
| 7 | branches: [ "master" ] |
| 8 | |
| 9 | jobs: |
| 10 | coveralls: |
| 11 | name: Coveralls GitHub Action |
| 12 | runs-on: ubuntu-latest |
| 13 | steps: |
| 14 | - uses: actions/checkout@v3 |
| 15 | |
| 16 | - name: Get toolchain |
| 17 | uses: actions-rs/toolchain@v1 |
| 18 | with: |
| 19 | profile: minimal |
| 20 | toolchain: nightly |
| 21 | override: true |
| 22 | |
| 23 | - name: Install grcov |
| 24 | uses: SierraSoftworks/setup-grcov@v1 |
| 25 | with: |
| 26 | github-token: ${{ secrets.GITHUB_TOKEN }} |
| 27 | version: latest |
| 28 | |
| 29 | - name: Run grcov |
| 30 | env: |
| 31 | PROJECT_NAME: "descape" |
| 32 | RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" |
| 33 | CARGO_INCREMENTAL: 0 |
| 34 | run: | |
| 35 | cargo build --verbose |
| 36 | cargo test --verbose |
| 37 | zip -0 cov.zip $(find . -name "$PROJECT_NAME*.gc*" -print) |
| 38 | grcov cov.zip -s . -t lcov --llvm --ignore-not-existing --ignore "/*" -o lcov.info |
| 39 | |
| 40 | - name: Push grcov results to Coveralls via GitHub Action |
| 41 | uses: coverallsapp/[email protected] |
| 42 | with: |
| 43 | github-token: ${{ secrets.GITHUB_TOKEN }} |
| 44 | path-to-lcov: "lcov.info" |