sessions.yml 4.4 KB

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