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