.travis.yml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. os: osx
  2. osx_image: xcode10.1
  3. language: objective-c
  4. cache:
  5. - bundler
  6. - cocoapods
  7. stages:
  8. - checks
  9. - test
  10. jobs:
  11. include:
  12. - stage: checks
  13. # This only needs to be run once, so restrict it to an arbitrary combination
  14. before_install:
  15. - brew install clang-format
  16. - brew install swiftformat
  17. script:
  18. - ./scripts/check.sh --test-only $TRAVIS_COMMIT_RANGE
  19. # The order of builds matters (even though they are run in parallel):
  20. # Travis will schedule them in the same order they are listed here.
  21. # Primary platforms
  22. # Run unit tests
  23. - stage: test
  24. env:
  25. - PROJECT=Firebase PLATFORM=iOS METHOD=xcodebuild
  26. before_install:
  27. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  28. script:
  29. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
  30. - stage: test
  31. env:
  32. - PROJECT=Core PLATFORM=iOS METHOD=pod-lib-lint
  33. before_install:
  34. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  35. script:
  36. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseCore.podspec
  37. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseCore.podspec --use-libraries
  38. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseCore.podspec --use-modular-headers
  39. - stage: test
  40. env:
  41. - PROJECT=Functions PLATFORM=iOS METHOD=pod-lib-lint
  42. before_install:
  43. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  44. script:
  45. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseFunctions.podspec
  46. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseFunctions.podspec --use-libraries
  47. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseFunctions.podspec --use-modular-headers
  48. - stage: test
  49. env:
  50. - PROJECT=InAppMessaging PLATFORM=iOS METHOD=xcodebuild
  51. before_install:
  52. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  53. script:
  54. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
  55. - stage: test
  56. env:
  57. - PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild
  58. before_install:
  59. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  60. script:
  61. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
  62. # pod lib lint to check build and warnings for dynamic framework build (use_frameworks!)
  63. - stage: test
  64. env:
  65. - PROJECT=Firebase PLATFORM=iOS METHOD=pod-lib-lint
  66. before_install:
  67. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  68. script:
  69. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh GoogleUtilities.podspec
  70. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseAnalyticsInterop.podspec
  71. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseAuth.podspec
  72. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseAuthInterop.podspec
  73. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseDatabase.podspec
  74. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseDynamicLinks.podspec
  75. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseInstanceID.podspec
  76. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseMessaging.podspec
  77. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseStorage.podspec
  78. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseInAppMessaging.podspec
  79. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseInAppMessagingDisplay.podspec
  80. - stage: test
  81. env:
  82. - PROJECT=Firestore PLATFORM=iOS METHOD=pod-lib-lint
  83. before_install:
  84. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  85. script:
  86. # Eliminate the one warning from BoringSSL when CocoaPods 1.6.0 is available.
  87. # The travis_wait is necessary because the command takes more than 10 minutes.
  88. - travis_wait 30 ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseFirestore.podspec --platforms=ios --allow-warnings --no-subspecs
  89. # pod lib lint to check build and warnings for static library build - only on cron jobs
  90. - stage: test
  91. if: type = cron
  92. env:
  93. - PROJECT=Firebase PLATFORM=iOS METHOD=pod-lib-lint
  94. before_install:
  95. - ./scripts/install_prereqs.sh
  96. script:
  97. - travis_retry ./scripts/pod_lib_lint.sh GoogleUtilities.podspec --use-libraries
  98. - travis_retry ./scripts/pod_lib_lint.sh FirebaseAnalyticsInterop.podspec --use-libraries
  99. - travis_retry ./scripts/pod_lib_lint.sh FirebaseAuth.podspec --use-libraries
  100. - travis_retry ./scripts/pod_lib_lint.sh FirebaseAuthInterop.podspec --use-libraries
  101. - travis_retry ./scripts/pod_lib_lint.sh FirebaseDatabase.podspec --use-libraries
  102. - travis_retry ./scripts/pod_lib_lint.sh FirebaseDynamicLinks.podspec --use-libraries
  103. - travis_retry ./scripts/pod_lib_lint.sh FirebaseInstanceID.podspec --use-libraries
  104. # The Protobuf dependency of FirebaseMessaging has warnings with --use-libraries
  105. - travis_retry ./scripts/pod_lib_lint.sh FirebaseMessaging.podspec --use-libraries --allow-warnings
  106. - travis_retry ./scripts/pod_lib_lint.sh FirebaseStorage.podspec --use-libraries
  107. - travis_retry ./scripts/pod_lib_lint.sh FirebaseInAppMessaging.podspec --use-libraries
  108. - travis_retry ./scripts/pod_lib_lint.sh FirebaseInAppMessagingDisplay.podspec --use-libraries
  109. - stage: test
  110. if: type = cron
  111. env:
  112. - PROJECT=Firestore PLATFORM=iOS METHOD=pod-lib-lint
  113. before_install:
  114. - ./scripts/install_prereqs.sh
  115. script:
  116. # TBD - non-portable path warnings
  117. # The travis_wait is necessary because the command takes more than 10 minutes.
  118. - travis_wait 45 ./scripts/pod_lib_lint.sh FirebaseFirestore.podspec --use-libraries --allow-warnings --no-subspecs
  119. # GoogleDataTransport unit tests and pod linting using the default Xcode version.
  120. - stage: test
  121. env:
  122. - PROJECT=GoogleDataTransport PLATFORM=iOS METHOD=xcodebuild
  123. before_install:
  124. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  125. script:
  126. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
  127. - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh GoogleDataTransport.podspec
  128. # GoogleDataTransport integration tests using the default Xcode version.
  129. - stage: test
  130. env:
  131. - PROJECT=GoogleDataTransportIntegrationTest PLATFORM=iOS METHOD=xcodebuild
  132. before_install:
  133. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  134. script:
  135. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
  136. # GoogleDataTransportCCTSupport unit tests and pod linting using the default Xcode version.
  137. - stage: test
  138. env:
  139. - PROJECT=GoogleDataTransportCCTSupport PLATFORM=iOS METHOD=xcodebuild
  140. before_install:
  141. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  142. script:
  143. - ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
  144. - ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh GoogleDataTransportCCTSupport.podspec
  145. # Daily test for symbol collisions between Firebase and CocoaPods.
  146. - stage: test
  147. if: type = cron
  148. env:
  149. - PROJECT=SymbolCollision PLATFORM=iOS METHOD=xcodebuild
  150. before_install:
  151. - ./scripts/install_prereqs.sh
  152. script:
  153. - travis_retry ./scripts/build.sh $PROJECT $PLATFORM $METHOD
  154. # Alternative platforms
  155. - stage: test
  156. env:
  157. - PROJECT=Firestore PLATFORM=macOS METHOD=cmake
  158. before_install:
  159. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  160. script:
  161. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
  162. # Test Firestore on Xcode 8 to use old llvm to ensure C++ portability.
  163. - stage: test
  164. osx_image: xcode8.3
  165. env:
  166. - PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild XCODE_VERSION=8.3.3
  167. before_install:
  168. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  169. script:
  170. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
  171. # Community-supported platforms
  172. - stage: test
  173. env:
  174. - PROJECT=Firebase PLATFORM=macOS METHOD=xcodebuild
  175. before_install:
  176. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  177. script:
  178. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
  179. - stage: test
  180. env:
  181. - PROJECT=Firebase PLATFORM=tvOS METHOD=xcodebuild
  182. before_install:
  183. - ./scripts/if_changed.sh ./scripts/install_prereqs.sh
  184. script:
  185. - travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
  186. - stage: test
  187. env:
  188. - PROJECT=Firestore 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=Firestore 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. # Validate Cocoapods configurations
  233. # This may take long time, so we would like to run it only once all other tests pass
  234. # Validate Cocoapods 1.7.0 compatibility
  235. - stage: test
  236. if: type = cron
  237. env:
  238. - POD_CONFIG_DIR=Cocoapods1_7_0_multiprojects_frameworks
  239. script:
  240. - travis_retry ./CocoapodsIntegrationTest/scripts/build_with_environment.sh --gemfile=./CocoapodsIntegrationTest/TestEnvironments/${POD_CONFIG_DIR}/Gemfile --podfile=./CocoapodsIntegrationTest/TestEnvironments/${POD_CONFIG_DIR}/Podfile
  241. - stage: test
  242. if: type = cron
  243. env:
  244. - POD_CONFIG_DIR=Cocoapods1_7_0_frameworks
  245. script:
  246. - travis_retry ./CocoapodsIntegrationTest/scripts/build_with_environment.sh --gemfile=./CocoapodsIntegrationTest/TestEnvironments/${POD_CONFIG_DIR}/Gemfile --podfile=./CocoapodsIntegrationTest/TestEnvironments/${POD_CONFIG_DIR}/Podfile
  247. - stage: test
  248. if: type = cron
  249. env:
  250. - POD_CONFIG_DIR=Cocoapods1_7_0_multiprojects_staticLibs
  251. script:
  252. - travis_retry ./CocoapodsIntegrationTest/scripts/build_with_environment.sh --gemfile=./CocoapodsIntegrationTest/TestEnvironments/${POD_CONFIG_DIR}/Gemfile --podfile=./CocoapodsIntegrationTest/TestEnvironments/${POD_CONFIG_DIR}/Podfile
  253. - stage: test
  254. if: type = cron
  255. env:
  256. - POD_CONFIG_DIR=Cocoapods1_7_0_staticLibs
  257. script:
  258. - travis_retry ./CocoapodsIntegrationTest/scripts/build_with_environment.sh --gemfile=./CocoapodsIntegrationTest/TestEnvironments/${POD_CONFIG_DIR}/Gemfile --podfile=./CocoapodsIntegrationTest/TestEnvironments/${POD_CONFIG_DIR}/Podfile
  259. # Validate Cocoapods 1.6.1 compatibility
  260. - stage: test
  261. if: type = cron
  262. env:
  263. - POD_CONFIG_DIR=Cocoapods1_6_1_frameworks
  264. script:
  265. - travis_retry ./CocoapodsIntegrationTest/scripts/build_with_environment.sh --gemfile=./CocoapodsIntegrationTest/TestEnvironments/${POD_CONFIG_DIR}/Gemfile --podfile=./CocoapodsIntegrationTest/TestEnvironments/${POD_CONFIG_DIR}/Podfile
  266. - stage: test
  267. if: type = cron
  268. env:
  269. - POD_CONFIG_DIR=Cocoapods1_6_1_staticLibs
  270. script:
  271. - travis_retry ./CocoapodsIntegrationTest/scripts/build_with_environment.sh --gemfile=./CocoapodsIntegrationTest/TestEnvironments/${POD_CONFIG_DIR}/Gemfile --podfile=./CocoapodsIntegrationTest/TestEnvironments/${POD_CONFIG_DIR}/Podfile
  272. allow_failures:
  273. # Run fuzz tests only on cron jobs.
  274. - stage: test
  275. if: type = cron
  276. env:
  277. - PROJECT=Firestore PLATFORM=iOS METHOD=fuzz
  278. before_install:
  279. - ./scripts/install_prereqs.sh
  280. script:
  281. # The travis_wait is necessary because fuzzing runs for 40 minutes.
  282. - travis_wait 45 ./scripts/fuzzing_ci.sh
  283. # TODO(varconst): UBSan for CMake. UBSan failures are non-fatal by default,
  284. # need to make them fatal for the purposes of the test run.
  285. # TODO(varconst): disallow sanitizers to fail once we fix all existing issues.
  286. - env:
  287. - PROJECT=Firestore PLATFORM=macOS METHOD=cmake SANITIZERS=asan
  288. - env:
  289. - PROJECT=Firestore PLATFORM=macOS METHOD=cmake SANITIZERS=tsan
  290. - env:
  291. - PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild SANITIZERS=asan
  292. - env:
  293. - PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild SANITIZERS=tsan
  294. - env:
  295. - PROJECT=InAppMessaging PLATFORM=iOS METHOD=xcodebuild
  296. - env:
  297. - PROJECT=GoogleDataTransportIntegrationTest PLATFORM=iOS METHOD=xcodebuild
  298. # TODO(varconst): enable if it's possible to make this flag work on build
  299. # stages. It's supposed to avoid waiting for jobs that are allowed to fail
  300. # before reporting the results.
  301. # fast_finish: true
  302. branches:
  303. only:
  304. - master