From 0050684ea2eb6ceb4bd48f13384e84b84c98ee4d Mon Sep 17 00:00:00 2001 From: Orion Yeung <11580988+orionyeung001@users.noreply.github.com> Date: Tue, 28 May 2024 16:08:00 -0500 Subject: [PATCH] coverage: introduce coverage with llvm-cov --- .github/workflows/coverage.yml | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 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 00000000..cb069b7e --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,38 @@ +name: Coverage + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + coverage: + name: Coverage + runs-on: ubuntu-latest + env: + RUSTFLAGS: -D warnings + CARGO_TERM_COLOR: always + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools-preview + + - uses: taiki-e/install-action@v2 + with: + tool: nextest + - uses: taiki-e/install-action@v2 + with: + tool: cargo-llvm-cov + + - name: Collect coverage + run: | + cargo llvm-cov --no-report nextest + cargo llvm-cov report --lcov --output-path lcov.info + + - name: Upload to codecov.io + uses: codecov/codecov-action@v4 + with: + files: lcov.info + token: ${{secrets.CODECOV_TOKEN}} + fail_ci_if_error: false