From d53d69aa6e51dfe2322064612898f3620463c3f0 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Tue, 21 Apr 2020 04:51:05 -0400 Subject: [PATCH] Tweak coverage job (#364) * Add step ids, better names * Split out Clippy to its own job * If coverage goes down, don't fail the build * Go back to tarpaulin * bump version of tarpaulin * config tarpaulin --- .github/workflows/main.yml | 53 +++++++++++++------------------------- codecov.yml | 15 +++++++++++ 2 files changed, 33 insertions(+), 35 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 53301d2b..b604f0ea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,51 +19,34 @@ jobs: BRANCH_NAME=${BRANCH_NAME,,} && \ gcloud builds submit . --config cloudbuild.yaml --project zealous-zebra --substitutions BRANCH_NAME=$BRANCH_NAME - - codecov: - name: Code Coverage & Clippy + grcov: + name: Code Coverage runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable override: true - - name: Cache cargo registry - uses: actions/cache@v1 + - name: Run cargo-tarpaulin + uses: actions-rs/tarpaulin@v0.1 with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo index - uses: actions/cache@v1 + version: '0.12.3' + timeout: 300 + - name: Upload coverage report to Codecov + uses: codecov/codecov-action@v1 + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo build - uses: actions/cache@v1 - with: - path: target - key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + toolchain: stable + override: true - name: Run clippy uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} args: --all-features - - name: Install cargo-tarpaulin - uses: actions-rs/cargo@v1 - with: - command: install - args: cargo-tarpaulin - - name: Generate coverage report - uses: actions-rs/cargo@v1 - with: - command: tarpaulin - args: --verbose --count --workspace --timeout 300 --out Xml - - name: Archive code coverage results - uses: actions/upload-artifact@v1 - with: - name: code-coverage-report - path: cobertura.xml - - uses: codecov/codecov-action@v1 - - diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..cf1e3396 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,15 @@ + +coverage: + range: "50...100" + status: + project: + default: + informational: true + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: yes + macro: yes