From 4235b57cd87967283899a4761a3d6656952dc3bb Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Fri, 9 Jun 2023 11:00:27 -0700 Subject: [PATCH] build: make codecov reports consistent/not confusing (#6734) * build: codecov config * build: better codecov * build: omit default * build: sensical codecov * build: upload-artifact * build: customize codecov comment * build: try again * build: try again * build: turn off status except flags * build: flag comments * build: changes on * build: simplify * build: after_n for comment --- .github/workflows/test.yml | 9 ++++++--- codecov.yml | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 63193ce3c4..6200013856 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -78,7 +78,6 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false - verbose: true flags: unit-tests - if: failure() && github.ref_name == 'main' uses: ./.github/actions/report @@ -100,7 +99,7 @@ jobs: - run: yarn build:e2e env: NODE_OPTIONS: "--max_old_space_size=4096" - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: build-e2e path: build @@ -166,7 +165,11 @@ jobs: COMMIT_INFO_TIMESTAMP: ${{ github.event.pull_request.updated_at || github.event.head_commit.timestamp }} CYPRESS_PULL_REQUEST_ID: ${{ github.event.pull_request.number }} CYPRESS_PULL_REQUEST_URL: ${{ github.event.pull_request.html_url }} - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false + flags: e2e-tests - if: failure() && github.ref_name == 'main' uses: ./.github/actions/report with: diff --git a/codecov.yml b/codecov.yml index 7482a5af89..00c2dc6ac1 100644 --- a/codecov.yml +++ b/codecov.yml @@ -9,17 +9,38 @@ ignore: - "**/constants/**/*" - "constants/**/*" +coverage: + status: + # Omit merging unit/e2e reports into the defaults, as it is nonsensical. + project: off + patch: off + flag_management: default_rules: statuses: - type: project target: auto threshold: 1% + # Adjust the base when removing code to avoid penalizing tech debt payback / dead code removal. + removed_code_behavior: adjust_base if_ci_failed: error - type: patch target: 80% individual_flags: + - name: unit-tests - name: e2e-tests + # Wait until all machines have reported coverage - e2e tests run across 4 machines. + after_n_builds: 4 statuses: - type: patch target: 0% + +comment: + layout: flags + # Wait until all machines have reported coverage - e2e tests run across 4 machines + unit tests across 1. + after_n_builds: 5 + hide_comment_details: false + +github_checks: + # Turn off GitHub Check annotations, as they make it more difficult to review code. + annotations: false