From 3f021970ea31a5dadeafd197c1b62f22591aae3d Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Tue, 4 Sep 2018 11:41:33 -0400 Subject: [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. --- circle.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index c66c45160e..a86bd24101 100644 --- a/circle.yml +++ b/circle.yml @@ -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 \ -- cgit v1.2.1