mlmodeldownloader.yml 6.3 KB

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