sessions.yml 4.4 KB

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