unit_tests.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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-11, macos-12]
  15. podspec: [GoogleSignIn.podspec, GoogleSignInSwiftSupport.podspec]
  16. flag: [
  17. "",
  18. "--use-libraries",
  19. "--use-static-frameworks"
  20. ]
  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. 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-11, macos-12]
  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 11"'
  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