diff --git a/.github/actions-rs/grcov.yml b/.github/actions-rs/grcov.yml new file mode 100644 index 00000000..970a6a99 --- /dev/null +++ b/.github/actions-rs/grcov.yml @@ -0,0 +1,8 @@ +branch: true +ignore-not-existing: true +llvm: true +output-type: lcov +ignore: + - "/*" + - "C:/*" + - "../*" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..1fbfaa4f --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,47 @@ +name: Test coverage + +on: + push: + branches: + - main + - dev + pull_request: + branches: + - dev + paths-ignore: + - 'docs/**' + - 'spec/**' + +jobs: + collect-coverage: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Run tests + uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features --no-fail-fast + env: + CARGO_INCREMENTAL: 0 + RUSTC_BOOTSTRAP: 1 + RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests" + RUSTDOCFLAGS: "-Cpanic=abort" + + - name: Collect test coverage data + uses: actions-rs/grcov@v0.1 + id: coverage + + - name: Upload coverage data to Coveralls + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: ${{ steps.coverage.outputs.report }}