Android Bitrise cleanup (#6782)
* [android] - update bitrise.yml, always use latest deploy step cleanup bitrise.yml formatting, separate download step -> if tests fail, build fails improve shown console messages, correct package for firebase filter update steps add slack integration for all workflows * fixup SKIPCI check
This commit is contained in:
@@ -26,59 +26,102 @@ workflows:
|
||||
envman add --key SKIPCI --value false
|
||||
fi
|
||||
- script:
|
||||
title: Build
|
||||
title: Configure GL-native build environement
|
||||
run_if: '{{enveq "SKIPCI" "false"}}'
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
set -eu -o pipefail
|
||||
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
|
||||
sudo apt-get install -y pkg-config nodejs cmake
|
||||
- script:
|
||||
title: Configure Google Cloud SDK
|
||||
run_if: '{{enveq "SKIPCI" "false"}}'
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
# Install python tools for pip
|
||||
sudo apt-get install -y gcc python-dev python-setuptools
|
||||
sudo easy_install -U pip
|
||||
sudo pip uninstall crcmod
|
||||
sudo pip install -U crcmod
|
||||
set -eu -o pipefail
|
||||
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
|
||||
sudo apt-get install -y pkg-config nodejs cmake
|
||||
export BUILDTYPE=Debug
|
||||
make android
|
||||
make android-test
|
||||
make android-generate-test
|
||||
wget -O platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/developer-config.xml "$BITRISEIO_TEST_ACCESS_TOKEN_UI_TEST_URL"
|
||||
make android-test-apk
|
||||
wget -O secret.json "$BITRISEIO_GCLOUD_SERVICE_ACCOUNT_JSON_URL"
|
||||
|
||||
# Install Google Cloud SDK for Firebase
|
||||
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
|
||||
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee /etc/apt/sources.list.d/google-cloud-sdk.list
|
||||
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
|
||||
sudo apt-get update && sudo apt-get install google-cloud-sdk
|
||||
|
||||
# Get authentication secret
|
||||
echo "Downloading Google Cloud authnetication:"
|
||||
wget -O secret.json "$BITRISEIO_GCLOUD_SERVICE_ACCOUNT_JSON_URL"
|
||||
- script:
|
||||
title: Build libmapbox-gl.so for armeabi-v7a
|
||||
run_if: '{{enveq "SKIPCI" "false"}}'
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
echo "Compile libmapbox-gl.so for armeabi-v7a abi:"
|
||||
export BUILDTYPE=Debug
|
||||
make android-lib-arm-v7
|
||||
- script:
|
||||
title: Run local JVM Unit tests
|
||||
run_if: '{{enveq "SKIPCI" "false"}}'
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
echo "Running unit tests from testapp/src/test:"
|
||||
make android-test
|
||||
- script:
|
||||
title: Generate Espresso sanity tests
|
||||
run_if: '{{enveq "SKIPCI" "false"}}'
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
echo "Generate these test locally by executing:"
|
||||
make android-generate-test
|
||||
- script:
|
||||
title: Run Firebase instrumentation tests
|
||||
run_if: '{{enveq "SKIPCI" "false"}}'
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
echo "Downloading Mapbox accesstoken for running tests:"
|
||||
wget -O platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/developer-config.xml "$BITRISEIO_TEST_ACCESS_TOKEN_UI_TEST_URL"
|
||||
|
||||
echo "Build seperate test apk:"
|
||||
make android-test-apk
|
||||
|
||||
echo "Run tests on firebase:"
|
||||
gcloud auth activate-service-account --key-file secret.json --project android-gl-native
|
||||
gcloud beta test android devices list
|
||||
gcloud beta 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-unaligned.apk --device-ids shamu --os-version-ids 22 --locales en --orientations portrait --timeout 15m --test-targets "class com.mapbox.mapboxsdk.camera.RotateTest"
|
||||
gcloud beta 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-unaligned.apk --device-ids shamu --os-version-ids 22 --locales en --orientations portrait --timeout 15m --test-targets "class com.mapbox.mapboxsdk.testapp.camera.RotateActivityTest"
|
||||
echo "The details are made available as a zipped build artefact on top of this page."
|
||||
- script:
|
||||
title: Download test results
|
||||
title: Download Firebase results
|
||||
run_if: '{{enveq "SKIPCI" "false"}}'
|
||||
is_always_run: true
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
testUri="gs://test-lab-wrrntqk05p31w-h3y1qk44vuunw/"
|
||||
testUri=$(gsutil ls $testUri | tail -n1)
|
||||
echo "The details from Firebase will be downloaded, zipped and attached as a build artefact."
|
||||
testUri=$(gsutil ls "gs://test-lab-wrrntqk05p31w-h3y1qk44vuunw/" | tail -n1)
|
||||
echo "Downloading from : "$testUri
|
||||
cd platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk && gsutil -m cp -R -Z $testUri .
|
||||
- deploy-to-bitrise-io@1.2.3:
|
||||
inputs:
|
||||
- deploy_path: "platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk"
|
||||
- notify_user_groups: none
|
||||
- is_compress: 'true'
|
||||
- script:
|
||||
title: Run ndk-stack
|
||||
is_always_run: true
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
|
||||
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 -Imylogcat mv -i mylogcat ./
|
||||
cat logcat | ndk-stack -sym build/android-arm-v7/Debug
|
||||
- slack:
|
||||
title: Post to Slack
|
||||
- deploy-to-bitrise-io:
|
||||
run_if: '{{enveq "SKIPCI" "false"}}'
|
||||
inputs:
|
||||
- deploy_path: platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk
|
||||
- is_compress: 'true'
|
||||
- notify_user_groups: none
|
||||
- slack:
|
||||
run_if: '{{enveq "SKIPCI" "false"}}'
|
||||
title: Post to Slack
|
||||
inputs:
|
||||
- webhook_url: "$SLACK_HOOK_URL"
|
||||
- channel: "#gl-bots"
|
||||
- from_username: 'Bitrise Android'
|
||||
@@ -96,49 +139,48 @@ workflows:
|
||||
scheduled:
|
||||
steps:
|
||||
- script:
|
||||
title: Build
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
set -eu -o pipefail
|
||||
|
||||
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
|
||||
apt-get install -y pkg-config python-pip python-dev build-essential nodejs cmake
|
||||
pip install awscli
|
||||
|
||||
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
|
||||
|
||||
export BUILDTYPE=Release
|
||||
make apackage
|
||||
|
||||
cd platform/android
|
||||
./gradlew uploadArchives
|
||||
devicefarmUpload:
|
||||
steps:
|
||||
- script:
|
||||
title: Build
|
||||
title: Configure GL-native build environement
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
set -eu -o pipefail
|
||||
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
|
||||
sudo apt-get install -y pkg-config nodejs cmake
|
||||
|
||||
echo "AWS_ACCESS_KEY_ID_DEVICE_FARM=$AWS_ACCESS_KEY_ID_DEVICE_FARM" >> platform/android/MapboxGLAndroidSDKTestApp/gradle.properties
|
||||
echo "AWS_SECRET_ACCESS_KEY_DEVICE_FARM=$AWS_SECRET_ACCESS_KEY_DEVICE_FARM" >> platform/android/MapboxGLAndroidSDKTestApp/gradle.properties
|
||||
- script:
|
||||
title: Configure AWS-CLI
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
apt-get install -y python-pip python-dev build-essential
|
||||
pip install awscli
|
||||
- script:
|
||||
title: Download maven credentials
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
aws s3 cp s3://mapbox/android/signing-credentials/secring.gpg platform/android/MapboxGLAndroidSDK/secring.gpg
|
||||
|
||||
# Add maven credentals for publishing
|
||||
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
|
||||
- script:
|
||||
title: Build release
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
echo "Compile libmapbox-gl.so for all supportd abi's:"
|
||||
export BUILDTYPE=Release
|
||||
make apackage
|
||||
|
||||
make android-generate-test
|
||||
cd platform/android/
|
||||
./gradlew devicefarmUpload
|
||||
- script:
|
||||
title: Publish to maven
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
echo "Upload aar file to maven:"
|
||||
cd platform/android && ./gradlew uploadArchives
|
||||
- slack:
|
||||
title: Post to Slack
|
||||
inputs:
|
||||
@@ -146,9 +188,57 @@ workflows:
|
||||
- channel: "#gl-bots"
|
||||
- from_username: 'Bitrise Android'
|
||||
- from_username_on_error: 'Bitrise Android'
|
||||
- message: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
|
||||
for devicefarmUpload passed'
|
||||
- message_on_error: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
|
||||
for devicefarmUpload failed'
|
||||
- message: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}> Publish to maven SUCCESS.'
|
||||
- message_on_error: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}> Publish to maven FAILED.'
|
||||
- icon_url: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-icon-128.png
|
||||
- icon_url_on_error: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-error-icon-128.png
|
||||
devicefarmUpload:
|
||||
steps:
|
||||
- script:
|
||||
title: Configure GL-native build environement
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
set -eu -o pipefail
|
||||
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
|
||||
sudo apt-get install -y pkg-config nodejs cmake
|
||||
- script:
|
||||
title: Build release
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
echo "Compile libmapbox-gl.so for all supportd abi's:"
|
||||
export BUILDTYPE=Release
|
||||
make apackage
|
||||
- script:
|
||||
title: Add AWS credentials
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
echo "AWS_ACCESS_KEY_ID_DEVICE_FARM=$AWS_ACCESS_KEY_ID_DEVICE_FARM" >> platform/android/MapboxGLAndroidSDKTestApp/gradle.properties
|
||||
echo "AWS_SECRET_ACCESS_KEY_DEVICE_FARM=$AWS_SECRET_ACCESS_KEY_DEVICE_FARM" >> platform/android/MapboxGLAndroidSDKTestApp/gradle.properties
|
||||
- script:
|
||||
title: Generate sanity tests
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
echo "Generate these test locally by executing:"
|
||||
make android-generate-test
|
||||
- script:
|
||||
title: Run AWS Device Farm instrumentation tests
|
||||
inputs:
|
||||
- content: |-
|
||||
#!/bin/bash
|
||||
echo "Run tests on device farm:"
|
||||
cd platform/android && ./gradlew devicefarmUpload
|
||||
- slack:
|
||||
title: Post to Slack
|
||||
inputs:
|
||||
- webhook_url: "$SLACK_HOOK_URL"
|
||||
- channel: "#gl-bots"
|
||||
- from_username: 'Bitrise Android'
|
||||
- from_username_on_error: 'Bitrise Android'
|
||||
- message: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}> for devicefarmUpload passed'
|
||||
- message_on_error: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}> for devicefarmUpload failed'
|
||||
- icon_url: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-icon-128.png
|
||||
- icon_url_on_error: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-error-icon-128.png
|
||||
|
||||
Reference in New Issue
Block a user