Skip to content

Commit

Permalink
ci: detect merge branch parent as commit for coverage comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Aug 23, 2024
1 parent f38be29 commit c51875c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,21 @@ jobs:
if: steps.should-skip.outputs.skip != 'true'
- run: nox -s coverage
if: steps.should-skip.outputs.skip != 'true'
- name: Resolve merge-base for coverage
id: base-ref
run: |
git fetch --depth=1 origin ${{ github.base_ref }}
echo base_sha=$(git rev-parse FETCH_HEAD) >> $GITHUB_OUTPUT
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 }}
token: ${{ secrets.CODECOV_TOKEN }}
# because we run pull_request, we need to tell codecov the base of the
# comparison
commit_parent: ${{ steps.should-skip.outputs.base_sha }}

emscripten:
name: emscripten
Expand Down

0 comments on commit c51875c

Please sign in to comment.