mlmodeldownloader.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. runs-on: macos-12
  18. env:
  19. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  20. strategy:
  21. matrix:
  22. target: [ios, tvos, macos]
  23. steps:
  24. - uses: actions/checkout@v3
  25. - uses: ruby/setup-ruby@v1
  26. - name: Setup Bundler
  27. run: scripts/setup_bundler.sh
  28. - name: Configure test keychain
  29. run: scripts/configure_test_keychain.sh
  30. - name: Install GoogleService-Info.plist
  31. run: |
  32. mkdir FirebaseMLModelDownloader/Tests/Integration/Resources
  33. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/MLModelDownloader/GoogleService-Info.plist.gpg \
  34. FirebaseMLModelDownloader/Tests/Integration/Resources/GoogleService-Info.plist "$plist_secret"
  35. - name: Build and test
  36. # TODO: Disable verbose logging after flaky test investigation.
  37. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseMLModelDownloader.podspec --verbose --platforms=${{ matrix.target }})
  38. mlmodeldownloader-cron-only:
  39. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  40. runs-on: macos-12
  41. env:
  42. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  43. strategy:
  44. matrix:
  45. target: [ios, tvos, macos]
  46. needs: pod-lib-lint
  47. steps:
  48. - uses: actions/checkout@v3
  49. - uses: ruby/setup-ruby@v1
  50. - name: Setup Bundler
  51. run: scripts/setup_bundler.sh
  52. - name: Configure test keychain
  53. run: scripts/configure_test_keychain.sh
  54. - name: Install GoogleService-Info.plist
  55. run: |
  56. mkdir FirebaseMLModelDownloader/Tests/Integration/Resources
  57. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/MLModelDownloader/GoogleService-Info.plist.gpg \
  58. FirebaseMLModelDownloader/Tests/Integration/Resources/GoogleService-Info.plist "$plist_secret"
  59. - name: PodLibLint MLModelDownloader Cron
  60. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseMLModelDownloader.podspec --platforms=${{ matrix.target }} --use-static-frameworks
  61. spm:
  62. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  63. runs-on: macos-12
  64. strategy:
  65. matrix:
  66. target: [iOS, tvOS, macOS, catalyst, watchOS]
  67. steps:
  68. - uses: actions/checkout@v3
  69. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  70. with:
  71. cache_key: ${{ matrix.os }}
  72. - name: Initialize xcodebuild
  73. run: scripts/setup_spm_tests.sh
  74. - name: Unit Tests
  75. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseMLModelDownloaderUnit ${{ matrix.target }} spm
  76. catalyst:
  77. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  78. runs-on: macos-12
  79. steps:
  80. - uses: actions/checkout@v3
  81. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  82. with:
  83. cache_key: ${{ matrix.os }}
  84. - uses: ruby/setup-ruby@v1
  85. - name: Setup Bundler
  86. run: scripts/setup_bundler.sh
  87. - name: Setup project and Build Catalyst
  88. run: scripts/test_catalyst.sh FirebaseMLModelDownloader test FirebaseMLModelDownloader-Unit-unit
  89. mlmodeldownloader-sample-build-test:
  90. # Don't run on private repo unless it is a PR.
  91. if: github.repository == 'Firebase/firebase-ios-sdk' && (github.event_name == 'schedule' || github.event_name == 'pull_request')
  92. env:
  93. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  94. runs-on: macos-12
  95. steps:
  96. - uses: actions/checkout@v3
  97. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  98. with:
  99. cache_key: ${{ matrix.os }}
  100. - uses: ruby/setup-ruby@v1
  101. - name: Setup Bundler
  102. run: scripts/setup_bundler.sh
  103. - name: Install GoogleService-Info.plist
  104. run: |
  105. mkdir FirebaseMLModelDownloader/Apps/Sample/Resources
  106. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/MLModelDownloader/GoogleService-Info.plist.gpg \
  107. FirebaseMLModelDownloader/Apps/Sample/Resources/GoogleService-Info.plist "$plist_secret"
  108. - name: Prereqs
  109. run: scripts/install_prereqs.sh MLModelDownloaderSample iOS
  110. - name: Build
  111. run: ([ -z $plist_secret ] || scripts/build.sh MLModelDownloaderSample iOS)