installations.yml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. name: installations
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseInstallations**'
  6. - '.github/workflows/installations.yml'
  7. - 'Gemfile*'
  8. schedule:
  9. # Run every day at 10pm (PST) - cron uses UTC times
  10. - cron: '0 6 * * *'
  11. concurrency:
  12. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  13. cancel-in-progress: true
  14. jobs:
  15. pod-lib-lint:
  16. # Don't run on private repo unless it is a PR.
  17. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  18. runs-on: macos-12
  19. env:
  20. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  21. # This env var is set because the job has a dependency on the unpublished HeatbeatLoggingTestUtils.
  22. POD_LIB_LINT_ONLY: 1
  23. strategy:
  24. matrix:
  25. target: [ios, tvos, macos]
  26. steps:
  27. - uses: actions/checkout@v3
  28. - uses: ruby/setup-ruby@v1
  29. - name: Setup Bundler
  30. run: scripts/setup_bundler.sh
  31. - name: Configure test keychain
  32. run: scripts/configure_test_keychain.sh
  33. - name: Install GoogleService-Info.plist
  34. run: |
  35. mkdir -p FirebaseInstallations/Source/Tests/Resources
  36. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Installations/GoogleService-Info.plist.gpg \
  37. FirebaseInstallations/Source/Tests/Resources/GoogleService-Info.plist "$plist_secret"
  38. - name: Get boolean for secrets available
  39. id: secrets
  40. run: echo "::set-output name=val::$([[ -z $plist_secret ]] && echo "0" || echo "1")"
  41. - name: Build and test
  42. run: |
  43. export FIS_INTEGRATION_TESTS_REQUIRED=${{ steps.secrets.outputs.val }}
  44. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseInstallations.podspec \
  45. --platforms=${{ matrix.target }}
  46. spm:
  47. # Don't run on private repo unless it is a PR.
  48. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  49. runs-on: macos-12
  50. strategy:
  51. matrix:
  52. target: [iOS, tvOS, macOS, catalyst, watchOS]
  53. steps:
  54. - uses: actions/checkout@v3
  55. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  56. with:
  57. cache_key: ${{ matrix.os }}
  58. - name: Initialize xcodebuild
  59. run: scripts/setup_spm_tests.sh
  60. - name: Unit Tests
  61. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseInstallations ${{ matrix.target }} spmbuildonly
  62. catalyst:
  63. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  64. runs-on: macos-12
  65. env:
  66. # This env var is set because the job has a dependency on the unpublished HeatbeatLoggingTestUtils.
  67. POD_LIB_LINT_ONLY: 1
  68. steps:
  69. - uses: actions/checkout@v3
  70. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  71. with:
  72. cache_key: ${{ matrix.os }}
  73. - uses: ruby/setup-ruby@v1
  74. - name: Setup Bundler
  75. run: scripts/setup_bundler.sh
  76. - name: Setup project and Build for Catalyst
  77. run: scripts/test_catalyst.sh FirebaseInstallations test FirebaseInstallations-Unit-unit
  78. quickstart:
  79. # Don't run on private repo unless it is a PR.
  80. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  81. runs-on: macos-12
  82. steps:
  83. - uses: actions/checkout@v3
  84. - uses: ruby/setup-ruby@v1
  85. - name: Setup quickstart
  86. run: scripts/setup_quickstart.sh installations
  87. - name: Copy mock plist
  88. run: cp quickstart-ios/mock-GoogleService-Info.plist quickstart-ios/installations/GoogleService-Info.plist
  89. - name: Test objc quickstart
  90. run: scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Installations true
  91. - name: Test swift quickstart
  92. run: scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Installations true swift
  93. quickstart-ftl-cron-only:
  94. # Don't run on private repo.
  95. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  96. runs-on: macos-12
  97. steps:
  98. - uses: actions/checkout@v3
  99. - uses: ruby/setup-ruby@v1
  100. - name: Setup quickstart
  101. run: scripts/setup_quickstart.sh installations
  102. - name: Copy mock plist
  103. run: cp quickstart-ios/mock-GoogleService-Info.plist quickstart-ios/installations/GoogleService-Info.plist
  104. - name: Build objc quickstart
  105. run: scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Installations
  106. - name: Build swift quickstart
  107. run: scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Installations swift
  108. - id: ftl_test
  109. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.2
  110. with:
  111. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  112. testapp_dir: quickstart-ios/build-for-testing
  113. test_type: "xctest"
  114. installations-cron-only:
  115. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  116. runs-on: macos-12
  117. env:
  118. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  119. FIR_IID_INTEGRATION_TESTS_REQUIRED: ${{ secrets.GHASecretsGPGPassphrase1 }}
  120. # This env var is set because the job has a dependency on the unpublished HeatbeatLoggingTestUtils.
  121. POD_LIB_LINT_ONLY: 1
  122. strategy:
  123. matrix:
  124. target: [ios, tvos, macos]
  125. flags: [
  126. '--use-static-frameworks'
  127. ]
  128. needs: pod-lib-lint
  129. steps:
  130. - uses: actions/checkout@v3
  131. - uses: ruby/setup-ruby@v1
  132. - name: Setup Bundler
  133. run: scripts/setup_bundler.sh
  134. - name: Configure test keychain
  135. run: scripts/configure_test_keychain.sh
  136. - name: Install GoogleService-Info.plist
  137. run: |
  138. mkdir -p FirebaseInstallations/Source/Tests/Resources
  139. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Installations/GoogleService-Info.plist.gpg \
  140. FirebaseInstallations/Source/Tests/Resources/GoogleService-Info.plist "$plist_secret"
  141. - name: Get boolean for secrets available
  142. id: secrets
  143. run: echo "::set-output name=val::$([[ -z $plist_secret ]] && echo "0" || echo "1")"
  144. - name: PodLibLint Installations Cron
  145. run: |
  146. export FIS_INTEGRATION_TESTS_REQUIRED=${{ steps.secrets.outputs.val }}
  147. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseInstallations.podspec \
  148. --platforms=${{ matrix.target }} ${{ matrix.flags }} \