appdistribution.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. name: appdistribution
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. paths:
  6. - 'FirebaseAppDistribution**'
  7. - '.github/workflows/appdistribution.yml'
  8. - 'Gemfile*'
  9. schedule:
  10. # Run every day at 1am (PST) - cron uses UTC times
  11. - cron: '0 9 * * *'
  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. include:
  22. - os: macos-14
  23. xcode: Xcode_16.2
  24. - os: macos-15
  25. xcode: Xcode_16.3
  26. runs-on: ${{ matrix.os }}
  27. steps:
  28. - uses: actions/checkout@v4
  29. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  30. - name: Setup Bundler
  31. run: scripts/setup_bundler.sh
  32. - name: Xcode
  33. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  34. - name: Build and test
  35. run: |
  36. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAppDistribution.podspec \
  37. --platforms=ios
  38. spm-package-resolved:
  39. env:
  40. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  41. runs-on: macos-14
  42. outputs:
  43. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  44. steps:
  45. - uses: actions/checkout@v4
  46. - name: Generate Swift Package.resolved
  47. id: swift_package_resolve
  48. run: |
  49. swift package resolve
  50. - name: Generate cache key
  51. id: generate_cache_key
  52. run: |
  53. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  54. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  55. - uses: actions/cache/save@v4
  56. id: cache
  57. with:
  58. path: .build
  59. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  60. spm:
  61. # Don't run on private repo unless it is a PR.
  62. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  63. needs: [spm-package-resolved]
  64. strategy:
  65. matrix:
  66. include:
  67. - os: macos-14
  68. xcode: Xcode_16.2
  69. - os: macos-15
  70. xcode: Xcode_16.3
  71. runs-on: ${{ matrix.os }}
  72. steps:
  73. - uses: actions/checkout@v4
  74. - uses: actions/cache/restore@v4
  75. with:
  76. path: .build
  77. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  78. - name: Xcode
  79. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  80. - name: Initialize xcodebuild
  81. run: scripts/setup_spm_tests.sh
  82. - name: iOS Unit Tests
  83. run: scripts/third_party/travis/retry.sh ./scripts/build.sh AppDistributionUnit iOS spm
  84. catalyst:
  85. # Don't run on private repo unless it is a PR.
  86. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  87. runs-on: macos-15
  88. steps:
  89. - uses: actions/checkout@v4
  90. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  91. with:
  92. cache_key: catalyst${{ matrix.os }}
  93. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  94. - name: Setup Bundler
  95. run: scripts/setup_bundler.sh
  96. - name: Xcode
  97. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  98. - name: Setup project and Build for Catalyst
  99. run: scripts/test_catalyst.sh FirebaseAppDistribution test FirebaseAppDistribution-Unit-unit
  100. appdistribution-cron-only:
  101. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  102. runs-on: macos-15
  103. strategy:
  104. matrix:
  105. target: [ios]
  106. flags: [
  107. '--use-static-frameworks'
  108. ]
  109. needs: pod-lib-lint
  110. steps:
  111. - uses: actions/checkout@v4
  112. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  113. - name: Setup Bundler
  114. run: scripts/setup_bundler.sh
  115. - name: PodLibLint App Distribution Cron
  116. run: |
  117. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAppDistribution.podspec \
  118. --platforms=${{ matrix.target }} ${{ matrix.flags }}