sessions.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. target: [iOS, tvOS, macOS, catalyst, watchOS]
  75. os: [macos-14]
  76. xcode: [Xcode_15.2, Xcode_16]
  77. runs-on: ${{ matrix.os }}
  78. steps:
  79. - uses: actions/checkout@v4
  80. - uses: actions/cache/restore@v4
  81. with:
  82. path: .build
  83. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  84. - name: Xcode
  85. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  86. - name: Initialize xcodebuild
  87. run: scripts/setup_spm_tests.sh
  88. - uses: nick-fields/retry@v3
  89. with:
  90. timeout_minutes: 120
  91. max_attempts: 3
  92. retry_on: error
  93. retry_wait_seconds: 120
  94. command: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseSessionsUnit ${{ matrix.target }} spm
  95. catalyst:
  96. # Don't run on private repo unless it is a PR.
  97. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  98. runs-on: macos-14
  99. steps:
  100. - uses: actions/checkout@v4
  101. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  102. with:
  103. cache_key: catalyst${{ matrix.os }}
  104. - uses: ruby/setup-ruby@v1
  105. - name: Setup Bundler
  106. run: scripts/setup_bundler.sh
  107. - uses: nick-fields/retry@v3
  108. with:
  109. timeout_minutes: 120
  110. max_attempts: 3
  111. retry_on: error
  112. retry_wait_seconds: 120
  113. command: scripts/test_catalyst.sh FirebaseSessions test FirebaseSessions-Unit-unit