unit_tests.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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-12]
  15. podspec: [GoogleSignIn.podspec, GoogleSignInSwiftSupport.podspec]
  16. flag: [
  17. "",
  18. "--use-static-frameworks"
  19. ]
  20. # See #400 (https://github.com/google/GoogleSignIn-iOS/issues/400)
  21. # include:
  22. # - podspec: GoogleSignInSwiftSupport.podspec
  23. # includePodspecFlag: "--include-podspecs='GoogleSignIn.podspec'"
  24. steps:
  25. - uses: actions/checkout@v3
  26. - name: Update Bundler
  27. run: bundle update --bundler
  28. - name: Install Ruby gems with Bundler
  29. run: bundle install
  30. - name: Lint podspec using local source
  31. # See #400 (https://github.com/google/GoogleSignIn-iOS/issues/400)
  32. run: |
  33. pod lib lint ${{ matrix.podspec }} --verbose \
  34. --sources=https://cdn.cocoapods.org/ \
  35. ${{ matrix.flag }}
  36. spm-build-test:
  37. runs-on: ${{ matrix.os }}
  38. strategy:
  39. fail-fast: false
  40. matrix:
  41. os: [macos-12]
  42. sdk: ['macosx', 'iphonesimulator']
  43. include:
  44. - sdk: 'macosx'
  45. destination: '"platform=OS X,arch=x86_64"'
  46. - sdk: 'iphonesimulator'
  47. destination: '"platform=iOS Simulator,name=iPhone 11"'
  48. steps:
  49. - uses: actions/checkout@v3
  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