From 45d1edd8e234f6c897db84390ffcd29c17c8be1d Mon Sep 17 00:00:00 2001 From: evenyag Date: Fri, 6 May 2022 15:39:24 +0800 Subject: [PATCH 1/2] ci: Add code coverage for pull requests --- .github/actions-rs/grcov.yml | 3 +++ .github/workflows/coverage.yml | 37 ++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/actions-rs/grcov.yml create mode 100644 .github/workflows/coverage.yml diff --git a/.github/actions-rs/grcov.yml b/.github/actions-rs/grcov.yml new file mode 100644 index 0000000000..9bf818aabe --- /dev/null +++ b/.github/actions-rs/grcov.yml @@ -0,0 +1,3 @@ +ignore-not-existing: true +output-type: lcov +output-path: ./lcov.info diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000000..4aafae0932 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,37 @@ +on: pull_request + +name: Code coverage + +env: + RUST_TOOLCHAIN: nightly-2022-04-03 + +jobs: + grcov: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + override: true + profile: minimal + - name: Execute tests + uses: actions-rs/cargo@v1 + with: + command: test + args: --workspace + env: + CARGO_INCREMENTAL: 0 + RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" + - name: Gather coverage data + id: coverage + uses: actions-rs/grcov@v0.1 + - name: Codecov upload + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./lcov.info + flags: rust + fail_ci_if_error: true + verbose: true From 4c4a150b3ab7c818a33107bf8336aca87f65c990 Mon Sep 17 00:00:00 2001 From: evenyag Date: Fri, 6 May 2022 16:25:21 +0800 Subject: [PATCH 2/2] docs: Add code coverage to README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f0e3488954..af3a6ae4c6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # GreptimeDB + +[![codecov](https://codecov.io/gh/GrepTimeTeam/greptimedb/branch/develop/graph/badge.svg?token=FITFDI3J3C)](https://codecov.io/gh/GrepTimeTeam/greptimedb) + GreptimeDB: the next-generation hybrid timeseries/analytics processing database in the cloud.