.travis.yml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. os: osx
  2. osx_image: xcode10.1
  3. language: objective-c
  4. cache:
  5. - bundler
  6. - cocoapods
  7. jobs:
  8. include:
  9. - stage: checks
  10. # This only needs to be run once, so restrict it to an arbitrary combination
  11. before_install:
  12. - brew install clang-format
  13. - brew install swiftformat
  14. script:
  15. - ./scripts/check_whitespace.sh
  16. - ./scripts/check_copyright.sh
  17. - ./scripts/check_no_module_imports.sh
  18. - ./scripts/check_test_inclusion.py
  19. - ./scripts/style.sh test-only $TRAVIS_COMMIT_RANGE
  20. # Google C++ style compliance
  21. - ./scripts/lint.sh $TRAVIS_COMMIT_RANGE
  22. # The order of builds matters (even though they are run in parallel):
  23. # Travis will schedule them in the same order they are listed here.
  24. # Primary platforms
  25. # Run unit tests
  26. - stage: test
  27. env:
  28. - PROJECT=Firebase PLATFORM=iOS METHOD=xcodebuild
  29. before_install:
  30. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  31. script:
  32. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
  33. - stage: test
  34. env:
  35. - PROJECT=InAppMessagingDisplay PLATFORM=iOS METHOD=xcodebuild
  36. before_install:
  37. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  38. script:
  39. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
  40. - stage: test
  41. env:
  42. - PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild
  43. before_install:
  44. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  45. script:
  46. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
  47. # pod lib lint to check build and warnings for dynamic framework build (use_frameworks!)
  48. - stage: test
  49. env:
  50. - PROJECT=Firebase PLATFORM=iOS METHOD=pod-lib-lint
  51. before_install:
  52. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  53. script:
  54. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh GoogleUtilities.podspec
  55. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseCore.podspec
  56. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseAnalyticsInterop.podspec
  57. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseAuth.podspec
  58. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseAuthInterop.podspec
  59. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseDatabase.podspec
  60. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseDynamicLinks.podspec
  61. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseMessaging.podspec
  62. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseStorage.podspec
  63. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseFunctions.podspec
  64. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseInAppMessaging.podspec
  65. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseInAppMessagingDisplay.podspec
  66. - stage: test
  67. env:
  68. - PROJECT=Firestore PLATFORM=iOS METHOD=pod-lib-lint
  69. before_install:
  70. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  71. script:
  72. # Eliminate the one warning from BoringSSL when CocoaPods 1.6.0 is available.
  73. # The travis_wait is necessary because the command takes more than 10 minutes.
  74. - travis_wait 45 ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseFirestore.podspec --allow-warnings --no-subspecs
  75. # pod lib lint to check build and warnings for static library build - only on cron jobs
  76. - stage: test
  77. env:
  78. - PROJECT=Firebase PLATFORM=iOS METHOD=pod-lib-lint
  79. before_install:
  80. - ./scripts/if_cron.sh ./scripts/install_prereqs.sh
  81. script:
  82. - travis_retry ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh GoogleUtilities.podspec --use-libraries
  83. - travis_retry ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseCore.podspec --use-libraries
  84. - travis_retry ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseAnalyticsInterop.podspec --use-libraries
  85. - travis_retry ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseAuth.podspec --use-libraries
  86. - travis_retry ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseAuthInterop.podspec --use-libraries
  87. - travis_retry ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseDatabase.podspec --use-libraries
  88. - travis_retry ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseDynamicLinks.podspec --use-libraries
  89. # The Protobuf dependency of FirebaseMessaging has warnings with --use-libraries
  90. - travis_retry ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseMessaging.podspec --use-libraries --allow-warnings
  91. - travis_retry ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseStorage.podspec --use-libraries
  92. - travis_retry ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseFunctions.podspec --use-libraries
  93. - travis_retry ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseInAppMessaging.podspec --use-libraries
  94. - travis_retry ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseInAppMessagingDisplay.podspec --use-libraries
  95. - stage: test
  96. env:
  97. - PROJECT=Firestore PLATFORM=iOS METHOD=pod-lib-lint
  98. before_install:
  99. - ./scripts/if_cron.sh ./scripts/install_prereqs.sh
  100. script:
  101. # TBD - non-portable path warnings
  102. # The travis_wait is necessary because the command takes more than 10 minutes.
  103. - travis_wait 45 ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseFirestore.podspec --use-libraries --allow-warnings --no-subspecs
  104. # Daily test for symbol collisions between Firebase and CocoaPods.
  105. - stage: test
  106. env:
  107. - PROJECT=SymbolCollision PLATFORM=iOS METHOD=xcodebuild
  108. before_install:
  109. - ./scripts/if_cron.sh ./scripts/install_prereqs.sh
  110. script:
  111. - travis_retry ./scripts/if_cron.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
  112. # Alternative platforms
  113. # Xcode 9
  114. - stage: test
  115. osx_image: xcode9.4
  116. env:
  117. - PROJECT=Firebase PLATFORM=iOS METHOD=xcodebuild
  118. before_install:
  119. - npm install ios-sim -g
  120. - ios-sim start --devicetypeid "com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus, 11.3"
  121. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  122. script:
  123. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
  124. - stage: test
  125. osx_image: xcode9.4
  126. env:
  127. - PROJECT=InAppMessagingDisplay PLATFORM=iOS METHOD=xcodebuild
  128. before_install:
  129. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  130. script:
  131. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
  132. - stage: test
  133. osx_image: xcode9.4
  134. env:
  135. - PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild
  136. before_install:
  137. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  138. script:
  139. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
  140. - stage: test
  141. env:
  142. - PROJECT=Firestore PLATFORM=macOS METHOD=cmake
  143. before_install:
  144. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  145. script:
  146. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
  147. - stage: test
  148. osx_image: xcode8.3
  149. env:
  150. - PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild XCODE_VERSION=8.3.3
  151. before_install:
  152. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  153. script:
  154. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
  155. # Xcode 9 may find lint errors that don't show up in Xcode 10 (#2081)
  156. - stage: test
  157. osx_image: xcode9.4
  158. env:
  159. - PROJECT=Firebase PLATFORM=iOS METHOD=pod-lib-lint
  160. before_install:
  161. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  162. script:
  163. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh GoogleUtilities.podspec
  164. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseCore.podspec
  165. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseAnalyticsInterop.podspec
  166. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseAuth.podspec
  167. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseAuthInterop.podspec
  168. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseDatabase.podspec
  169. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseDynamicLinks.podspec
  170. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseMessaging.podspec
  171. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseStorage.podspec
  172. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseFunctions.podspec
  173. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseInAppMessaging.podspec
  174. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseInAppMessagingDisplay.podspec
  175. - stage: test
  176. osx_image: xcode9.4
  177. env:
  178. - PROJECT=Firestore PLATFORM=iOS METHOD=pod-lib-lint
  179. before_install:
  180. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  181. script:
  182. # Eliminate the one warning from BoringSSL when CocoaPods 1.6.0 is available.
  183. # The travis_wait is necessary because the command takes more than 10 minutes.
  184. - travis_wait 45 ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseFirestore.podspec --allow-warnings --no-subspecs
  185. # Community-supported platforms
  186. - stage: test
  187. env:
  188. - PROJECT=Firebase PLATFORM=macOS METHOD=xcodebuild
  189. before_install:
  190. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  191. script:
  192. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
  193. - stage: test
  194. env:
  195. - PROJECT=Firebase PLATFORM=tvOS METHOD=xcodebuild
  196. before_install:
  197. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  198. script:
  199. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
  200. # Firestore sanitizers
  201. - stage: test
  202. env:
  203. - PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild SANITIZERS=asan
  204. before_install:
  205. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  206. script:
  207. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
  208. - stage: test
  209. env:
  210. - PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild SANITIZERS=tsan
  211. before_install:
  212. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  213. script:
  214. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
  215. # TODO(varconst): enable UBSan in xcodebuild. Right now if fails during
  216. # linkage (it works if enabled together with ASan, but it's supposed to be
  217. # usable on its own, too).
  218. - stage: test
  219. env:
  220. - PROJECT=Firestore PLATFORM=macOS METHOD=cmake SANITIZERS=asan
  221. before_install:
  222. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  223. script:
  224. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
  225. - stage: test
  226. env:
  227. - PROJECT=Firestore PLATFORM=macOS METHOD=cmake SANITIZERS=tsan
  228. before_install:
  229. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  230. script:
  231. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
  232. allow_failures:
  233. # Run fuzz tests only on cron jobs.
  234. - stage: test
  235. env:
  236. - PROJECT=Firestore PLATFORM=iOS METHOD=fuzz
  237. before_install:
  238. - ./scripts/if_cron.sh ./scripts/install_prereqs.sh
  239. script:
  240. # The travis_wait is necessary because fuzzing runs for 40 minutes.
  241. - travis_wait 45 ./scripts/if_cron.sh ./scripts/fuzzing_ci.sh
  242. # TODO(varconst): UBSan for CMake. UBSan failures are non-fatal by default,
  243. # need to make them fatal for the purposes of the test run.
  244. # TODO(varconst): disallow sanitizers to fail once we fix all existing issues.
  245. - env:
  246. - PROJECT=Firestore PLATFORM=macOS METHOD=cmake SANITIZERS=asan
  247. - env:
  248. - PROJECT=Firestore PLATFORM=macOS METHOD=cmake SANITIZERS=tsan
  249. - env:
  250. - PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild SANITIZERS=asan
  251. - env:
  252. - PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild SANITIZERS=tsan
  253. # TODO(varconst): enable if it's possible to make this flag work on build
  254. # stages. It's supposed to avoid waiting for jobs that are allowed to fail
  255. # before reporting the results.
  256. # fast_finish: true
  257. branches:
  258. only:
  259. - master