version: 2 workflows: version: 2 default: jobs: - android-debug-arm-v7 - android-release-all jobs: # ------------------------------------------------------------------------------ android-debug-arm-v7: docker: - image: mbgl/ci:r2-android-ndk-r15beta2-gradle working_directory: /src environment: LIBSYSCONFCPUS: 6 JOBS: 6 BUILDTYPE: Debug steps: - checkout - run: name: Build libmapbox-gl.so for arm-v7 command: make android-lib-arm-v7 - run: name: Compile Core tests for arm-v7 command: make android-test-lib-arm-v7 - run: name: Test phone module command: make run-android-unit-test - run: name: Test wear module command: make run-android-wear-unit-test - run: name: Generate Espresso sanity tests command: make test-code-android - run: name: Check Java code style command: make android-checkstyle - run: name: Build Test APK command: | echo "${MAPBOX_DEVELOPER_CONFIG_XML}" > platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/developer-config.xml make android-ui-test-arm-v7 - run: name: Log in to Google Cloud Platform shell: /bin/bash -euo pipefail command: | echo "${GCLOUD_SERVICE_ACCOUNT_JSON}" > secret.json gcloud auth activate-service-account --key-file secret.json --project android-gl-native rm secret.json - run: name: Run instrumentation tests on Firebase shell: /bin/bash -euo pipefail command: | gcloud firebase test android models list (gcloud firebase test android run --type instrumentation \ --app platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk/MapboxGLAndroidSDKTestApp-debug.apk \ --test platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk/MapboxGLAndroidSDKTestApp-debug-androidTest.apk \ --device-ids shamu --os-version-ids 22 --locales en --orientations portrait --timeout 15m \ --test-targets "class com.mapbox.mapboxsdk.testapp.maps.widgets.LogoTest" 2>&1 | tee firebase.log) || EXIT_CODE=$? FIREBASE_TEST_BUCKET=$(sed -n 's|^.*\[https://console.developers.google.com/storage/browser/\([^]]*\).*|gs://\1|p' firebase.log) echo "Downloading from: ${FIREBASE_TEST_BUCKET}" gsutil -m cp -n -R -Z "$FIREBASE_TEST_BUCKET*" platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk echo "Try running ndk-stack on downloaded logcat to symbolicate the stacktraces:" find platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk -type f -name "logcat" -print0 | \ xargs -0 -I '{}' ${ANDROID_NDK_HOME}/ndk-stack -sym build/android-arm-v7/Debug -dump {} exit ${EXIT_CODE:-0} - store_artifacts: path: platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk destination: . # ------------------------------------------------------------------------------ android-release-all: docker: - image: mbgl/ci:r2-android-ndk-r15beta2-gradle working_directory: /src environment: LIBSYSCONFCPUS: 6 JOBS: 6 BUILDTYPE: Release steps: - checkout - run: name: Generate Maven credentials shell: /bin/bash -euo pipefail command: | aws s3 cp s3://mapbox/android/signing-credentials/secring.gpg platform/android/MapboxGLAndroidSDK/secring.gpg echo "NEXUS_USERNAME=$PUBLISH_NEXUS_USERNAME NEXUS_PASSWORD=$PUBLISH_NEXUS_PASSWORD signing.keyId=$SIGNING_KEYID signing.password=$SIGNING_PASSWORD signing.secretKeyRingFile=secring.gpg" >> platform/android/MapboxGLAndroidSDK/gradle.properties - run: name: Build libmapbox-gl.so for arm-v7 command: make android-lib-arm-v7 - run: name: Build libmapbox-gl.so for arm-v8 command: make android-lib-arm-v8 - run: name: Build libmapbox-gl.so for arm-v5 command: make android-lib-arm-v5 - run: name: Build libmapbox-gl.so for mips command: make android-lib-mips - run: name: Build libmapbox-gl.so for x86 command: make android-lib-x86 - run: name: Build libmapbox-gl.so for x86-64 command: make android-lib-x86-64 - run: name: Build package command: make apackage - store_artifacts: path: platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk destination: . - deploy: name: Show statistics command: | [ "${CIRCLE_BRANCH}" == "master" ] && export CLOUDWATCH=true platform/android/scripts/metrics.sh - deploy: name: Publish to Maven command: | if [ "${CIRCLE_BRANCH}" == "release-ios-v3.6.0-android-v5.1.0" ]; then make run-android-upload-archives ; fi