@@ -386,40 +386,33 @@ jobs:
386
386
- run : cargo rustdoc --lib --no-default-features --features full -Zunstable-options --config "build.rustdocflags=[\"--cfg\", \"docsrs\"]"
387
387
388
388
coverage :
389
+ if : ${{ github.event_name != 'merge_group' }}
389
390
needs : [fmt]
390
391
name : coverage ${{ matrix.os }}
391
392
strategy :
392
393
matrix :
393
394
os : ["windows-latest", "macos-14", "ubuntu-latest"] # first available arm macos runner
394
395
runs-on : ${{ matrix.os }}
395
396
steps :
396
- - if : ${{ github.event_name == 'pull_request' && matrix.os != 'ubuntu-latest' }}
397
- id : should-skip
398
- shell : bash
399
- run : echo 'skip=true' >> $GITHUB_OUTPUT
400
397
- uses : actions/checkout@v4
401
- if : steps.should-skip.outputs.skip != 'true'
398
+ with :
399
+ # Use the PR head, not the merge commit, because the head commit (and the base)
400
+ # is what codecov uses to calculate diffs.
401
+ ref : ${{ github.event.pull_request.head.sha }}
402
402
- uses : actions/setup-python@v5
403
- if : steps.should-skip.outputs.skip != 'true'
404
403
with :
405
404
python-version : ' 3.12'
406
405
- uses : Swatinem/rust-cache@v2
407
- if : steps.should-skip.outputs.skip != 'true'
408
406
with :
409
407
save-if : ${{ github.event_name != 'merge_group' }}
410
408
- uses : dtolnay/rust-toolchain@stable
411
- if : steps.should-skip.outputs.skip != 'true'
412
409
with :
413
410
components : llvm-tools-preview,rust-src
414
411
- name : Install cargo-llvm-cov
415
- if : steps.should-skip.outputs.skip != 'true'
416
412
uses : taiki-e/install-action@cargo-llvm-cov
417
413
- run : python -m pip install --upgrade pip && pip install nox
418
- if : steps.should-skip.outputs.skip != 'true'
419
414
- run : nox -s coverage
420
- if : steps.should-skip.outputs.skip != 'true'
421
415
- uses : codecov/codecov-action@v4
422
- if : steps.should-skip.outputs.skip != 'true'
423
416
with :
424
417
file : coverage.json
425
418
name : ${{ matrix.os }}
0 commit comments