|
| 1 | +name: BCIT Embedded Messages Integration Test |
| 2 | +permissions: |
| 3 | + contents: read |
| 4 | + |
| 5 | +on: |
| 6 | + pull_request: |
| 7 | + types: [opened, synchronize, reopened, labeled] |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + ref: |
| 11 | + description: 'Branch or commit to test (leave empty for current branch)' |
| 12 | + required: false |
| 13 | + type: string |
| 14 | + |
| 15 | +jobs: |
| 16 | + embedded-messages-test: |
| 17 | + name: BCIT Embedded Messages Integration Test |
| 18 | + runs-on: macos-latest |
| 19 | + timeout-minutes: 30 |
| 20 | + env: |
| 21 | + XCODE_VERSION: '16.4' |
| 22 | + if: > |
| 23 | + github.event_name == 'workflow_dispatch' || |
| 24 | + ( |
| 25 | + github.event_name == 'pull_request' && ( |
| 26 | + contains(github.event.pull_request.labels.*.name, 'bcit') || |
| 27 | + contains(github.event.pull_request.labels.*.name, 'BCIT') || |
| 28 | + contains(github.event.pull_request.labels.*.name, 'bcit-embedded') || |
| 29 | + contains(github.event.pull_request.labels.*.name, 'BCIT-EMBEDDED') || |
| 30 | + contains(github.event.pull_request.labels.*.name, 'bcit-embedded-messages') || |
| 31 | + contains(github.event.pull_request.labels.*.name, 'BCIT-EMBEDDED-MESSAGES') || |
| 32 | + contains(github.event.pull_request.labels.*.name, 'Bcit') || |
| 33 | + contains(github.event.pull_request.labels.*.name, 'Bcit-Embedded') || |
| 34 | + startsWith(github.event.pull_request.head.ref, 'release/') |
| 35 | + ) |
| 36 | + ) |
| 37 | +
|
| 38 | + steps: |
| 39 | + - name: Checkout Repository |
| 40 | + uses: actions/checkout@v4 |
| 41 | + with: |
| 42 | + ref: ${{ github.event.inputs.ref || github.ref }} |
| 43 | + |
| 44 | + - name: Setup Xcode |
| 45 | + uses: maxim-lobanov/setup-xcode@v1 |
| 46 | + with: |
| 47 | + xcode-version: ${{ env.XCODE_VERSION }} |
| 48 | + |
| 49 | + - name: Validate Xcode Version |
| 50 | + run: | |
| 51 | + echo "🔍 Validating Xcode version and environment..." |
| 52 | + echo "DEVELOPER_DIR: $DEVELOPER_DIR" |
| 53 | + |
| 54 | + # Check xcodebuild version |
| 55 | + echo "🔍 Checking xcodebuild version..." |
| 56 | + ACTUAL_XCODE_VERSION=$(xcodebuild -version | head -n 1 | awk '{print $2}') |
| 57 | + echo "Xcode version: $ACTUAL_XCODE_VERSION" |
| 58 | + echo "Expected version: $XCODE_VERSION" |
| 59 | + |
| 60 | + # Check xcodebuild path |
| 61 | + XCODEBUILD_PATH=$(which xcodebuild) |
| 62 | + echo "xcodebuild path: $XCODEBUILD_PATH" |
| 63 | + |
| 64 | + # Verify we're using the correct Xcode version |
| 65 | + if echo "$ACTUAL_XCODE_VERSION" | grep -q "$XCODE_VERSION"; then |
| 66 | + echo "✅ Using correct Xcode version: $ACTUAL_XCODE_VERSION" |
| 67 | + else |
| 68 | + echo "❌ Incorrect Xcode version!" |
| 69 | + echo "Current: $ACTUAL_XCODE_VERSION" |
| 70 | + echo "Expected: $XCODE_VERSION" |
| 71 | + exit 1 |
| 72 | + fi |
| 73 | +
|
| 74 | + - name: Setup Local Environment |
| 75 | + working-directory: tests/business-critical-integration |
| 76 | + run: | |
| 77 | + echo "🚀 Setting up local environment for integration tests..." |
| 78 | + |
| 79 | + # Run setup script with parameters from repository secrets |
| 80 | + ./scripts/setup-local-environment.sh \ |
| 81 | + "${{ secrets.BCIT_TEST_PROJECT_ID }}" \ |
| 82 | + "${{ secrets.BCIT_ITERABLE_SERVER_KEY }}" \ |
| 83 | + "${{ secrets.BCIT_ITERABLE_API_KEY }}" |
| 84 | +
|
| 85 | + - name: Validate Setup |
| 86 | + working-directory: tests/business-critical-integration |
| 87 | + run: | |
| 88 | + echo "🔍 Validating environment setup..." |
| 89 | + ./scripts/validate-setup.sh |
| 90 | +
|
| 91 | + - name: Run Embedded Messages Tests |
| 92 | + working-directory: tests/business-critical-integration |
| 93 | + run: | |
| 94 | + echo "🧪 Running embedded messages integration tests..." |
| 95 | + CI=true ./scripts/run-tests.sh embedded |
| 96 | +
|
| 97 | + - name: Upload Test Results |
| 98 | + if: always() |
| 99 | + uses: actions/upload-artifact@v4 |
| 100 | + with: |
| 101 | + name: embedded-messages-test-results |
| 102 | + path: | |
| 103 | + tests/business-critical-integration/reports/ |
| 104 | + tests/business-critical-integration/screenshots/ |
| 105 | + tests/business-critical-integration/logs/ |
| 106 | + retention-days: 7 |
| 107 | + |
0 commit comments