diff options
author | Paul Beusterien <paulbeusterien@google.com> | 2018-01-15 07:38:55 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-15 07:38:55 -0800 |
commit | caa69444141a858a98cfc35b77e3a6da7a7b51f6 (patch) | |
tree | 8bbb037da86bb7170eea7a776cb20d3876be07a6 /.travis.yml | |
parent | 2c0cacd3ee9d78a095de6069f7b59415f647718b (diff) |
Travis - run tests only for changed code (#665)
Diffstat (limited to '.travis.yml')
-rw-r--r-- | .travis.yml | 26 |
1 files changed, 24 insertions, 2 deletions
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 |