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. workflow_dispatch:
  10. jobs:
  11. pod-lib-lint:
  12. runs-on: ${{ matrix.os }}
  13. strategy:
  14. fail-fast: false
  15. matrix:
  16. os: [macos-latest, macos-10.15]
  17. podspec: [GoogleSignIn.podspec, GoogleSignInSwiftSupport.podspec]
  18. flag: [
  19. "",
  20. "--use-libraries",
  21. "--use-static-frameworks"
  22. ]
  23. include:
  24. - podspec: GoogleSignInSwiftSupport.podspec
  25. includePodspecFlag: "--include-podspecs='GoogleSignIn.podspec'"
  26. steps:
  27. - uses: actions/checkout@v2
  28. - name: Update Bundler
  29. run: bundle update --bundler
  30. - name: Install Ruby gems with Bundler
  31. run: bundle install
  32. - name: Lint podspec using local source
  33. run: |
  34. pod lib lint ${{ matrix.podspec }} --verbose \
  35. ${{ matrix.includePodspecFlag }} ${{ matrix.flag }}
  36. spm-build-test:
  37. runs-on: ${{ matrix.os }}
  38. strategy:
  39. fail-fast: false
  40. matrix:
  41. os: [macos-latest, macos-10.15]
  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@v2
  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
  64. swift-button-functional-test:
  65. runs-on: macOS-latest
  66. defaults:
  67. run:
  68. working-directory: Samples/Swift/DaysUntilBirthday
  69. steps:
  70. - name: Checkout
  71. uses: actions/checkout@v2
  72. - name: Create xcconfig file
  73. shell: bash
  74. env:
  75. EMAIL_SECRET : ${{ secrets.EMAIL_SECRET }}
  76. PASSWORD_SECRET : ${{ secrets.PASSWORD_SECRET }}
  77. run: |
  78. echo EMAIL_SECRET = $EMAIL_SECRET$'\n'PASSWORD_SECRET = $PASSWORD_SECRET >> DaysUntilBirthdayUITests\(iOS\)/Credentials.xcconfig
  79. - name: Build test target for Google Sign-in button for Swift
  80. run: |
  81. xcodebuild \
  82. -project DaysUntilBirthday.xcodeproj \
  83. build-for-testing \
  84. -scheme DaysUntilBirthday\(iOS\) \
  85. -sdk iphonesimulator \
  86. -destination 'platform=iOS Simulator,name=iPhone 11'
  87. - name: Run test target for Google Sign-in button for Swift
  88. run: |
  89. xcodebuild \
  90. -project DaysUntilBirthday.xcodeproj \
  91. test-without-building \
  92. -scheme DaysUntilBirthday\(iOS\) \
  93. -sdk iphonesimulator \
  94. -destination 'platform=iOS Simulator,name=iPhone 11'