sessions.yml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. name: sessions
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. paths:
  6. - 'FirebaseSessions**'
  7. - 'FirebaseSessions.podspec'
  8. - '.github/workflows/sessions.yml'
  9. - 'Gemfile*'
  10. schedule:
  11. # Run every day at 9am (PST) - cron uses UTC times
  12. - cron: '0 1 * * *'
  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. target: [ios, tvos, macos, watchos]
  23. build-env:
  24. - os: macos-14
  25. xcode: Xcode_16.2
  26. tests:
  27. # Flaky tests on CI
  28. - os: macos-15
  29. xcode: Xcode_16.2
  30. tests: --skip-tests
  31. runs-on: ${{ matrix.build-env.os }}
  32. steps:
  33. - uses: actions/checkout@v4
  34. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  35. - name: Setup Bundler
  36. run: scripts/setup_bundler.sh
  37. - name: Xcode
  38. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  39. - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
  40. with:
  41. timeout_minutes: 120
  42. max_attempts: 3
  43. retry_on: error
  44. retry_wait_seconds: 120
  45. command: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSessions.podspec --platforms=${{ matrix.target }} ${{ matrix.build-env.tests }}
  46. spm-package-resolved:
  47. env:
  48. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  49. runs-on: macos-15
  50. outputs:
  51. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  52. steps:
  53. - uses: actions/checkout@v4
  54. - name: Xcode
  55. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  56. - name: Generate Swift Package.resolved
  57. id: swift_package_resolve
  58. run: |
  59. swift package resolve
  60. - name: Generate cache key
  61. id: generate_cache_key
  62. run: |
  63. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  64. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  65. - uses: actions/cache/save@v4
  66. id: cache
  67. with:
  68. path: .build
  69. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  70. spm:
  71. # Don't run on private repo unless it is a PR.
  72. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  73. needs: [spm-package-resolved]
  74. strategy:
  75. matrix:
  76. include:
  77. - os: macos-14
  78. xcode: Xcode_16.2
  79. target: iOS
  80. - os: macos-15
  81. xcode: Xcode_16.2
  82. target: iOS
  83. - os: macos-15
  84. xcode: Xcode_16.2
  85. target: tvOS
  86. - os: macos-15
  87. xcode: Xcode_16.2
  88. target: macOS
  89. - os: macos-15
  90. xcode: Xcode_16.2
  91. target: watchOS
  92. - os: macos-15
  93. xcode: Xcode_16.2
  94. target: catalyst
  95. - os: macos-15
  96. xcode: Xcode_16.2
  97. target: visionOS
  98. runs-on: ${{ matrix.os }}
  99. steps:
  100. - uses: actions/checkout@v4
  101. - uses: actions/cache/restore@v4
  102. with:
  103. path: .build
  104. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  105. - name: Xcode
  106. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  107. - name: Install visionOS, if needed.
  108. if: matrix.target == 'visionOS'
  109. run: xcodebuild -downloadPlatform visionOS
  110. - name: Initialize xcodebuild
  111. run: scripts/setup_spm_tests.sh
  112. - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
  113. with:
  114. timeout_minutes: 120
  115. max_attempts: 3
  116. retry_on: error
  117. retry_wait_seconds: 120
  118. command: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseSessionsUnit ${{ matrix.target }} spm
  119. catalyst:
  120. # Don't run on private repo unless it is a PR.
  121. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  122. runs-on: macos-15
  123. steps:
  124. - uses: actions/checkout@v4
  125. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  126. with:
  127. cache_key: catalyst${{ matrix.os }}
  128. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  129. - name: Setup Bundler
  130. run: scripts/setup_bundler.sh
  131. - name: Xcode
  132. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  133. - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
  134. with:
  135. timeout_minutes: 120
  136. max_attempts: 3
  137. retry_on: error
  138. retry_wait_seconds: 120
  139. command: scripts/test_catalyst.sh FirebaseSessions test FirebaseSessions-Unit-unit