diff options
author | jmkiley <jordan.kiley@mapbox.com> | 2019-03-18 11:36:20 -0700 |
---|---|---|
committer | jmkiley <jordan.kiley@mapbox.com> | 2019-03-18 11:36:20 -0700 |
commit | 60bbf3aab94a4752882a2b063871c1727214ff28 (patch) | |
tree | dc79a853bf5b899f340cc3a94c4f7fdcbf76b319 | |
parent | c2fe532b9bbc9db9b2bbab109f0f47f7cc9584d7 (diff) | |
download | qtlocation-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-x | scripts/code-coverage.sh | 6 |
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 |