From 63020a0f486c2218dffe9159642725a3bd8e90ec Mon Sep 17 00:00:00 2001 From: ethicnology Date: Thu, 14 Nov 2024 10:39:14 -0500 Subject: [PATCH] feat: code coverage --- .github/workflows/coverage.yml | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..ffce321 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,39 @@ +name: coverage + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + check: + name: Rust project + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + + - name: Build + run: cargo build --verbose + + - name: Run tests + run: cargo test --verbose + env: + CARGO_INCREMENTAL: '0' + RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' + RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' + + - name: rust-grcov + uses: actions-rs/grcov@v0.1 + + - name: Upload to codecov.io + uses: codecov/codecov-action@v4 + with: + token: ${{secrets.CODECOV_TOKEN}}