tests.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. name: tests
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. branches:
  8. - main
  9. - GIDGoogleUser-restructure
  10. workflow_dispatch:
  11. jobs:
  12. pod-lib-lint:
  13. runs-on: ${{ matrix.os }}
  14. strategy:
  15. fail-fast: false
  16. matrix:
  17. os: [macos-11, macos-12]
  18. podspec: [GoogleSignIn.podspec, GoogleSignInSwiftSupport.podspec]
  19. flag: [
  20. "",
  21. "--use-libraries",
  22. "--use-static-frameworks"
  23. ]
  24. include:
  25. - podspec: GoogleSignInSwiftSupport.podspec
  26. includePodspecFlag: "--include-podspecs='GoogleSignIn.podspec'"
  27. steps:
  28. - uses: actions/checkout@v2
  29. - name: Update Bundler
  30. run: bundle update --bundler
  31. - name: Install Ruby gems with Bundler
  32. run: bundle install
  33. - name: Lint podspec using local source
  34. run: |
  35. pod lib lint ${{ matrix.podspec }} --verbose \
  36. ${{ matrix.includePodspecFlag }} ${{ matrix.flag }}
  37. spm-build-test:
  38. runs-on: ${{ matrix.os }}
  39. strategy:
  40. fail-fast: false
  41. matrix:
  42. os: [macos-11, macos-12]
  43. sdk: ['macosx', 'iphonesimulator']
  44. include:
  45. - sdk: 'macosx'
  46. destination: '"platform=OS X,arch=x86_64"'
  47. - sdk: 'iphonesimulator'
  48. destination: '"platform=iOS Simulator,name=iPhone 11"'
  49. steps:
  50. - uses: actions/checkout@v2
  51. - name: Build unit test target
  52. run: |
  53. xcodebuild \
  54. -scheme GoogleSignIn-Package \
  55. -sdk ${{ matrix.sdk }} \
  56. -destination ${{ matrix.destination }} \
  57. build-for-testing
  58. - name: Run unit test target
  59. run: |
  60. xcodebuild \
  61. -scheme GoogleSignIn-Package \
  62. -sdk ${{ matrix.sdk }} \
  63. -destination ${{ matrix.destination }} \
  64. test-without-building
  65. swift-button-functional-test:
  66. if: ${{ false }} # Disable integration tests while we figure out OTAs
  67. runs-on: macOS-latest
  68. defaults:
  69. run:
  70. working-directory: Samples/Swift/DaysUntilBirthday
  71. steps:
  72. - name: Checkout
  73. uses: actions/checkout@v2
  74. - name: Build test target for Google Sign-in button for Swift
  75. run: |
  76. xcodebuild \
  77. -project DaysUntilBirthday.xcodeproj \
  78. build-for-testing \
  79. -scheme DaysUntilBirthday\ \(iOS\) \
  80. -sdk iphonesimulator \
  81. -destination 'platform=iOS Simulator,name=iPhone 11'
  82. - name: Run test target for Google Sign-in button for Swift
  83. env:
  84. EMAIL_SECRET : ${{ secrets.EMAIL_SECRET }}
  85. PASSWORD_SECRET : ${{ secrets.PASSWORD_SECRET }}
  86. run: |
  87. xcodebuild \
  88. -project DaysUntilBirthday.xcodeproj \
  89. test-without-building \
  90. -scheme DaysUntilBirthday\ \(iOS\) \
  91. -sdk iphonesimulator \
  92. -destination 'platform=iOS Simulator,name=iPhone 11' \
  93. EMAIL_SECRET=$EMAIL_SECRET \
  94. PASSWORD_SECRET=$PASSWORD_SECRET