Skip to content

Commit ab7f314

Browse files
committed
#2461: Add CODECOV_TOKEN secret to bake and use it
1 parent 497d1c3 commit ab7f314

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

.github/workflows/build-docker-images.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,4 @@ jobs:
6565
push: ${{ github.ref == 'refs/heads/develop' }}
6666
env:
6767
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
68+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

ci/docker/vt.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ EOF
5454
ENV GIT_BRANCH=${GIT_BRANCH}
5555

5656
RUN --mount=target=/vt,rw \
57+
--mount=type=secret,id=CODECOV_TOKEN,env=CODECOV_TOKEN \
5758
if [ "${VT_TEST_SPACK}" = "1" ]; then \
5859
apt update -y -q && apt install -y -q libssl-dev unzip && \
5960
/vt/ci/test_spack_package.sh; \

ci/test_cpp.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ ctest --output-on-failure -L 'unit_test|example' | tee cmake-output.log
1414

1515
if test "${VT_CODE_COVERAGE:-0}" -eq 1
1616
then
17+
if [ -z "$CODECOV_TOKEN" ]; then
18+
echo "Error: CODECOV_TOKEN is not set"
19+
exit 1
20+
fi
1721
export CODECOV_TOKEN="$CODECOV_TOKEN"
1822
lcov --capture --directory . --output-file coverage.info
1923
lcov --remove coverage.info '/usr/*' --output-file coverage.info

docker-bake.hcl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ target "vt-build" {
187187
ulimits = [
188188
"core=0"
189189
]
190+
191+
secret = ["id=CODECOV_TOKEN,env=CODECOV_TOKEN"]
190192
# FIXME: verify that caching works as intended
191193
# cache-from = [
192194
# {

0 commit comments

Comments
 (0)