Skip to content

Commit

Permalink
add codecov to nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
kbhargava-jump committed May 24, 2024
1 parent bc41d71 commit 49b6a46
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/flamenco/runtime/tests/run_nightly_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ while [[ $# -gt 0 ]]; do
SLACK_WEBHOOK_URL="$2"
shift 2
;;
-cc|--codecov-token)
CODECOV_TOKEN="$2"
shift 2
;;
*)
echo "Unknown flag"
exit 1
Expand All @@ -36,6 +40,11 @@ if [ -z "${SLACK_WEBHOOK_URL}" ]; then
exit 1
fi

if [ -z "${CODECOV_TOKEN}" ]; then
echo "Error: Codecov token not specified"
exit 1
fi

# Pull the latest code
cd $REPO_DIR
git checkout $BRANCH
Expand Down Expand Up @@ -103,3 +112,13 @@ json_payload=$(cat <<EOF
EOF
)
curl -X POST -H 'Content-type: application/json' --data "$json_payload" $SLACK_WEBHOOK_URL

OBJDIR=${OBJDIR:-build/native/clang}
find "${REPO_DIR}/${OBJDIR}/cov/raw" -name '*.profraw' -print0 | xargs -0 llvm-profdata merge --sparse -o "${REPO_DIR}/${OBJDIR}/cov/raw/codecov.profdata"
llvm-cov export -format=lcov -instr-profile=${REPO_DIR}/${OBJDIR}/cov/raw/codecov.profdata ${REPO_DIR}/${OBJDIR}/bin/fd_ledger > ${REPO_DIR}/${OBJDIR}/cov/raw/codecov.lcov

curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -f ${REPO_DIR}/${OBJDIR}/cov/raw/codecov.lcov -t $CODECOV_TOKEN -F nightly_ledgers --name dist-cov-nightly-report
rm codecov
rm ${REPO_DIR}/${OBJDIR}/cov/raw/ -rf

0 comments on commit 49b6a46

Please sign in to comment.