From caa69444141a858a98cfc35b77e3a6da7a7b51f6 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Mon, 15 Jan 2018 07:38:55 -0800 Subject: Travis - run tests only for changed code (#665) --- .travis.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 4a6ad23..a2719b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,14 +13,36 @@ before_install: - bundle exec pod install --project-directory=Example --repo-update - bundle exec pod install --project-directory=Firestore/Example --no-repo-update - brew install clang-format + - echo "$TRAVIS_COMMIT_RANGE" + - echo "$TRAVIS_PULL_REQUEST" + - | + if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then + SKIP_FIREBASE=0 + SKIP_FIRESTORE=0 + else + git diff --name-only $TRAVIS_COMMIT_RANGE | grep -Eq '^(Firebase|Example)' + SKIP_FIREBASE="$?" + git diff --name-only $TRAVIS_COMMIT_RANGE | grep -q Firestore + SKIP_FIRESTORE="$?" + fi script: - "! git grep -I ' $'" # Fail on trailing whitespace in non-binary files - ./scripts/style.sh test-only # Validate clang-format compliance - - ./test.sh + - | + if [ $SKIP_FIREBASE != 1 ]; then + ./test.sh + fi + - | + if [ $SKIP_FIRESTORE != 1 ]; then + ./Firestore/test.sh + fi # TODO fix os_log deprecation warning in FIRLogger to remove --allow-warnings - - bundle exec pod lib lint FirebaseCore.podspec --allow-warnings + - | + if [ $SKIP_FIREBASE != 1 ]; then + bundle exec pod lib lint FirebaseCore.podspec --allow-warnings + fi # TODO - Uncomment subsequent lines once FirebaseCore source repo is in public Specs repo # - bundle exec pod lib lint FirebaseAuth.podspec -- cgit v1.2.3