diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2afbd814..41c44b77 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -102,7 +102,12 @@ jobs: PROJECTS: ${{ steps.affected.outputs.list }} run: | rm -rf packages/*/coverage app/*/coverage onboarding/packages/*/coverage - pnpm exec nx run-many --targets=test:coverage --projects="$PROJECTS" --outputStyle=static -- --coverage.reporter=json-summary --coverage.include='src/**' + # Zero the absolute per-project coverage.thresholds here: they are + # calibrated for each package's default (tested-files) include, but CI + # forces --coverage.include=src/** so the merge-base comparison is + # apples-to-apples, which lowers the percentage and trips them. The + # real coverage gate is the regression check (coverage-check.mjs). + pnpm exec nx run-many --targets=test:coverage --projects="$PROJECTS" --outputStyle=static -- --coverage.reporter=json-summary --coverage.include='src/**' --coverage.thresholds.lines=0 --coverage.thresholds.functions=0 --coverage.thresholds.statements=0 --coverage.thresholds.branches=0 node "$RUNNER_TEMP/coverage-check.mjs" --collect "$RUNNER_TEMP/cov-head" --expect "$PROJECTS" # Re-measuring the merge-base is normally a set of Nx Cloud cache # restores seeded by the Coverage workflow on main: the task hashes are @@ -130,8 +135,9 @@ jobs: exit 0 fi # Extra reporters/include so a merge-base whose scripts are still - # `vitest run --coverage` still writes coverage-summary.json. - pnpm exec nx run-many --targets=test:coverage --projects="$base_list" --outputStyle=static -- --coverage.reporter=json-summary --coverage.include='src/**' + # `vitest run --coverage` still writes coverage-summary.json. Zero the + # absolute thresholds for the same reason as the head run above. + pnpm exec nx run-many --targets=test:coverage --projects="$base_list" --outputStyle=static -- --coverage.reporter=json-summary --coverage.include='src/**' --coverage.thresholds.lines=0 --coverage.thresholds.functions=0 --coverage.thresholds.statements=0 --coverage.thresholds.branches=0 node "$RUNNER_TEMP/coverage-check.mjs" --collect "$RUNNER_TEMP/cov-base" --expect "$base_list" - name: Compare if: steps.affected.outputs.list != ''