diff --git a/.codecov.yml b/.codecov.yml index 97697e132f..38facf2e17 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,8 +1,34 @@ +codecov: + ignore: + - "linkerd/app/integration/src/**" + - "**/src/gen/**" + - "tools/**" + coverage: - # Disable statuses until we sort out coverage more broadly. This is noisy as - # it is. + precision: 2 + round: down + range: "70...100" + status: project: - default: false + default: + target: auto + threshold: 2% + if_not_found: success + if_ci_failed: error + paths: + - "!linkerd/app/integration/src/**" + - "!**/src/gen/**" + - "!tools/**" + patch: - default: false + default: + target: auto + threshold: 1% + if_not_found: success + if_ci_failed: error + +comment: + layout: "header, diff, files, footer" + behavior: default + require_changes: false diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index dced3f5aed..197bd28aff 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -4,13 +4,18 @@ permissions: contents: read on: + # We run coverage on main so that PRs can have a meaninful comparison that + # doesn't lag a whole day. + push: + branches: + - main + + # Coverage runs on all code changes (as well as changes to the workflow). pull_request: paths: - .codecov.yml - .github/workflows/coverage.yml - schedule: - # Run daily at 11AM UTC (3AM PST). - - cron: '0 11 * * *' + - '**/*.rs' env: CARGO_INCREMENTAL: 0 @@ -19,6 +24,18 @@ env: RUSTUP_MAX_RETRIES: 10 jobs: + # Cancel any previous runs of this workflow so coverage runs don't back up, + # especially on main (i.e. after merging several PRs). + cleanup: + runs-on: ubuntu-latest + permissions: + actions: write + steps: + - uses: styfle/cancel-workflow-action@01ce38bf961b4e243a6342cbade0dbc8ba3f0432 + with: + all_but_latest: true + access_token: ${{ github.token }} + test: name: codecov runs-on: ubuntu-latest