unit_tests.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. name: unit_tests
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. workflow_dispatch:
  8. jobs:
  9. pod-lib-lint:
  10. runs-on: ${{ matrix.os }}
  11. strategy:
  12. fail-fast: false
  13. matrix:
  14. os: [macos-13]
  15. podspec: [GoogleSignIn.podspec, GoogleSignInSwiftSupport.podspec]
  16. flag: [
  17. "",
  18. "--use-static-frameworks"
  19. ]
  20. include:
  21. - podspec: GoogleSignInSwiftSupport.podspec
  22. includePodspecFlag: "--include-podspecs='GoogleSignIn.podspec'"
  23. steps:
  24. - uses: actions/checkout@v3
  25. - name: Update Bundler
  26. run: bundle update --bundler
  27. - name: Install Ruby gems with Bundler
  28. run: bundle install
  29. - name: Lint podspec using local source
  30. # See #400 (https://github.com/google/GoogleSignIn-iOS/issues/400)
  31. run: |
  32. pod lib lint ${{ matrix.podspec }} --verbose \
  33. ${{ matrix.includePodspecFlag }} ${{ matrix.flag }}
  34. spm-build-test:
  35. runs-on: ${{ matrix.os }}
  36. strategy:
  37. fail-fast: false
  38. matrix:
  39. os: [macos-15]
  40. sdk: ['macosx', 'iphonesimulator']
  41. include:
  42. - sdk: 'macosx'
  43. destination: '"platform=OS X,arch=x86_64"'
  44. - sdk: 'iphonesimulator'
  45. destination: '"platform=iOS Simulator,name=iPhone 16,OS=18.6"'
  46. steps:
  47. - uses: actions/checkout@v3
  48. - name: Select Xcode
  49. run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
  50. - name: Build unit test target
  51. run: |
  52. xcodebuild \
  53. -scheme GoogleSignIn-Package \
  54. -sdk ${{ matrix.sdk }} \
  55. -destination ${{ matrix.destination }} \
  56. build-for-testing
  57. - name: Run unit test target
  58. run: |
  59. xcodebuild \
  60. -scheme GoogleSignIn-Package \
  61. -sdk ${{ matrix.sdk }} \
  62. -destination ${{ matrix.destination }} \
  63. test-without-building