From ec6dca965f87837f0064adb1be6069d15ca1d198 Mon Sep 17 00:00:00 2001 From: Eguzki Astiz Lezaun Date: Wed, 20 Sep 2023 10:14:01 +0200 Subject: [PATCH] coverage test only on main branch --- .github/workflows/coverage.yml | 64 ++++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 16 +++------ 2 files changed, 68 insertions(+), 12 deletions(-) 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..53917d04 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,64 @@ +--- +name: Coverage + +on: + push: + branches: + - '*' + +jobs: + check: + name: Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: abelfodil/protoc-action@v1 + with: + protoc-version: '3.19.4' + - uses: actions-rs/cargo@v1 + with: + command: check + + test: + name: Test Suite + runs-on: ubuntu-latest + services: + infinispan: + image: infinispan/server:11.0.9.Final + ports: + - 11222:11222 + env: + USER: username + PASS: password + steps: + - uses: actions/checkout@v2 + - uses: supercharge/redis-github-action@1.1.0 + with: + redis-version: 5 + # Nightly is required for code coverage with doctests + # https://github.com/taiki-e/cargo-llvm-cov/issues/2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - uses: abelfodil/protoc-action@v1 + with: + protoc-version: '3.19.4' + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Test and Generate code coverage + run: cargo +nightly llvm-cov --all-features --workspace --lcov --doctests --output-path lcov.info + - name: Codecov + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + if: env.CODECOV_TOKEN != null + uses: codecov/codecov-action@v3 + with: + verbose: true + fail_ci_if_error: false diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6612ea85..24e66682 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -50,23 +50,15 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly + toolchain: stable override: true - uses: abelfodil/protoc-action@v1 with: protoc-version: '3.19.4' - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov - - name: Test and Generate code coverage - run: cargo +nightly llvm-cov --all-features --workspace --lcov --doctests --output-path lcov.info - - name: Codecov - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - if: env.CODECOV_TOKEN != null - uses: codecov/codecov-action@v3 + - uses: actions-rs/cargo@v1 with: - verbose: true - fail_ci_if_error: false + command: test + args: --all-features -vv fmt: name: Rustfmt