diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ede5d7172b5..c6b31cdc378 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -386,6 +386,7 @@ jobs: - run: cargo rustdoc --lib --no-default-features --features full -Zunstable-options --config "build.rustdocflags=[\"--cfg\", \"docsrs\"]" coverage: + if : ${{ github.event_name != 'merge_group' }} needs: [fmt] name: coverage ${{ matrix.os }} strategy: @@ -393,33 +394,25 @@ jobs: os: ["windows-latest", "macos-14", "ubuntu-latest"] # first available arm macos runner runs-on: ${{ matrix.os }} steps: - - if: ${{ github.event_name == 'pull_request' && matrix.os != 'ubuntu-latest' }} - id: should-skip - shell: bash - run: echo 'skip=true' >> $GITHUB_OUTPUT - uses: actions/checkout@v4 - if: steps.should-skip.outputs.skip != 'true' + with: + # Use the PR head, not the merge commit, because the head commit (and the base) + # is what codecov uses to calculate diffs. + ref: ${{ github.event.pull_request.head.sha }} - uses: actions/setup-python@v5 - if: steps.should-skip.outputs.skip != 'true' with: python-version: '3.12' - uses: Swatinem/rust-cache@v2 - if: steps.should-skip.outputs.skip != 'true' with: save-if: ${{ github.event_name != 'merge_group' }} - uses: dtolnay/rust-toolchain@stable - if: steps.should-skip.outputs.skip != 'true' with: components: llvm-tools-preview,rust-src - name: Install cargo-llvm-cov - if: steps.should-skip.outputs.skip != 'true' uses: taiki-e/install-action@cargo-llvm-cov - run: python -m pip install --upgrade pip && pip install nox - if: steps.should-skip.outputs.skip != 'true' - run: nox -s coverage - if: steps.should-skip.outputs.skip != 'true' - uses: codecov/codecov-action@v4 - if: steps.should-skip.outputs.skip != 'true' with: file: coverage.json name: ${{ matrix.os }}