From 9455008828284780b39781ebe5e096dd11ddfeda Mon Sep 17 00:00:00 2001 From: blu3beri Date: Fri, 10 Mar 2023 09:18:16 +0100 Subject: [PATCH] build: added code coverage report Signed-off-by: blu3beri --- .github/workflows/code-coverage.yml | 30 +++++++++++++++++++++++++++++ .github/workflows/lint.yml | 11 +++++------ 2 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/code-coverage.yml diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml new file mode 100644 index 00000000..7ce86f83 --- /dev/null +++ b/.github/workflows/code-coverage.yml @@ -0,0 +1,30 @@ +name: Code Coverage + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + + - name: Generate code coverage + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: lcov.info + fail_ci_if_error: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 60683a19..bacbbe89 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,12 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable - uses: actions-rs/toolchain@v1 with: - toolchain: stable components: clippy - override: true - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features + + - name: Clippy + run: clippy