mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-22 22:20:02 +00:00
Merge pull request #17 from GrepTimeTeam/ci-code-coverage
ci: Add code coverage for pull requests
This commit is contained in:
3
.github/actions-rs/grcov.yml
vendored
Normal file
3
.github/actions-rs/grcov.yml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
ignore-not-existing: true
|
||||
output-type: lcov
|
||||
output-path: ./lcov.info
|
||||
37
.github/workflows/coverage.yml
vendored
Normal file
37
.github/workflows/coverage.yml
vendored
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user