diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 00000000..46b3feb1 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,15 @@ +# ref: https://docs.codecov.com/docs/codecovyml-reference +coverage: + range: 80..100 + round: down + precision: 1 + status: + # ref: https://docs.codecov.com/docs/commit-status + project: + default: + # Avoid false negatives + threshold: 1% + +ignore: + - "ffi" + - "benches" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a4164ef..a3175649 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,26 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} args: --all-features + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install stable + uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools-preview + - name: cargo install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: cargo generate-lockfile + if: hashFiles('Cargo.lock') == '' + run: cargo generate-lockfile + - name: cargo llvm-cov + run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info + - name: Upload to codecov.io + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true + build: name: Build library runs-on: ${{ matrix.os }}