1+ name : Integration Tests
2+
3+ on :
4+ # Run for all PRs
5+ pull_request :
6+
7+ concurrency :
8+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+ cancel-in-progress : true
10+
11+ permissions :
12+ contents : read
13+
14+ env :
15+ XCODE_VERSION : " 16.4"
16+ WORKING_DIRECTORY : IntegrationTests
17+ WIREMOCK_VERSION : " 3.9.1"
18+
19+ jobs :
20+ integration-tests :
21+ name : iOS Integration Tests
22+ runs-on : macos-15
23+ timeout-minutes : 30
24+
25+ steps :
26+ - name : Checkout
27+ uses : actions/checkout@v5
28+
29+ - name : Select Xcode
30+ run : sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
31+
32+ - name : Install Tuist
33+ run : brew install tuist
34+
35+ - name : Setup Java
36+ uses : actions/setup-java@v4
37+ with :
38+ distribution : ' temurin'
39+ java-version : ' 17'
40+
41+ - name : Download WireMock standalone
42+ run : |
43+ curl -L -o wiremock.jar \
44+ "https://repo1.maven.org/maven2/org/wiremock/wiremock-standalone/${{ env.WIREMOCK_VERSION }}/wiremock-standalone-${{ env.WIREMOCK_VERSION }}.jar"
45+ echo "✅ WireMock downloaded"
46+
47+ - name : Run Integration Tests
48+ id : integration_tests
49+ working-directory : ${{ env.WORKING_DIRECTORY }}
50+ env :
51+ CI : " true"
52+ WIREMOCK_JAR : ${{ github.workspace }}/wiremock.jar
53+ run : |
54+ # Make scripts executable
55+ chmod +x run_clean_integration_tests.sh common.sh run_integration_tests_ci.sh
56+
57+ # Run the CI-specific verification script
58+ ./run_integration_tests_ci.sh
59+
60+ - name : Collect WireMock logs on failure
61+ if : failure()
62+ working-directory : ${{ env.WORKING_DIRECTORY }}
63+ run : |
64+ echo "📋 Collecting WireMock logs..."
65+ mkdir -p artifacts
66+
67+ # Collect WireMock log file if exists
68+ if [ -f "wiremock.log" ]; then
69+ cp wiremock.log artifacts/wiremock-logs.txt || true
70+ fi
71+
72+ # Get unmatched requests
73+ curl -s http://localhost:8080/__admin/requests/unmatched > artifacts/unmatched-requests.json 2>/dev/null || true
74+
75+ # Get all requests
76+ curl -s http://localhost:8080/__admin/requests > artifacts/all-requests.json 2>/dev/null || true
77+
78+ echo "✅ Logs collected"
79+
80+ - name : Collect test artifacts on failure
81+ if : failure()
82+ working-directory : ${{ env.WORKING_DIRECTORY }}
83+ run : |
84+ echo "📋 Collecting test artifacts..."
85+ mkdir -p artifacts
86+
87+ # Copy WireMock mappings for debugging
88+ if [ -d "wiremock-recordings/mappings" ]; then
89+ cp -r wiremock-recordings/mappings artifacts/mappings || true
90+ fi
91+
92+ # Collect simulator logs
93+ DEVICE_ID=$(xcrun simctl list devices | grep "iPhone" | grep "Booted" | head -1 | awk -F '[()]' '{print $2}')
94+ if [ -n "$DEVICE_ID" ]; then
95+ xcrun simctl spawn "$DEVICE_ID" log show --predicate 'subsystem == "com.mparticle"' --last 10m > artifacts/simulator-logs.txt 2>/dev/null || true
96+ fi
97+
98+ echo "✅ Artifacts collected"
99+
100+ - name : Upload artifacts on failure
101+ if : failure()
102+ uses : actions/upload-artifact@v4
103+ with :
104+ name : integration-test-artifacts
105+ path : ${{ env.WORKING_DIRECTORY }}/artifacts/
106+ retention-days : 7
107+ if-no-files-found : ignore
0 commit comments