Skip to content

Travis - run tests only for changed code #665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,3 @@ if [ $RESULT != 0 ]; then exit $RESULT; fi
test_tvOS; RESULT=$?

if [ $RESULT != 0 ]; then exit $RESULT; fi

# Also test Firestore
Firestore/test.sh