installations.yml 6.0 KB

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