mlmodeldownloader.yml 6.4 KB

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