remoteconfig.yml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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. os: [macos-14]
  60. include:
  61. - os: macos-14
  62. xcode: Xcode_15.3
  63. # TODO(#13078): Fix testing infra to enforce warnings again.
  64. tests: --allow-warnings
  65. # Flaky tests on CI
  66. - os: macos-14
  67. xcode: Xcode_16
  68. tests: --skip-tests
  69. runs-on: ${{ matrix.os }}
  70. steps:
  71. - uses: actions/checkout@v4
  72. - uses: ruby/setup-ruby@v1
  73. - name: Setup Bundler
  74. run: scripts/setup_bundler.sh
  75. - name: Xcode
  76. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  77. - name: Build and test
  78. run: |
  79. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }} \
  80. ${{ matrix.tests }}
  81. spm-package-resolved:
  82. env:
  83. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  84. runs-on: macos-14
  85. outputs:
  86. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  87. steps:
  88. - uses: actions/checkout@v4
  89. - name: Generate Swift Package.resolved
  90. id: swift_package_resolve
  91. run: |
  92. swift package resolve
  93. - name: Generate cache key
  94. id: generate_cache_key
  95. run: |
  96. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  97. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  98. - uses: actions/cache/save@v4
  99. id: cache
  100. with:
  101. path: .build
  102. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  103. spm:
  104. # Don't run on private repo unless it is a PR.
  105. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  106. needs: [spm-package-resolved]
  107. strategy:
  108. matrix:
  109. include:
  110. - os: macos-13
  111. xcode: Xcode_15.2
  112. target: iOS
  113. - os: macos-14
  114. xcode: Xcode_15.4
  115. target: iOS
  116. - os: macos-15
  117. xcode: Xcode_16
  118. target: iOS
  119. - os: macos-15
  120. xcode: Xcode_16
  121. target: tvOS
  122. - os: macos-15
  123. xcode: Xcode_16
  124. target: macOS
  125. - os: macos-15
  126. xcode: Xcode_16
  127. target: watchOS
  128. - os: macos-15
  129. xcode: Xcode_16
  130. target: catalyst
  131. - os: macos-15
  132. xcode: Xcode_16
  133. target: visionOS
  134. runs-on: ${{ matrix.os }}
  135. steps:
  136. - uses: actions/checkout@v4
  137. - uses: actions/cache/restore@v4
  138. with:
  139. path: .build
  140. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  141. - name: Xcode
  142. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  143. - name: Initialize xcodebuild
  144. run: scripts/setup_spm_tests.sh
  145. - name: Unit Tests
  146. run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigUnit ${{ matrix.target }} spm
  147. - name: Fake Console tests
  148. run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigFakeConsole ${{ matrix.target }} spm
  149. catalyst:
  150. # Don't run on private repo unless it is a PR.
  151. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  152. runs-on: macos-14
  153. steps:
  154. - uses: actions/checkout@v4
  155. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  156. with:
  157. cache_key: catalyst${{ matrix.os }}
  158. - uses: ruby/setup-ruby@v1
  159. - name: Setup Bundler
  160. run: scripts/setup_bundler.sh
  161. - name: Setup project and Build for Catalyst
  162. run: scripts/test_catalyst.sh FirebaseRemoteConfig test FirebaseRemoteConfig-Unit-unit
  163. quickstart:
  164. # Don't run on private repo unless it is a PR.
  165. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  166. env:
  167. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  168. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  169. runs-on: macos-14
  170. steps:
  171. - uses: actions/checkout@v4
  172. - uses: ruby/setup-ruby@v1
  173. - name: Setup quickstart
  174. run: scripts/setup_quickstart.sh config
  175. - name: Install Secret GoogleService-Info.plist
  176. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-config.plist.gpg \
  177. quickstart-ios/config/GoogleService-Info.plist "$plist_secret"
  178. - name: Test Swift Quickstart
  179. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Config true)
  180. # TODO(@sunmou99): currently have issue with this job, will re-enable it once the issue resolved.
  181. # quickstart-ftl-cron-only:
  182. # # Don't run on private repo.
  183. # if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  184. # env:
  185. # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  186. # signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  187. # runs-on: macos-14
  188. # steps:
  189. # - uses: actions/checkout@v4
  190. # - uses: ruby/setup-ruby@v1
  191. # - uses: actions/setup-python@v5
  192. # with:
  193. # python-version: '3.11'
  194. # - name: Setup quickstart
  195. # run: scripts/setup_quickstart.sh config
  196. # - name: Install Secret GoogleService-Info.plist
  197. # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-config.plist.gpg \
  198. # quickstart-ios/config/GoogleService-Info.plist "$plist_secret"
  199. # - name: Build Swift Quickstart
  200. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Config)
  201. # - id: ftl_test
  202. # uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  203. # with:
  204. # credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  205. # testapp_dir: quickstart-ios/build-for-testing
  206. # test_type: "xctest"
  207. sample-build-test:
  208. # Don't run on private repo unless it is a PR.
  209. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  210. runs-on: macos-14
  211. steps:
  212. - uses: actions/checkout@v4
  213. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  214. with:
  215. cache_key: build-test
  216. - uses: ruby/setup-ruby@v1
  217. - name: Setup Bundler
  218. run: scripts/setup_bundler.sh
  219. - name: Xcode
  220. run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
  221. - name: Prereqs
  222. run: scripts/install_prereqs.sh RemoteConfigSample iOS
  223. - name: Build
  224. run: scripts/build.sh RemoteConfigSample iOS
  225. remoteconfig-cron-only:
  226. # Don't run on private repo.
  227. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  228. runs-on: macos-14
  229. strategy:
  230. matrix:
  231. target: [ios, tvos, macos]
  232. flags: [
  233. '--skip-tests --use-static-frameworks'
  234. ]
  235. needs: pod-lib-lint
  236. steps:
  237. - uses: actions/checkout@v4
  238. - uses: ruby/setup-ruby@v1
  239. - name: Setup Bundler
  240. run: scripts/setup_bundler.sh
  241. - name: PodLibLint RemoteConfig Cron
  242. run: |
  243. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseRemoteConfig.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}