Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REVIEW] Fix Codecov.io Coverage Upload for Branch Builds #3524

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,19 @@ fi

if [ -n "${CODECOV_TOKEN}" ]; then

# NOTE: The code coverage upload needs to work for both PR builds and normal
# branch builds (aka `branch-0.XX`). Ensure the following settings to the
# codecov CLI will work with and without a PR
gpuci_logger "Uploading Code Coverage to codecov.io"

# Directory containing reports
REPORT_DIR="${WORKSPACE}/python/cuml"

# Base name to use in Codecov UI
CODECOV_NAME="${OS},py${PYTHON},cuda${CUDA}"
CODECOV_NAME=${JOB_BASE_NAME:-"${OS},py${PYTHON},cuda${CUDA}"}

# Codecov args needed by both calls
EXTRA_CODECOV_ARGS=""
EXTRA_CODECOV_ARGS="-c"

# Save the OS PYTHON and CUDA flags
EXTRA_CODECOV_ARGS="${EXTRA_CODECOV_ARGS} -e OS,PYTHON,CUDA"
Expand All @@ -263,8 +266,14 @@ if [ -n "${CODECOV_TOKEN}" ]; then
EXTRA_CODECOV_ARGS="${EXTRA_CODECOV_ARGS} -C ${REPORT_HASH}"
fi

# Append the PR ID. This is needed when running the build inside docker
EXTRA_CODECOV_ARGS="${EXTRA_CODECOV_ARGS} -P ${PR_ID} -c"
# Append the PR ID. This is needed when running the build inside docker for
# PR builds
if [ -n "${PR_ID}" ]; then
EXTRA_CODECOV_ARGS="${EXTRA_CODECOV_ARGS} -P ${PR_ID}"
fi

# Set the slug since this does not work in jenkins.
export CODECOV_SLUG="${PR_AUTHOR:-"rapidsai"}/cuml"

# Upload the two reports with separate flags. Delete the report on success
# to prevent further CI steps from re-uploading
Expand Down
6 changes: 6 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ coverage:
comment:
behavior: new

# Suggested workaround to fix "missing base report" issue when using Squash and
# Merge Strategy in GitHub. See this comment from CodeCov support about this
# undocumented option:
# https://community.codecov.io/t/unable-to-determine-a-parent-commit-to-compare-against-in-base-branch-after-squash-and-merge/2480/15
codecov:
allow_coverage_offsets: true