-
Notifications
You must be signed in to change notification settings - Fork 2
99 lines (83 loc) · 3.03 KB
/
integration-tests.yml
File metadata and controls
99 lines (83 loc) · 3.03 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
name: integration-tests
on:
push:
branches: [master]
pull_request:
branches: [master]
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
if: github.event.pull_request.draft == false
name: Run Integration Tests
runs-on: macos-15
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.4'
- name: Install xcbeautify
run: |
brew install xcbeautify
- name: Cache Swift Package Manager
uses: actions/cache@v5
with:
path: |
~/Library/Caches/org.swift.swiftpm
~/Library/org.swift.swiftpm
Bitkit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
- name: Install dependencies
run: |
echo "⏱️ Starting dependency resolution at $(date)"
xcodebuild -resolvePackageDependencies -onlyUsePackageVersionsFromResolvedFile | xcbeautify
echo "✅ Dependencies resolved at $(date)"
- name: Clean build
run: |
echo "⏱️ Cleaning build at $(date)"
xcodebuild clean -scheme Bitkit | xcbeautify
echo "✅ Build cleaned at $(date)"
- name: Run integration tests
run: |
echo "⏱️ Starting integration tests at $(date)"
run_tests() {
set -o pipefail && xcodebuild test \
-scheme Bitkit \
-destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \
-enableCodeCoverage NO \
-parallel-testing-enabled NO \
-only-testing:BitkitTests/UtxoSelectionTests \
-only-testing:BitkitTests/BlocktankTests \
-only-testing:BitkitTests/PaymentFlowTests \
-only-testing:BitkitTests/AddressTypeIntegrationTests \
| xcbeautify --report junit
}
# Try up to 3 times with simulator reset between failures
for attempt in 1 2 3; do
echo "🔄 Test attempt $attempt of 3"
if run_tests; then
echo "✅ Integration tests completed at $(date)"
exit 0
fi
if [ $attempt -lt 3 ]; then
echo "⚠️ Test attempt $attempt failed, resetting simulator..."
xcrun simctl shutdown all || true
xcrun simctl erase "iPhone 16" || true
xcrun simctl boot "iPhone 16"
sleep 5
fi
done
echo "❌ All test attempts failed"
exit 1
- name: Upload test results
uses: actions/upload-artifact@v6
if: success() || failure()
with:
name: integration-test-results
path: ~/Library/Developer/Xcode/DerivedData/**/Logs/Test/*.xcresult