From 743b6a691862297d4d4f63942678bb2431ac1405 Mon Sep 17 00:00:00 2001 From: yukang Date: Thu, 26 Aug 2021 13:55:54 +0000 Subject: [PATCH] add codecov --- .codecov.yml | 15 +++++++++++++++ .github/workflows/grcov.yml | 7 +++++++ .github/workflows/main.yml | 14 ++++++++++++++ README.md | 1 + 4 files changed, 37 insertions(+) create mode 100644 .codecov.yml create mode 100644 .github/workflows/grcov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..5a6d472c --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,15 @@ +--- +codecov: + notify: + after_n_builds: 1 + require_ci_to_pass: false + +coverage: + precision: 2 + round: down + range: 50..75 + +comment: + layout: "header, diff" + behavior: default + require_changes: false \ No newline at end of file diff --git a/.github/workflows/grcov.yml b/.github/workflows/grcov.yml new file mode 100644 index 00000000..1110ddcd --- /dev/null +++ b/.github/workflows/grcov.yml @@ -0,0 +1,7 @@ +branch: true +ignore-not-existing: true +llvm: true +filter: covered +output-type: lcov +output-path: ./lcov.info +prefix-dir: /home/user/build/ \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 60e82fdb..d8cd9c8f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,11 +61,25 @@ jobs: run: ./build.sh --release - name: Run tests run: cargo test + env: + CARGO_INCREMENTAL: '0' + RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests' + RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests' - name: Run doc tests run: cargo test --doc - name: Run cgroup tests working-directory: cgroups run: cargo test + env: + CARGO_INCREMENTAL: '0' + RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests' + RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests' + - name: Coverage + uses: actions-rs/grcov@v0.1 + with: + config: .github/grcov.yml + - name: Upload Results + uses: codecov/codecov-action@v2 integration_tests: runs-on: ubuntu-latest strategy: diff --git a/README.md b/README.md index 417cec79..a8ed5027 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![GitHub commit activity](https://img.shields.io/github/commit-activity/m/containers/youki)](https://github.com/containers/youki/graphs/commit-activity) [![GitHub contributors](https://img.shields.io/github/contributors/containers/youki)](https://github.com/containers/youki/graphs/contributors) [![Github CI](https://github.com/containers/youki/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/containers/youki/actions) +[![codecov](https://codecov.io/gh/containers/youki/branch/main/graph/badge.svg)](https://codecov.io/gh/containers/youki)