summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmkiley <jordan.kiley@mapbox.com>2019-03-07 14:55:08 -0800
committerjmkiley <jordan.kiley@mapbox.com>2019-03-11 12:54:51 -0700
commit2aa49f9fc1fdda968ae71f15ddfd9c7729b45f92 (patch)
tree5c163ae2172941c0c443731809344f485ef002a9
parentbba0d3537bad7cbc5a88d7291ba979e21bf64d29 (diff)
downloadqtlocation-mapboxgl-2aa49f9fc1fdda968ae71f15ddfd9c7729b45f92.tar.gz
[ios] Update build script, breakout upload script
-rw-r--r--circle.yml4
-rwxr-xr-xplatform/ios/scripts/code-coverage.sh23
-rw-r--r--scripts/ios_coverage.json.gzbin0 -> 124 bytes
3 files changed, 7 insertions, 20 deletions
diff --git a/circle.yml b/circle.yml
index 4966ceb956..787b52aff5 100644
--- a/circle.yml
+++ b/circle.yml
@@ -878,7 +878,7 @@ jobs:
- run:
name: Get iOS code coverage
command: |
- platform/ios/scripts/code-coverage.sh
+ platform/ios/scripts/code-coverage.sh CI
- check-public-symbols
- run:
name: Check symbol namespacing for mapbox-events-ios
@@ -910,7 +910,7 @@ jobs:
- run:
name: Get iOS code coverage
command: |
- platform/ios/scripts/code-coverage.sh
+ platform/ios/scripts/code-coverage.sh CI
- save-dependencies
- collect-xcode-build-logs
- upload-xcode-build-logs
diff --git a/platform/ios/scripts/code-coverage.sh b/platform/ios/scripts/code-coverage.sh
index d4c535ae62..ede97bbbf2 100755
--- a/platform/ios/scripts/code-coverage.sh
+++ b/platform/ios/scripts/code-coverage.sh
@@ -3,17 +3,19 @@
set -e
set -o pipefail
+#
# Get code coverage report, then convert it to JSON.
# The coverage reports end up in different locations based on whether coverage
# is generated via CI or locally.
#
+
cov_result="";
if [ -f build/ios/Logs/Test/*.xcresult/*_Test/*.xccovreport ]; then
cov_result=build/ios/Logs/Test/*.xcresult/*_Test/*.xccovreport
elif [ -f build/ios/ios/Logs/Test/*.xcresult/*_Test/*.xccovreport ]; then
cov_result=build/ios/ios/Logs/Test/*.xcresult/*_Test/*.xccovreport
else
- echo "Coverage file does not exist"
+ echo "Coverage file does not exist. Please run tests before executing"
exit 1
fi
@@ -26,20 +28,5 @@ xcrun xccov view $cov_result --json > output.json
percentage=`node -e "console.log(require('./output.json').lineCoverage)"`
cov=$(printf "%.2f" $(echo "$percentage*100" | bc -l))
-#
-# Create a formatted JSON file with the current coverage.
-#
-current_date=$(TZ=UTC date +"%Y-%m-%d")
-file_name=ios_coverage.json
-cat <<EOF > $file_name
- {"code_coverage":$cov,"platform":"ios","sdk":"maps","scheme":"CI","created_at":"$current_date"}
-EOF
-
-gzip -f $file_name
-#
-# upload to AWS
-#
-if [ -z `which aws` ]; then
- brew install awscli
-fi
-aws s3 cp $file_name.gz s3://mapbox-loading-dock/raw/mobile.codecoverage/$current_date/ \ No newline at end of file
+# Generate a formatted JSON file and upload it to S3.
+./././scripts/code-coverage.sh $cov "ios" "$1"
diff --git a/scripts/ios_coverage.json.gz b/scripts/ios_coverage.json.gz
new file mode 100644
index 0000000000..e1a0998071
--- /dev/null
+++ b/scripts/ios_coverage.json.gz
Binary files differ