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