shared-swift.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. build-env:
  22. - os: macos-14
  23. xcode: Xcode_15.2
  24. - os: macos-15
  25. xcode: Xcode_16.1
  26. runs-on: ${{ matrix.build-env.os }}
  27. steps:
  28. - uses: actions/checkout@v4
  29. - uses: ruby/setup-ruby@v1
  30. - name: Setup Bundler
  31. run: scripts/setup_bundler.sh
  32. - name: Xcode
  33. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  34. - name: Build and test
  35. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSharedSwift.podspec --platforms=${{ matrix.target }}
  36. spm-package-resolved:
  37. env:
  38. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  39. runs-on: macos-14
  40. outputs:
  41. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  42. steps:
  43. - uses: actions/checkout@v4
  44. - name: Generate Swift Package.resolved
  45. id: swift_package_resolve
  46. run: |
  47. swift package resolve
  48. - name: Generate cache key
  49. id: generate_cache_key
  50. run: |
  51. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  52. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  53. - uses: actions/cache/save@v4
  54. id: cache
  55. with:
  56. path: .build
  57. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  58. spm:
  59. # Don't run on private repo unless it is a PR.
  60. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  61. needs: [spm-package-resolved]
  62. strategy:
  63. matrix:
  64. target: [iOS, tvOS, macOS, catalyst, watchOS]
  65. build-env:
  66. - os: macos-14
  67. xcode: Xcode_15.2
  68. - os: macos-15
  69. xcode: Xcode_16.1
  70. runs-on: ${{ matrix.build-env.os }}
  71. steps:
  72. - uses: actions/checkout@v4
  73. - uses: actions/cache/restore@v4
  74. with:
  75. path: .build
  76. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  77. - name: Xcode
  78. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  79. - name: Initialize xcodebuild
  80. run: scripts/setup_spm_tests.sh
  81. - name: Unit Tests
  82. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseSharedSwiftTests ${{ matrix.target }} spm