From 31d57e09ec6644a042aadfa6e9cfb68dc5d675df Mon Sep 17 00:00:00 2001 From: "Kenneth J. Shackleton" Date: Sat, 8 May 2021 09:59:23 +0100 Subject: [PATCH] Static checksum comparision of codecov script. Signed-off-by: Kenneth J. Shackleton --- Scripts/codecov.sh | 27 +++++++++++++++++++++++++++ Scripts/coverage.sh | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 Scripts/codecov.sh diff --git a/Scripts/codecov.sh b/Scripts/codecov.sh new file mode 100644 index 0000000..e68920d --- /dev/null +++ b/Scripts/codecov.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -eu + +GIT_COMMIT=1b4b96ac38946b20043b3ca3bad88d95462259b6 +SHA256SUM="d6aa3207c4908d123bd8af62ec0538e3f2b9f257c3de62fad4e29cd3b59b41d9 codecov" +SHA512SUM="b6492196dd844cd81a688536bb42463d28bd666448335c4a8fc7f8f9b9b9afc346a467e3401e3fc49e6047442a30d93a4adfaa1590101224a186013c6179c48d codecov" + +INITIAL_DIR=$(pwd) + +curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${GIT_COMMIT}/codecov" > codecov + +function tearDown { + cd ${INITIAL_DIR} + rm codecov +} +trap tearDown EXIT + +VERSION=$(grep 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2) +echo "Verifying codecov ${VERSION}" + +shasum -a 256 codecov +shasum -a 256 -c <(echo "${SHA256SUM}") + +shasum -a 512 codecov +shasum -a 512 -c <(echo "${SHA512SUM}") + +bash codecov -D .coverage diff --git a/Scripts/coverage.sh b/Scripts/coverage.sh index 08c8d56..de9d8b7 100755 --- a/Scripts/coverage.sh +++ b/Scripts/coverage.sh @@ -13,4 +13,4 @@ mkdir -p .coverage xcrun llvm-cov export -format="lcov" .build/debug/xcdiff -instr-profile .build/debug/codecov/default.profdata > ./.coverage/coverage.lcov # upload coverage data -bash <(curl -s https://codecov.io/bash) -D .coverage +bash codecov.sh