remoteconfig.yml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. name: remoteconfig
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. paths:
  8. - 'FirebaseRemoteConfig**'
  9. - '.github/workflows/remoteconfig.yml'
  10. - 'Gemfile'
  11. schedule:
  12. # Run every day at 11pm (PST) - cron uses UTC times
  13. - cron: '0 7 * * *'
  14. jobs:
  15. remoteconfig:
  16. env:
  17. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  18. runs-on: macos-latest
  19. strategy:
  20. matrix:
  21. target: [iOS, tvOS, macOS]
  22. steps:
  23. - uses: actions/checkout@v2
  24. - name: Setup Bundler
  25. run: scripts/setup_bundler.sh
  26. - name: Install Secret GoogleService-Info.plist
  27. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/RemoteConfigSwiftAPI/GoogleService-Info.plist.gpg \
  28. FirebaseRemoteConfig/Tests/SwiftAPI/GoogleService-Info.plist "$plist_secret"
  29. - name: BuildAndUnitTest # can be replaced with pod lib lint with CocoaPods 1.10
  30. run: scripts/third_party/travis/retry.sh scripts/build.sh RemoteConfig ${{ matrix.target }} unit
  31. - name: Fake Console API Tests
  32. run: scripts/third_party/travis/retry.sh scripts/build.sh RemoteConfig iOS fakeconsole
  33. - name: IntegrationTest
  34. if: matrix.target == 'iOS'
  35. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh RemoteConfig iOS integration)
  36. pod-lib-lint:
  37. runs-on: macOS-latest
  38. strategy:
  39. matrix:
  40. target: [ios, tvos, macos]
  41. steps:
  42. - uses: actions/checkout@v2
  43. - name: Setup Bundler
  44. run: scripts/setup_bundler.sh
  45. - name: Build and test
  46. run: |
  47. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseRemoteConfig.podspec --skip-tests --platforms=${{ matrix.target }}
  48. catalyst:
  49. runs-on: macOS-latest
  50. steps:
  51. - uses: actions/checkout@v2
  52. - name: Setup Bundler
  53. run: scripts/setup_bundler.sh
  54. - name: Setup project and Build for Catalyst
  55. # Only build the unit tests on Catalyst. Test stopped working when GHA moved to Xcode 11.4.1.
  56. run: scripts/test_catalyst.sh FirebaseRemoteConfig build FirebaseRemoteConfig-Unit-unit
  57. quickstart_framework:
  58. env:
  59. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  60. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  61. runs-on: macOS-latest
  62. steps:
  63. - uses: actions/checkout@v2
  64. - name: Install gcloud tool
  65. run: scripts/install_gcloud.sh
  66. - name: Access GCS bucket
  67. run: |
  68. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/firebase-ios-testing.json.gpg firebase-ios-testing.json "$plist_secret"
  69. gcloud auth activate-service-account --key-file firebase-ios-testing.json
  70. - name: Pull framework zip files from GCS
  71. run: |
  72. gsutil cp gs://ios-framework-zip/latest_commit_hash.txt latest_commit_hash.txt
  73. commit_hash="$(cat 'latest_commit_hash.txt')"
  74. gsutil cp "gs://ios-framework-zip/Firebase-actions-dir-${commit_hash}.zip" Firebase-actions-dir.zip
  75. - name: Unzip the framework
  76. run: |
  77. mkdir "${HOME}/ios_frameworks"
  78. unzip Firebase-actions-dir.zip -d "${HOME}/ios_frameworks"
  79. find "${HOME}/ios_frameworks" -name "*.zip" -maxdepth 2 -exec unzip -d "${HOME}/ios_frameworks" {} +
  80. pwd
  81. - name: Setup quickstart
  82. run: |
  83. git clone https://github.com/firebase/quickstart-ios.git
  84. cd quickstart-ios/Config
  85. chmod +x ../scripts/info_script.rb
  86. ruby ../scripts/info_script.rb Config
  87. - name: Move frameworks to xcode project
  88. run: |
  89. find "${HOME}/ios_frameworks" -type d -name "Firebase" -maxdepth 1 -exec mv {}/ quickstart-ios/config/ \;
  90. cd quickstart-ios/config
  91. ls
  92. ../scripts/add_framework_script.rb Config ConfigExample Firebase/FirebaseAnalytics
  93. ../scripts/add_framework_script.rb Config ConfigExample Firebase/FirebaseRemoteConfig
  94. cd ../..
  95. - name: Install Secret GoogleService-Info.plist
  96. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-config.plist.gpg \
  97. quickstart-ios/config/GoogleService-Info.plist "$plist_secret"
  98. - name: Install Secret FIREGSignInInfo.h
  99. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/FIREGSignInInfo.h.gpg \
  100. quickstart-ios/TestUtils/FIREGSignInInfo.h "$signin_secret"
  101. - name: Test Quickstart
  102. run: |
  103. cd quickstart-ios/config
  104. xcodebuild test -project ConfigExample.xcodeproj -scheme ConfigExample -destination 'platform=iOS Simulator,name=iPhone 11 Pro' "OTHER_LDFLAGS=\$(OTHER_LDFLAGS) -ObjC" "FRAMEWORK_SEARCH_PATHS= \$(PROJECT_DIR)/Firebase/FirebaseRemoteConfig \$(PROJECT_DIR)/Firebase/FirebaseAnalytics" HEADER_SEARCH_PATHS='$(PROJECT_DIR)/Firebase $(PROJECT_DIR)/Firebase/FirebaseAnalytics $(PROJECT_DIR)/Firebase/FirebaseRemoteConfig'
  105. - name: Display xcodebuild setup
  106. if: ${{ failure() }}
  107. run: |
  108. cd quickstart-ios/config
  109. xcodebuild -project ConfigExample.xcodeproj -target "ConfigExample" -showBuildSettings
  110. - name: Remove data before upload
  111. if: ${{ failure() }}
  112. run: |
  113. rm -rf quickstart-ios/config/Firebase/
  114. rm -f quickstart-ios/config/GoogleSerivce-info.plist
  115. rm -f quickstart-ios/TestUtils/FIREGSignInInfo.h
  116. - uses: actions/upload-artifact@v2
  117. if: failure()
  118. with:
  119. name: quickstart_artifacts
  120. path: quickstart-ios/
  121. quickstart:
  122. env:
  123. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  124. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  125. runs-on: macOS-latest
  126. steps:
  127. - uses: actions/checkout@v2
  128. - name: Setup quickstart
  129. run: scripts/setup_quickstart.sh config
  130. - name: Install Secret GoogleService-Info.plist
  131. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-config.plist.gpg \
  132. quickstart-ios/config/GoogleService-Info.plist "$plist_secret"
  133. - name: Install Secret FIREGSignInInfo.h
  134. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/FIREGSignInInfo.h.gpg \
  135. quickstart-ios/TestUtils/FIREGSignInInfo.h "$signin_secret"
  136. - name: Test objc quickstart
  137. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Config)
  138. - name: Test swift quickstart
  139. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Config swift)
  140. remoteconfig-cron-only:
  141. runs-on: macos-latest
  142. if: github.event_name == 'schedule'
  143. strategy:
  144. matrix:
  145. target: [ios, tvos, macos]
  146. flags: [
  147. '--skip-tests --use-modular-headers',
  148. '--skip-tests --use-libraries'
  149. ]
  150. needs: pod-lib-lint
  151. steps:
  152. - uses: actions/checkout@v2
  153. - name: Setup Bundler
  154. run: scripts/setup_bundler.sh
  155. - name: PodLibLint RemoteConfig Cron
  156. run: |
  157. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseRemoteConfig.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}