shared-swift.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. name: shared-swift
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseSharedSwift**'
  6. - '.github/workflows/shared-swift.yml'
  7. - 'Gemfile*'
  8. schedule:
  9. # Run every day at 3am (PST) - cron uses UTC times
  10. - cron: '0 11 * * *'
  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, tvos, macos, watchos]
  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: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSharedSwift.podspec --platforms=${{ matrix.target }}
  33. spm-package-resolved:
  34. env:
  35. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  36. runs-on: macos-14
  37. outputs:
  38. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  39. steps:
  40. - uses: actions/checkout@v4
  41. - name: Generate Swift Package.resolved
  42. id: swift_package_resolve
  43. run: |
  44. swift package resolve
  45. - name: Generate cache key
  46. id: generate_cache_key
  47. run: |
  48. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  49. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  50. - uses: actions/cache/save@v4
  51. id: cache
  52. with:
  53. path: .build
  54. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  55. spm:
  56. # Don't run on private repo unless it is a PR.
  57. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  58. needs: [spm-package-resolved]
  59. strategy:
  60. matrix:
  61. target: [iOS, tvOS, macOS, catalyst, watchOS]
  62. os: [macos-14]
  63. xcode: [Xcode_15.2, Xcode_16]
  64. runs-on: ${{ matrix.os }}
  65. steps:
  66. - uses: actions/checkout@v4
  67. - uses: actions/cache/restore@v4
  68. with:
  69. path: .build
  70. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  71. - name: Xcode
  72. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  73. - name: Initialize xcodebuild
  74. run: scripts/setup_spm_tests.sh
  75. - name: Unit Tests
  76. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseSharedSwiftTests ${{ matrix.target }} spm