Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static checksum comparision of codecov script. #80

Merged
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
27 changes: 27 additions & 0 deletions Scripts/codecov.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Scripts/coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 Scripts/codecov.sh