.travis.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. osx_image: xcode9.2
  2. language: objective-c
  3. cache:
  4. - bundler
  5. - cocoapods
  6. rvm: 2.3.1
  7. before_install:
  8. # Add next line back with updated DeviceUDID for xcode9.1 if stability issues with simulator
  9. # - open -a "simulator" --args -CurrentDeviceUDID ABBD7191-486B-462F-80B4-AE08C5820DA1
  10. - bundle install
  11. - gem install xcpretty
  12. - bundle exec pod install --project-directory=Example --repo-update
  13. - bundle exec pod install --project-directory=Firestore/Example --no-repo-update
  14. - brew install clang-format
  15. - brew install swiftformat
  16. - brew install cmake
  17. - brew install go # Somehow the build for Abseil requires this.
  18. - echo "$TRAVIS_COMMIT_RANGE"
  19. - echo "$TRAVIS_PULL_REQUEST"
  20. - |
  21. if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
  22. SKIP_FIREBASE=0
  23. SKIP_FIRESTORE=0
  24. else
  25. git diff --name-only $TRAVIS_COMMIT_RANGE | grep -Eq '^(Firebase|Example)'
  26. SKIP_FIREBASE="$?"
  27. git diff --name-only $TRAVIS_COMMIT_RANGE | grep -q Firestore
  28. SKIP_FIRESTORE="$?"
  29. fi
  30. script:
  31. # Fail on trailing whitespace in non-binary, non-generated-nanopb files
  32. - "! git grep -I ' $' ':(exclude)Firestore/Protos/nanopb'"
  33. - "! git grep -EL --name-only 'Copyright [0-9]{4}.*Google' | grep -v third_party | egrep '\\.(m|h|cc|mm|c)$'"
  34. - ./scripts/style.sh test-only # Validate clang-format compliance
  35. - |
  36. if [ $SKIP_FIREBASE != 1 ]; then
  37. ./test.sh
  38. fi
  39. - |
  40. if [ $SKIP_FIRESTORE != 1 ]; then
  41. ./scripts/lint.sh # Google C++ style compliance
  42. fi
  43. - |
  44. if [ $SKIP_FIRESTORE != 1 ]; then
  45. ./Firestore/test.sh
  46. fi
  47. # TODO fix os_log deprecation warning in FIRLogger to remove --allow-warnings
  48. - |
  49. if [ $SKIP_FIREBASE != 1 ]; then
  50. bundle exec pod lib lint FirebaseCore.podspec --allow-warnings
  51. fi
  52. # TODO - Uncomment subsequent lines once FirebaseCore source repo is in public Specs repo
  53. # - bundle exec pod lib lint FirebaseAuth.podspec
  54. # - bundle exec pod lib lint FirebaseDatabase.podspec
  55. # - bundle exec pod lib lint FirebaseMessaging.podspec --allow-warnings #pending #390 fix
  56. # - bundle exec pod lib lint FirebaseStorage.podspec
  57. # - bundle exec pod lib lint Firestore/Firestore.podspec
  58. branches:
  59. only:
  60. - master