mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-08 14:02:55 +00:00
Fix baseline commit and branch for code coverage (#5769)
## Problem `HEAD` commit for a PR is a phantom merge commit which skews the baseline commit for coverage reports. See https://github.com/neondatabase/neon/pull/5751#issuecomment-1790717867 ## Summary of changes - Use commit hash instead of `HEAD` for finding baseline commits for code coverage - Use the base branch for PRs or the current branch for pushes
This commit is contained in:
committed by
GitHub
parent
5cd5b93066
commit
f84ac2b98d
5
.github/workflows/build_and_test.yml
vendored
5
.github/workflows/build_and_test.yml
vendored
@@ -586,10 +586,13 @@ jobs:
|
||||
id: upload-coverage-report-new
|
||||
env:
|
||||
BUCKET: neon-github-public-dev
|
||||
# A differential coverage report is available only for PRs.
|
||||
# (i.e. for pushes into main/release branches we have a regular coverage report)
|
||||
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
BASE_SHA: ${{ github.event.pull_request.base.sha || github.sha }}
|
||||
run: |
|
||||
BASELINE="$(git merge-base HEAD origin/main)"
|
||||
CURRENT="${COMMIT_SHA}"
|
||||
BASELINE="$(git merge-base $BASE_SHA $CURRENT)"
|
||||
|
||||
cp /tmp/coverage/report/lcov.info ./${CURRENT}.info
|
||||
|
||||
|
||||
Reference in New Issue
Block a user