appdistribution.yml 3.9 KB

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