mlmodeldownloader.yml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. name: mlmodeldownloader
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. paths:
  6. - 'FirebaseMLModelDownloader**'
  7. - '.github/workflows/mlmodeldownloader.yml'
  8. - 'Gemfile*'
  9. schedule:
  10. # Run every day at 11pm (PST) - cron uses UTC times
  11. - cron: '0 7 * * *'
  12. concurrency:
  13. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  14. cancel-in-progress: true
  15. jobs:
  16. pod-lib-lint:
  17. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  18. env:
  19. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  20. strategy:
  21. matrix:
  22. target: [ios, tvos, macos, watchos]
  23. build-env:
  24. - os: macos-14
  25. xcode: Xcode_16.2
  26. - os: macos-15
  27. xcode: Xcode_16.2
  28. runs-on: ${{ matrix.build-env.os }}
  29. steps:
  30. - uses: actions/checkout@v4
  31. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  32. - name: Setup Bundler
  33. run: scripts/setup_bundler.sh
  34. - name: Configure test keychain
  35. run: scripts/configure_test_keychain.sh
  36. - name: Install GoogleService-Info.plist
  37. run: |
  38. mkdir FirebaseMLModelDownloader/Tests/Integration/Resources
  39. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/MLModelDownloader/GoogleService-Info.plist.gpg \
  40. FirebaseMLModelDownloader/Tests/Integration/Resources/GoogleService-Info.plist "$plist_secret"
  41. - name: Xcode
  42. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  43. - name: Build and test
  44. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseMLModelDownloader.podspec --platforms=${{ matrix.target }})
  45. mlmodeldownloader-cron-only:
  46. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  47. runs-on: macos-15
  48. env:
  49. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  50. strategy:
  51. matrix:
  52. target: [ios, tvos, macos]
  53. needs: pod-lib-lint
  54. steps:
  55. - uses: actions/checkout@v4
  56. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  57. - name: Xcode
  58. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  59. - name: Setup Bundler
  60. run: scripts/setup_bundler.sh
  61. - name: Configure test keychain
  62. run: scripts/configure_test_keychain.sh
  63. - name: Install GoogleService-Info.plist
  64. run: |
  65. mkdir FirebaseMLModelDownloader/Tests/Integration/Resources
  66. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/MLModelDownloader/GoogleService-Info.plist.gpg \
  67. FirebaseMLModelDownloader/Tests/Integration/Resources/GoogleService-Info.plist "$plist_secret"
  68. - name: PodLibLint MLModelDownloader Cron
  69. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseMLModelDownloader.podspec --platforms=${{ matrix.target }} --use-static-frameworks
  70. spm-package-resolved:
  71. env:
  72. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  73. runs-on: macos-14
  74. outputs:
  75. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  76. steps:
  77. - uses: actions/checkout@v4
  78. - name: Xcode
  79. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  80. - name: Generate Swift Package.resolved
  81. id: swift_package_resolve
  82. run: |
  83. swift package resolve
  84. - name: Generate cache key
  85. id: generate_cache_key
  86. run: |
  87. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  88. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  89. - uses: actions/cache/save@v4
  90. id: cache
  91. with:
  92. path: .build
  93. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  94. spm:
  95. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  96. needs: [spm-package-resolved]
  97. strategy:
  98. matrix:
  99. include:
  100. - os: macos-14
  101. xcode: Xcode_16.2
  102. target: iOS
  103. - os: macos-15
  104. xcode: Xcode_16.2
  105. target: iOS
  106. - os: macos-15
  107. xcode: Xcode_16.2
  108. target: tvOS
  109. - os: macos-15
  110. xcode: Xcode_16.2
  111. target: macOS
  112. - os: macos-15
  113. xcode: Xcode_16.2
  114. target: watchOS
  115. - os: macos-15
  116. xcode: Xcode_16.2
  117. target: catalyst
  118. - os: macos-15
  119. xcode: Xcode_16.2
  120. target: visionOS
  121. runs-on: ${{ matrix.os }}
  122. steps:
  123. - uses: actions/checkout@v4
  124. - uses: actions/cache/restore@v4
  125. with:
  126. path: .build
  127. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  128. - name: Xcode
  129. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  130. - name: Install visionOS, if needed.
  131. if: matrix.target == 'visionOS'
  132. run: xcodebuild -downloadPlatform visionOS
  133. - name: Initialize xcodebuild
  134. run: scripts/setup_spm_tests.sh
  135. - name: Unit Tests
  136. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseMLModelDownloaderUnit ${{ matrix.target }} spm
  137. catalyst:
  138. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  139. runs-on: macos-15
  140. steps:
  141. - uses: actions/checkout@v4
  142. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  143. with:
  144. cache_key: catalyst${{ matrix.os }}
  145. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  146. - name: Setup Bundler
  147. run: scripts/setup_bundler.sh
  148. - name: Xcode
  149. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  150. - name: Setup project and Build Catalyst
  151. run: scripts/test_catalyst.sh FirebaseMLModelDownloader test FirebaseMLModelDownloader-Unit-unit
  152. mlmodeldownloader-sample-build-test:
  153. # Don't run on private repo unless it is a PR.
  154. if: github.repository == 'Firebase/firebase-ios-sdk' && (github.event_name == 'schedule' || github.event_name == 'pull_request')
  155. env:
  156. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  157. runs-on: macos-15
  158. steps:
  159. - uses: actions/checkout@v4
  160. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  161. with:
  162. cache_key: build-test${{ matrix.os }}
  163. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  164. - name: Xcode
  165. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  166. - name: Setup Bundler
  167. run: scripts/setup_bundler.sh
  168. - name: Install GoogleService-Info.plist
  169. run: |
  170. mkdir FirebaseMLModelDownloader/Apps/Sample/Resources
  171. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/MLModelDownloader/GoogleService-Info.plist.gpg \
  172. FirebaseMLModelDownloader/Apps/Sample/Resources/GoogleService-Info.plist "$plist_secret"
  173. - name: Prereqs
  174. run: scripts/install_prereqs.sh MLModelDownloaderSample iOS
  175. - name: Build
  176. run: ([ -z $plist_secret ] || scripts/build.sh MLModelDownloaderSample iOS)