unit_tests.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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-latest]
  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 15"'
  46. steps:
  47. - uses: actions/checkout@v3
  48. - name: Build unit test target
  49. run: |
  50. xcodebuild \
  51. -scheme GoogleSignIn-Package \
  52. -sdk ${{ matrix.sdk }} \
  53. -destination ${{ matrix.destination }} \
  54. build-for-testing
  55. - name: Run unit test target
  56. run: |
  57. xcodebuild \
  58. -scheme GoogleSignIn-Package \
  59. -sdk ${{ matrix.sdk }} \
  60. -destination ${{ matrix.destination }} \
  61. test-without-building