dynamiclinks.yml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. name: dynamiclinks
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. paths:
  6. - 'FirebaseDynamicLinks**'
  7. - '.github/workflows/dynamiclinks.yml'
  8. - 'Interop/Analytics/Public/*.h'
  9. - 'Gemfile*'
  10. schedule:
  11. # Run every day at 1am (PST) - cron uses UTC times
  12. - cron: '0 9 * * *'
  13. concurrency:
  14. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  15. cancel-in-progress: true
  16. jobs:
  17. pod_lib_lint:
  18. # Don't run on private repo unless it is a PR.
  19. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  20. strategy:
  21. matrix:
  22. include:
  23. - os: macos-14
  24. xcode: Xcode_16.2
  25. - os: macos-15
  26. xcode: Xcode_16.2
  27. runs-on: ${{ matrix.os }}
  28. steps:
  29. - uses: actions/checkout@v4
  30. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  31. - name: Setup Bundler
  32. run: scripts/setup_bundler.sh
  33. - name: Xcode
  34. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  35. - name: FirebaseDynamicLinks
  36. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDynamicLinks.podspec --allow-warnings
  37. spm-package-resolved:
  38. env:
  39. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  40. runs-on: macos-14
  41. outputs:
  42. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  43. steps:
  44. - uses: actions/checkout@v4
  45. - name: Xcode
  46. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  47. - name: Generate Swift Package.resolved
  48. id: swift_package_resolve
  49. run: |
  50. swift package resolve
  51. - name: Generate cache key
  52. id: generate_cache_key
  53. run: |
  54. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  55. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  56. - uses: actions/cache/save@v4
  57. id: cache
  58. with:
  59. path: .build
  60. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  61. spm:
  62. # Don't run on private repo unless it is a PR.
  63. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  64. needs: [spm-package-resolved]
  65. strategy:
  66. matrix:
  67. include:
  68. - os: macos-14
  69. xcode: Xcode_16.2
  70. - os: macos-15
  71. xcode: Xcode_16.2
  72. runs-on: ${{ matrix.os }}
  73. steps:
  74. - uses: actions/checkout@v4
  75. - uses: actions/cache/restore@v4
  76. with:
  77. path: .build
  78. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  79. - name: Xcode
  80. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  81. - name: Initialize xcodebuild
  82. run: scripts/setup_spm_tests.sh
  83. - name: iOS Unit Tests
  84. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseDynamicLinks iOS spmbuildonly
  85. dynamiclinks-cron-only:
  86. # Don't run on private repo.
  87. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  88. runs-on: macos-15
  89. strategy:
  90. matrix:
  91. flags: [
  92. '--use-static-frameworks'
  93. ]
  94. needs: pod_lib_lint
  95. steps:
  96. - uses: actions/checkout@v4
  97. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  98. - name: Setup Bundler
  99. run: scripts/setup_bundler.sh
  100. - name: Xcode
  101. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  102. - name: PodLibLint Storage Cron
  103. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDynamicLinks.podspec --platforms=ios ${{ matrix.flags }} --allow-warnings
  104. quickstart:
  105. # Don't run on private repo unless it is a PR.
  106. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  107. env:
  108. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  109. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  110. runs-on: macos-15
  111. steps:
  112. - uses: actions/checkout@v4
  113. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  114. - name: Xcode
  115. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  116. - name: Setup quickstart
  117. run: scripts/setup_quickstart.sh DynamicLinks
  118. - name: Install Secret GoogleService-Info.plist
  119. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-dynamiclinks.plist.gpg \
  120. quickstart-ios/dynamiclinks/GoogleService-Info.plist "$plist_secret"
  121. - name: Update Environment Variable For DynamicLinks
  122. run: |
  123. sed -i '' 's#DYNAMIC_LINK_DOMAIN#https://qpf6m.app.goo.gl#' quickstart-ios/dynamiclinks/DynamicLinksExample/DynamicLinksExample.entitlements
  124. sed -i '' 's#YOUR_DOMAIN_URI_PREFIX";#https://qpf6m.app.goo.gl";#' quickstart-ios/dynamiclinks/DynamicLinksExample/ViewController.m
  125. sed -i '' 's#YOUR_DOMAIN_URI_PREFIX";#https://qpf6m.app.goo.gl";#' quickstart-ios/dynamiclinks/DynamicLinksExampleSwift/ViewController.swift
  126. - name: Test objc quickstart
  127. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh DynamicLinks false)
  128. - name: Test swift quickstart
  129. if: ${{ always() }}
  130. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh DynamicLinks false swift)
  131. quickstart-ftl-cron-only:
  132. # Don't run on private repo.
  133. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  134. env:
  135. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  136. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  137. runs-on: macos-15
  138. steps:
  139. - uses: actions/checkout@v4
  140. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  141. - uses: actions/setup-python@v5
  142. with:
  143. python-version: '3.11'
  144. - name: Xcode
  145. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  146. - name: Setup quickstart
  147. run: scripts/setup_quickstart.sh DynamicLinks
  148. - name: Install Secret GoogleService-Info.plist
  149. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-dynamiclinks.plist.gpg \
  150. quickstart-ios/dynamiclinks/GoogleService-Info.plist "$plist_secret"
  151. - name: Update Environment Variable For DynamicLinks
  152. run: |
  153. sed -i '' 's#DYNAMIC_LINK_DOMAIN#https://qpf6m.app.goo.gl#' quickstart-ios/dynamiclinks/DynamicLinksExample/DynamicLinksExample.entitlements
  154. sed -i '' 's#YOUR_DOMAIN_URI_PREFIX";#https://qpf6m.app.goo.gl";#' quickstart-ios/dynamiclinks/DynamicLinksExample/ViewController.m
  155. sed -i '' 's#YOUR_DOMAIN_URI_PREFIX";#https://qpf6m.app.goo.gl";#' quickstart-ios/dynamiclinks/DynamicLinksExampleSwift/ViewController.swift
  156. # - name: Build objc quickstart
  157. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh DynamicLinks)
  158. - name: Build swift quickstart
  159. if: ${{ always() }}
  160. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh DynamicLinks swift)
  161. - id: ftl_test
  162. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  163. with:
  164. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  165. testapp_dir: quickstart-ios/build-for-testing
  166. test_type: "xctest"