shared-swift.yml 3.2 KB

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