diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 3dea9be27d..3aa85c22d5 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -309,18 +309,25 @@ jobs: path: web/node_modules key: node-modules-${{ runner.os }}-node24-${{ hashFiles('web/package-lock.json', 'web/package.json', 'web/patches/**') }} - - name: Run this shard with coverage + - name: Run this shard working-directory: web env: UI_SHARD_BALANCE: '1' + SHARD: ${{ matrix.shard }}/4 + # The PR run already gated coverage; the queue only needs pass/fail. + NO_COVERAGE: ${{ github.event_name == 'merge_group' }} run: | - npx vitest run --coverage --shard=${{ matrix.shard }}/4 --reporter=default --reporter=blob \ - --coverage.reportOnFailure --coverage.reporter=json \ - --coverage.thresholds.lines=0 --coverage.thresholds.functions=0 \ - --coverage.thresholds.branches=0 --coverage.thresholds.statements=0 + if [ "$NO_COVERAGE" = "true" ]; then + npx vitest run --shard="$SHARD" --reporter=default + else + npx vitest run --coverage --shard="$SHARD" --reporter=default --reporter=blob \ + --coverage.reportOnFailure --coverage.reporter=json \ + --coverage.thresholds.lines=0 --coverage.thresholds.functions=0 \ + --coverage.thresholds.branches=0 --coverage.thresholds.statements=0 + fi - uses: actions/upload-artifact@v4 - if: always() + if: always() && github.event_name != 'merge_group' with: name: ui-unit-blob-${{ matrix.shard }} path: web/.vitest-reports @@ -345,10 +352,13 @@ jobs: [ "${{ needs.ui_unit_test_shards.result }}" = "success" ] || { echo "shards: ${{ needs.ui_unit_test_shards.result }}"; exit 1; } - name: Clone the current repo + if: github.event_name != 'merge_group' uses: actions/checkout@v5 - uses: ./.github/actions/github-auth + if: github.event_name != 'merge_group' - name: Setup Node.js + if: github.event_name != 'merge_group' uses: actions/setup-node@v7 with: node-version: 24 @@ -356,6 +366,7 @@ jobs: cache-dependency-path: web/package-lock.json - name: Restore node_modules + if: github.event_name != 'merge_group' id: nm uses: actions/cache/restore@v4 with: @@ -363,18 +374,20 @@ jobs: key: node-modules-${{ runner.os }}-node24-${{ hashFiles('web/package-lock.json', 'web/package.json', 'web/patches/**') }} - name: Install dependencies - if: steps.nm.outputs.cache-hit != 'true' + if: github.event_name != 'merge_group' && steps.nm.outputs.cache-hit != 'true' working-directory: web timeout-minutes: 5 run: npm ci - uses: actions/download-artifact@v4 + if: github.event_name != 'merge_group' with: pattern: ui-unit-blob-* path: web/.vitest-reports merge-multiple: true - name: Merge shard coverage and check thresholds + if: github.event_name != 'merge_group' working-directory: web run: ./coverage.sh merge