File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,4 @@ MYSQL_PASSWORD=smarter_test_user
1111MYSQL_DATABASE=smarter_test_db
1212MYSQL_CHARSET=utf8mb4
1313PYTHONPATH=./venv:./
14+ CODECOV_TOKEN=ADD-YOUR-CODECOV_TOKEN-HERE
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Always resolve the path to coverage.xml relative to the repo root
4+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
5+ REPO_ROOT=" $( dirname " $SCRIPT_DIR " ) "
6+ COVERAGE_FILE=" $REPO_ROOT /coverage.xml"
7+ BRANCH=" main"
8+ CODECOV_TOKEN=" ${CODECOV_TOKEN} "
9+
10+ if [[ -z " $CODECOV_TOKEN " ]]; then
11+ echo " Error: CODECOV_TOKEN environment variable not set."
12+ exit 1
13+ fi
14+
15+ if [[ ! -f " $COVERAGE_FILE " ]]; then
16+ echo " Error: $COVERAGE_FILE not found."
17+ exit 1
18+ fi
19+
20+ COMMIT_SHA=$( git -C " $REPO_ROOT " rev-parse origin/main)
21+
22+ curl -X POST -F " file=@${COVERAGE_FILE} " \
23+ " https://codecov.io/upload/v4?token=${CODECOV_TOKEN} &branch=${BRANCH} &commit=${COMMIT_SHA} "
You can’t perform that action at this time.
0 commit comments