Skip to content

Commit 9429b9a

Browse files
committed
Add codecov io upload
1 parent 536cf3b commit 9429b9a

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

share/ramble/cloud-build/ramble-pr-unit-tests.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ steps:
3434
echo "Spack version is $(spack --version)"
3535
echo "Python version is $(python3 --version)"
3636
37+
if [[ "$_PUSH_CODECOV" ]]; then
38+
# This could be pushed into the image, but is recommended as a runtime step
39+
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step
40+
curl -Os https://cli.codecov.io/latest/linux/codecov
41+
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM
42+
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig
43+
gpg --verify codecov.SHA256SUM.sig codecov.SHA256SUM
44+
45+
sha256sum -c codecov.SHA256SUM
46+
chmod +x codecov
47+
fi
48+
3749
UNIT_TEST_COVERAGE=true LONG=true /workspace/share/ramble/qa/run-unit-tests
3850
# $$ characters are required for cloud-build:
3951
# https://cloud.google.com/build/docs/configuring-builds/substitute-variable-values
@@ -72,6 +84,9 @@ steps:
7284
exit $$error
7385
id: ramble-unit-tests
7486
entrypoint: /bin/bash
87+
env:
88+
- 'CODECOV_TOKEN=$_CODECOV_TOKEN'
89+
- 'PUSH_CODECOV=$_PUSH_CODECOV'
7590
substitutions:
7691
_SPACK_REF: v0.21.2
7792
_PYTHON_VER: 3.11.6

share/ramble/qa/run-unit-tests

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ if [ $? != 0 ]; then
7474
fi
7575

7676

77+
echo $PUSH_CODECOV
78+
if [[ "$PUSH_CODECOV" ]]; then
79+
echo "Processing codecov upload"
80+
# TODO: this must be in path somehow. What is the best way?
81+
export PATH=$PATH:/workspace/
82+
codecov upload-process
83+
fi
84+
7785
if [ $ERROR == 1 ]; then
7886
exit 1
7987
fi

0 commit comments

Comments
 (0)