integration_tests.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. name: integration_tests
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. workflow_dispatch:
  8. jobs:
  9. grab-pr-body:
  10. runs-on: ubuntu-latest
  11. outputs:
  12. PR_BODY: ${{ steps.body.outputs.PR_BODY }}
  13. steps:
  14. - id: body
  15. env:
  16. PR_BODY: ${{ github.event.pull_request.body }}
  17. run: |
  18. {
  19. echo "PR_BODY<<EOF"
  20. echo "$PR_BODY"
  21. echo "EOF"
  22. } >> "$GITHUB_OUTPUT"
  23. check-pr-body-for-key:
  24. runs-on: ubuntu-latest
  25. needs: grab-pr-body
  26. outputs:
  27. RUN_INTEGRATION: ${{ steps.check_key.outputs.RUN_INTEGRATION }}
  28. steps:
  29. - id: check_key
  30. env:
  31. PR_BODY: ${{ needs.grab-pr-body.outputs.PR_BODY }}
  32. SKIP_KEY: "SKIP_INTEGRATION_TESTS=YES"
  33. name: Check for key and set bool to skip integration tests
  34. run: |
  35. if [[ "$PR_BODY" == *"$SKIP_KEY"* ]]; then
  36. echo "Skipping integration tests for PR body:"
  37. echo "$PR_BODY"
  38. echo "RUN_INTEGRATION=no" >> "$GITHUB_OUTPUT"
  39. else
  40. echo "Running integration tests for PR body:"
  41. echo "$PR_BODY"
  42. echo "RUN_INTEGRATION=yes" >> "$GITHUB_OUTPUT"
  43. fi
  44. swift-button-functional-test:
  45. runs-on: macos-15
  46. needs: check-pr-body-for-key
  47. # Don't run if triggered by a PR from a fork since our Secrets won't be provided to the runner.
  48. if: ${{ needs.check-pr-body-for-key.outputs.RUN_INTEGRATION == 'yes' && !github.event.pull_request.head.repo.fork }}
  49. defaults:
  50. run:
  51. working-directory: Samples/Swift/DaysUntilBirthday
  52. steps:
  53. - name: Checkout
  54. uses: actions/checkout@v3
  55. - name: Select Xcode
  56. run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
  57. - name: Build test target for Google Sign-in button for Swift
  58. run: |
  59. xcodebuild \
  60. -project DaysUntilBirthday.xcodeproj \
  61. build-for-testing \
  62. -scheme DaysUntilBirthday\ \(iOS\) \
  63. -sdk iphonesimulator \
  64. - name: Run test target for Google Sign-in button for Swift
  65. env:
  66. EMAIL_SECRET : ${{ secrets.EMAIL_SECRET }}
  67. PASSWORD_SECRET : ${{ secrets.PASSWORD_SECRET }}
  68. run: |
  69. xcodebuild \
  70. -project DaysUntilBirthday.xcodeproj \
  71. test-without-building \
  72. -scheme DaysUntilBirthday\ \(iOS\) \
  73. -sdk iphonesimulator \
  74. -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.6' \
  75. EMAIL_SECRET=$EMAIL_SECRET \
  76. PASSWORD_SECRET=$PASSWORD_SECRET
  77. app-check-api-token-tests:
  78. runs-on: macos-15
  79. # Don't run if triggered by a PR from a fork since our Secrets won't be provided to the runner.
  80. if: "!github.event.pull_request.head.repo.fork"
  81. defaults:
  82. run:
  83. working-directory: Samples/Swift/AppAttestExample
  84. steps:
  85. - name: Checkout
  86. uses: actions/checkout@v3
  87. - name: Select Xcode
  88. run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
  89. - name: Build test target for App Check Example
  90. run: |
  91. xcodebuild \
  92. -project AppAttestExample.xcodeproj \
  93. build-for-testing \
  94. -scheme AppAttestExample \
  95. -sdk iphonesimulator \
  96. - name: Run test target for App Check Example
  97. env:
  98. AppCheckDebugToken : ${{ secrets.APP_CHECK_DEBUG_TOKEN }}
  99. APP_CHECK_WEB_API_KEY : ${{ secrets.APP_CHECK_WEB_API_KEY }}
  100. run: |
  101. xcodebuild \
  102. -project AppAttestExample.xcodeproj \
  103. test-without-building \
  104. -scheme AppAttestExample \
  105. -sdk iphonesimulator \
  106. -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.6' \
  107. AppCheckDebugToken=$AppCheckDebugToken \
  108. APP_CHECK_WEB_API_KEY=$APP_CHECK_WEB_API_KEY