summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmkiley <jordan.kiley@mapbox.com>2019-03-18 11:36:20 -0700
committerjmkiley <jordan.kiley@mapbox.com>2019-03-18 11:36:20 -0700
commit60bbf3aab94a4752882a2b063871c1727214ff28 (patch)
treedc79a853bf5b899f340cc3a94c4f7fdcbf76b319
parentc2fe532b9bbc9db9b2bbab109f0f47f7cc9584d7 (diff)
downloadqtlocation-mapboxgl-upstream/jmkiley-add-sha-to-codecov-script.tar.gz
[build] Add sha to the coverage jsonupstream/jmkiley-add-sha-to-codecov-script
-rwxr-xr-xscripts/code-coverage.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/code-coverage.sh b/scripts/code-coverage.sh
index d6866f61b8..e2db9dc0b6 100755
--- a/scripts/code-coverage.sh
+++ b/scripts/code-coverage.sh
@@ -17,12 +17,16 @@ if [[ ! $2 = "iOS" && ! $2 = "Android" ]]; then
exit 1
fi
+circle_sha=""
+if [[ $CIRCLE_SHA1 ]]; then
+ circle_sha="$CIRCLE_SHA1"
+fi
# Create a formatted JSON file that contains the current coverage.
current_date=$(TZ=UTC date +"%Y-%m-%d")
file_name=$2_coverage.json
cat <<EOF > $file_name
- {"code_coverage":$1,"platform":"$2","sdk":"Maps","scheme":"$3","created_at":"$current_date"}
+ {"code_coverage":$1,"platform":"$2","sdk":"Maps","scheme":"$3","created_at":"$current_date","sha":"$circle_sha"}
EOF
gzip -f $file_name