diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..19e75340 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,32 @@ +name: Code Coverage +on: + push: + branches: [main] + +permissions: + id-token: write + contents: read + +jobs: + coverage: + name: Coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools-preview + - uses: Swatinem/rust-cache@v2 + with: + key: coverage + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Generate coverage + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + - name: Upload to Codecov + uses: codecov/codecov-action@v5 + with: + files: lcov.info + disable_search: true + use_oidc: true + fail_ci_if_error: true diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..3e31b00a --- /dev/null +++ b/codecov.yml @@ -0,0 +1,10 @@ +coverage: + status: + project: + default: + target: auto + threshold: 1% + patch: + default: + target: 80% + threshold: 5% \ No newline at end of file