Skip to content
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: 16 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,24 @@ jobs:
command:
ci/do_circle_ci.sh bazel.coverage
no_output_timeout: 60m
- run: ci/coverage_publish.sh
- persist_to_workspace:
root: /build/envoy/generated
paths:
- coverage
- store_artifacts:
path: /build/envoy/generated
destination: /

coverage_publish:
docker:
- image: google/cloud-sdk
steps:
- run: rm -rf /home/circleci/project/.git # CircleCI git caching is likely broken
- checkout
- attach_workspace:
at: /build/envoy/generated
- run: ci/coverage_publish.sh

clang_tidy:
executor: ubuntu-build
steps:
Expand Down Expand Up @@ -150,6 +163,8 @@ workflows:
- api
- filter_example_mirror
- coverage
- coverage_publish:
requires: [coverage]
- format
- clang_tidy
- build_image
Expand Down
2 changes: 1 addition & 1 deletion bazel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ have seen some issues with seeing the artifacts tab. If you can't see it, log ou
then log back in and it should start working.

The latest coverage report for master is available
[here](https://s3.amazonaws.com/lyft-envoy/coverage/report-master/index.html).
[here](https://storage.googleapis.com/envoy-coverage/report-master/index.html).

It's also possible to specialize the coverage build to a specified test or test dir. This is useful
when doing things like exploring the coverage of a fuzzer over its corpus. This can be done by
Expand Down
24 changes: 12 additions & 12 deletions ci/coverage_publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ if [ "${CIRCLECI}" != "true" ]; then
exit 0
fi

[[ -z "${ENVOY_BUILD_DIR}" ]] && ENVOY_BUILD_DIR=/build
COVERAGE_FILE="${ENVOY_BUILD_DIR}/envoy/generated/coverage/index.html"

if [ ! -f "${COVERAGE_FILE}" ]; then
echo "ERROR: Coverage file not found."
exit 1
fi

# available for master builds
if [ -z "$CIRCLE_PR_NUMBER" ]
then
echo "Uploading coverage report..."

[[ -z "${ENVOY_BUILD_DIR}" ]] && ENVOY_BUILD_DIR=/build
COVERAGE_FILE="${ENVOY_BUILD_DIR}/envoy/generated/coverage/index.html"

if [ ! -f "${COVERAGE_FILE}" ]; then
echo "ERROR: Coverage file not found."
exit 1
fi

BRANCH_NAME="${CIRCLE_BRANCH}"
COVERAGE_DIR="$(dirname "${COVERAGE_FILE}")"
S3_LOCATION="lyft-envoy/coverage/report-${BRANCH_NAME}"
GCS_LOCATION="envoy-coverage/report-${BRANCH_NAME}"

pip install awscli --upgrade
aws s3 cp "${COVERAGE_DIR}" "s3://${S3_LOCATION}" --recursive --acl public-read --quiet --sse
echo "Coverage report for branch '${BRANCH_NAME}': https://s3.amazonaws.com/${S3_LOCATION}/index.html"
echo ${GCP_SERVICE_ACCOUNT_KEY} | base64 --decode | gcloud auth activate-service-account --key-file=-
gsutil -m rsync -dr ${COVERAGE_DIR} gs://${GCS_LOCATION}
echo "Coverage report for branch '${BRANCH_NAME}': https://storage.googleapis.com/${GCS_LOCATION}/index.html"
else
echo "Coverage report will not be uploaded for this build."
fi