remoteconfig.yml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. name: remoteconfig
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseRemoteConfig**'
  6. - 'Interop/Analytics/Public/*.h'
  7. - '.github/workflows/remoteconfig.yml'
  8. - 'Gemfile*'
  9. - 'scripts/generate_access_token.sh'
  10. - 'scripts/gha-encrypted/RemoteConfigSwiftAPI/**'
  11. schedule:
  12. # Run every day at 12am (PST) - cron uses UTC times
  13. - cron: '0 8 * * *'
  14. concurrency:
  15. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  16. cancel-in-progress: true
  17. jobs:
  18. remoteconfig:
  19. # Don't run on private repo unless it is a PR.
  20. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  21. env:
  22. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  23. USE_REAL_CONSOLE: true
  24. runs-on: macos-14
  25. strategy:
  26. matrix:
  27. target: [iOS]
  28. steps:
  29. - uses: actions/checkout@v4
  30. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  31. with:
  32. cache_key: rc${{ matrix.target }}
  33. - uses: ruby/setup-ruby@v1
  34. - name: Setup Bundler
  35. run: scripts/setup_bundler.sh
  36. - name: Install xcpretty
  37. run: gem install xcpretty
  38. - name: Install Secret GoogleService-Info.plist
  39. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/RemoteConfigSwiftAPI/GoogleService-Info.plist.gpg \
  40. FirebaseRemoteConfig/Tests/Swift/SwiftAPI/GoogleService-Info.plist "$plist_secret"
  41. - name: Generate Access Token for RemoteConfigConsoleAPI in IntegrationTests
  42. if: matrix.target == 'iOS'
  43. run: ([ -z $plist_secret ] || scripts/generate_access_token.sh "$plist_secret" scripts/gha-encrypted/RemoteConfigSwiftAPI/ServiceAccount.json.gpg
  44. FirebaseRemoteConfig/Tests/Swift/AccessToken.json)
  45. - name: Fake Console API Tests
  46. run: scripts/third_party/travis/retry.sh scripts/build.sh RemoteConfig ${{ matrix.target }} fakeconsole
  47. - name: IntegrationTest
  48. if: matrix.target == 'iOS'
  49. # No retry to avoid exhausting AccessToken quota.
  50. run: ([ -z $plist_secret ] || scripts/build.sh RemoteConfig iOS integration)
  51. pod-lib-lint:
  52. # Don't run on private repo unless it is a PR.
  53. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  54. strategy:
  55. matrix:
  56. # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532
  57. target: [ios, tvos, macos --skip-tests, watchos]
  58. podspec: [FirebaseRemoteConfig.podspec]
  59. build-env:
  60. - os: macos-14
  61. xcode: Xcode_15.3
  62. # TODO(#13078): Fix testing infra to enforce warnings again.
  63. tests: --allow-warnings
  64. # Flaky tests on CI
  65. - os: macos-15
  66. xcode: Xcode_16.1
  67. tests: --skip-tests
  68. runs-on: ${{ matrix.build-env.os }}
  69. steps:
  70. - uses: actions/checkout@v4
  71. - uses: ruby/setup-ruby@v1
  72. - name: Setup Bundler
  73. run: scripts/setup_bundler.sh
  74. - name: Xcode
  75. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  76. - name: Build and test
  77. run: |
  78. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }} \
  79. ${{ matrix.build-env.tests }}
  80. spm-package-resolved:
  81. env:
  82. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  83. runs-on: macos-14
  84. outputs:
  85. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  86. steps:
  87. - uses: actions/checkout@v4
  88. - name: Generate Swift Package.resolved
  89. id: swift_package_resolve
  90. run: |
  91. swift package resolve
  92. - name: Generate cache key
  93. id: generate_cache_key
  94. run: |
  95. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  96. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  97. - uses: actions/cache/save@v4
  98. id: cache
  99. with:
  100. path: .build
  101. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  102. spm:
  103. # Don't run on private repo unless it is a PR.
  104. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  105. needs: [spm-package-resolved]
  106. strategy:
  107. matrix:
  108. include:
  109. - os: macos-13
  110. xcode: Xcode_15.2
  111. target: iOS
  112. test: spm
  113. - os: macos-14
  114. xcode: Xcode_15.4
  115. target: iOS
  116. test: spm
  117. - os: macos-15
  118. xcode: Xcode_16.1
  119. target: iOS
  120. test: spm
  121. - os: macos-15
  122. xcode: Xcode_16.1
  123. target: tvOS
  124. test: spm
  125. - os: macos-15
  126. xcode: Xcode_16.1
  127. target: macOS
  128. test: spm
  129. - os: macos-15
  130. xcode: Xcode_16.1
  131. target: watchOS
  132. test: spmbuildonly
  133. - os: macos-15
  134. xcode: Xcode_16.1
  135. target: catalyst
  136. test: spm
  137. - os: macos-15
  138. xcode: Xcode_16.1
  139. target: visionOS
  140. test: spm
  141. runs-on: ${{ matrix.os }}
  142. steps:
  143. - uses: actions/checkout@v4
  144. - uses: actions/cache/restore@v4
  145. with:
  146. path: .build
  147. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  148. - name: Xcode
  149. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  150. - name: Initialize xcodebuild
  151. run: scripts/setup_spm_tests.sh
  152. - name: Unit Tests
  153. run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigUnit ${{ matrix.target }} spm
  154. - name: Fake Console tests
  155. run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigFakeConsole ${{ matrix.target }} ${{ matrix.test }}
  156. catalyst:
  157. # Don't run on private repo unless it is a PR.
  158. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  159. runs-on: macos-14
  160. steps:
  161. - uses: actions/checkout@v4
  162. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  163. with:
  164. cache_key: catalyst${{ matrix.os }}
  165. - uses: ruby/setup-ruby@v1
  166. - name: Setup Bundler
  167. run: scripts/setup_bundler.sh
  168. - name: Setup project and Build for Catalyst
  169. run: scripts/test_catalyst.sh FirebaseRemoteConfig test FirebaseRemoteConfig-Unit-unit
  170. quickstart:
  171. # Don't run on private repo unless it is a PR.
  172. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  173. env:
  174. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  175. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  176. runs-on: macos-15
  177. steps:
  178. - uses: actions/checkout@v4
  179. - uses: ruby/setup-ruby@v1
  180. - name: Setup quickstart
  181. run: scripts/setup_quickstart.sh config
  182. - name: Install Secret GoogleService-Info.plist
  183. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-config.plist.gpg \
  184. quickstart-ios/config/GoogleService-Info.plist "$plist_secret"
  185. - name: Test Swift Quickstart
  186. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Config true)
  187. # TODO(@sunmou99): currently have issue with this job, will re-enable it once the issue resolved.
  188. # quickstart-ftl-cron-only:
  189. # # Don't run on private repo.
  190. # if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  191. # env:
  192. # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  193. # signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  194. # runs-on: macos-14
  195. # steps:
  196. # - uses: actions/checkout@v4
  197. # - uses: ruby/setup-ruby@v1
  198. # - uses: actions/setup-python@v5
  199. # with:
  200. # python-version: '3.11'
  201. # - name: Setup quickstart
  202. # run: scripts/setup_quickstart.sh config
  203. # - name: Install Secret GoogleService-Info.plist
  204. # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-config.plist.gpg \
  205. # quickstart-ios/config/GoogleService-Info.plist "$plist_secret"
  206. # - name: Build Swift Quickstart
  207. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Config)
  208. # - id: ftl_test
  209. # uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  210. # with:
  211. # credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  212. # testapp_dir: quickstart-ios/build-for-testing
  213. # test_type: "xctest"
  214. sample-build-test:
  215. # Don't run on private repo unless it is a PR.
  216. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  217. runs-on: macos-14
  218. steps:
  219. - uses: actions/checkout@v4
  220. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  221. with:
  222. cache_key: build-test
  223. - uses: ruby/setup-ruby@v1
  224. - name: Setup Bundler
  225. run: scripts/setup_bundler.sh
  226. - name: Xcode
  227. run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
  228. - name: Prereqs
  229. run: scripts/install_prereqs.sh RemoteConfigSample iOS
  230. - name: Build
  231. run: scripts/build.sh RemoteConfigSample iOS
  232. remoteconfig-cron-only:
  233. # Don't run on private repo.
  234. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  235. runs-on: macos-14
  236. strategy:
  237. matrix:
  238. target: [ios, tvos, macos]
  239. flags: [
  240. '--skip-tests --use-static-frameworks'
  241. ]
  242. needs: pod-lib-lint
  243. steps:
  244. - uses: actions/checkout@v4
  245. - uses: ruby/setup-ruby@v1
  246. - name: Setup Bundler
  247. run: scripts/setup_bundler.sh
  248. - name: PodLibLint RemoteConfig Cron
  249. run: |
  250. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseRemoteConfig.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}