Skip to content

Commit 60db721

Browse files
authored
Add codecov bash script as artifact (#1214)
Needed for securing this workflow. On PR we also change approach to load data to codecov. Updates are based on CodeCov docs. Relates-To: OLPEDGE-2553 Signed-off-by: Yaroslav Stefinko <[email protected]>
1 parent b1bb46c commit 60db721

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.github/workflows/psv_pipelines.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ jobs:
3232
- name: Run unit and integration tests. Report coverage to CodeCov.
3333
run: ./scripts/linux/psv/test_psv.sh
3434
shell: bash
35+
- name: Archive code coverage script
36+
uses: actions/upload-artifact@v2
37+
with:
38+
name: codecov-script
39+
path: codecov_upload_bash_*.sh
3540

3641
psv-linux-gcc-build-no-cache:
3742
name: PSV / Linux gcc 7.5 / OLP_SDK_ENABLE_DEFAULT_CACHE=OFF

scripts/linux/psv/test_psv.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,22 @@ echo ">>> Integration Test ... >>>"
4242
$CPP_TEST_SOURCE_INTEGRATION/olp-cpp-sdk-integration-tests \
4343
--gtest_output="xml:olp-cpp-sdk-integration-tests-report.xml"
4444

45-
bash <(curl -s https://codecov.io/bash)
45+
# CodeCov verification stage:
46+
# https://docs.codecov.io/docs/about-the-codecov-bash-uploader#validating-the-bash-script
47+
curl -fLso codecov https://codecov.io/bash;
48+
VERSION=$(grep -o 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2);
49+
# Loop for 3 types of SHA sums
50+
for i in 1 256 512
51+
do
52+
shasum -a $i -c <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM" | grep -w "codecov")
53+
done
54+
55+
56+
curl -S -L --connect-timeout 5 --retry 6 -s https://codecov.io/bash -o codecov_upload_bash_$(date +%s).sh
57+
cp $(ls codecov_upload_bash_*.sh) codecov_upload_bash.sh
58+
# Execute CodeCov scanner
59+
ls -la *.xml
60+
bash codecov_upload_bash.sh -Z -X fix "$@"
61+
62+
63+
#bash <(curl -s https://codecov.io/bash)

0 commit comments

Comments
 (0)