[build] Skip Android device tests via commit message

- Add `[skip firebase]` anywhere in your commit message to avoid running Firebase tests for that commit.
- Also skips if the latest commit message only includes `[ios]`, `[macos]`, `[ios, macos]`, or `[darwin]`.
- Only skips if included in the most recent commit message.
This commit is contained in:
Jason Wray
2018-09-04 11:41:33 -04:00
committed by GitHub
parent 42aaf3e346
commit 3f021970ea

View File

@@ -419,10 +419,18 @@ jobs:
- *save-mason_packages-cache
- *save-ccache
- *save-gradle-cache
- run:
name: Check if Firebase should be skipped
command: |
SKIPPABLE_TAG=$( git log -1 | grep -ioE -e "\[(skip.firebase|firebase.skip)\]" -e "\[((i|mac)os)+(, (i|mac)os)?\]" -e "\[darwin\]" || true )
if [ -n "${SKIPPABLE_TAG}" ]; then
echo "Skipping Firebase tests because commit message contained: '${SKIPPABLE_TAG}'"
echo 'export SKIP_FIREBASE=1' >> $BASH_ENV
fi
- run:
name: Log in to Google Cloud Platform
command: |
if [ -n "${GCLOUD_SERVICE_ACCOUNT_JSON}" ]; then
if [[ -n "${GCLOUD_SERVICE_ACCOUNT_JSON}" && -z "${SKIP_FIREBASE}" ]]; then
echo "${GCLOUD_SERVICE_ACCOUNT_JSON}" > secret.json
gcloud auth activate-service-account --key-file secret.json --project android-gl-native
rm secret.json
@@ -431,7 +439,7 @@ jobs:
name: Run instrumentation tests on Firebase
no_output_timeout: 1200
command: |
if [ -n "${GCLOUD_SERVICE_ACCOUNT_JSON}" ]; then
if [[ -n "${GCLOUD_SERVICE_ACCOUNT_JSON}" && -z "${SKIP_FIREBASE}" ]]; then
gcloud firebase test android models list
gcloud firebase test android run --type instrumentation \
--app platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk/debug/MapboxGLAndroidSDKTestApp-debug.apk \