Skip to content

Commit d228d87

Browse files
authored
Merge branch 'master' into add-claude-github-actions-1763458753833
2 parents 81fe9d3 + ca68e16 commit d228d87

23 files changed

+296
-52
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ jobs:
4040
# Clean any existing build artifacts
4141
rm -rf DerivedData
4242
rm -rf ~/Library/Developer/Xcode/DerivedData
43-
43+
4444
# Clean Swift Package Manager caches
4545
rm -rf ~/Library/Caches/org.swift.swiftpm
4646
rm -rf ~/Library/org.swift.swiftpm
47-
47+
4848
# Reset package caches
4949
xcodebuild -resolvePackageDependencies -workspace Bitkit.xcodeproj/project.xcworkspace -scheme Bitkit
5050
@@ -55,6 +55,7 @@ jobs:
5555
CHATWOOT_API: ${{ secrets.CHATWOOT_API }}
5656
SIMULATOR_NAME: "iPhone 17"
5757
OS_VERSION: "latest"
58+
GEO: false
5859
run: |
5960
echo "=== Building iOS app ==="
6061
echo "Using simulator: $SIMULATOR_NAME (iOS $OS_VERSION)"
@@ -107,7 +108,7 @@ jobs:
107108
# - { name: onchain_boost_receive_widgets, grep: "@onchain|@boost|@receive|@widgets" }
108109
# - { name: settings, grep: "@settings" }
109110
# - { name: security, grep: "@security" }
110-
- { name: e2e, grep: '^(?!.*@settings_10)(@onboarding|@onchain_1|@numberpad|@widgets|@boost|@receive|@settings|@security)' }
111+
- { name: e2e, grep: '^(?!.*@settings_10)(@onboarding|@onchain_1|@onchain_2|@numberpad|@widgets|@boost|@receive|@settings|@security)' }
111112

112113
name: e2e-tests - ${{ matrix.shard.name }}
113114

@@ -160,20 +161,18 @@ jobs:
160161
- name: Reset regtest environment
161162
working-directory: bitkit-e2e-tests
162163
continue-on-error: true
163-
timeout-minutes: 10
164164
run: |
165165
cd docker && docker compose --verbose down -v -t 300
166166
167167
- name: Run regtest setup
168168
working-directory: bitkit-e2e-tests
169169
run: |
170170
cd docker
171-
mkdir lnd && chmod 777 lnd
171+
mkdir -p lnd && chmod 777 lnd
172172
docker compose --verbose up --force-recreate -d
173173
174174
- name: Wait for electrum server
175175
working-directory: bitkit-e2e-tests
176-
timeout-minutes: 10
177176
run: |
178177
echo "Waiting for Electrum server..."
179178
while ! nc -z '127.0.0.1' 60001; do
@@ -192,7 +191,8 @@ jobs:
192191
run: |
193192
echo "🔧 Shutting down all running iOS simulators..."
194193
xcrun simctl shutdown all || true
195-
xcrun simctl erase all || true
194+
echo "🔧 Erasing target simulator: iPhone 17..."
195+
xcrun simctl erase "iPhone 17" || true
196196
echo "🔧 Disabling iOS Simulator notifications..."
197197
defaults write com.apple.iphonesimulator DisableAllNotifications -bool true
198198
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: integration-tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
17+
test:
18+
if: github.event.pull_request.draft == false
19+
name: Run Integration Tests
20+
runs-on: macos-15
21+
timeout-minutes: 60
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Xcode
28+
uses: maxim-lobanov/setup-xcode@v1
29+
with:
30+
xcode-version: '16.4'
31+
32+
- name: Install xcbeautify
33+
run: |
34+
brew install xcbeautify
35+
36+
- name: Cache Swift Package Manager
37+
uses: actions/cache@v4
38+
with:
39+
path: |
40+
~/Library/Caches/org.swift.swiftpm
41+
~/Library/org.swift.swiftpm
42+
Bitkit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm
43+
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
44+
restore-keys: |
45+
${{ runner.os }}-spm-
46+
47+
- name: Cache DerivedData
48+
uses: actions/cache@v4
49+
with:
50+
path: ~/Library/Developer/Xcode/DerivedData
51+
key: ${{ runner.os }}-deriveddata-${{ hashFiles('**/*.swift', '**/*.m', '**/*.h', 'Bitkit.xcodeproj/project.pbxproj') }}
52+
restore-keys: |
53+
${{ runner.os }}-deriveddata-
54+
55+
- name: Install dependencies
56+
run: |
57+
echo "⏱️ Starting dependency resolution at $(date)"
58+
xcodebuild -resolvePackageDependencies | xcbeautify
59+
echo "✅ Dependencies resolved at $(date)"
60+
61+
- name: Pre-start simulator
62+
run: |
63+
echo "⏱️ Starting simulator at $(date)"
64+
xcrun simctl boot "iPhone 16" || true
65+
echo "✅ Simulator started at $(date)"
66+
67+
- name: Run integration tests
68+
run: |
69+
echo "⏱️ Starting integration tests at $(date)"
70+
set -o pipefail && xcodebuild test \
71+
-scheme Bitkit \
72+
-destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \
73+
-enableCodeCoverage NO \
74+
-parallel-testing-enabled NO \
75+
-only-testing:BitkitTests/TxBumpingTests \
76+
-only-testing:BitkitTests/UtxoSelectionTests \
77+
-only-testing:BitkitTests/BlocktankTests \
78+
-only-testing:BitkitTests/PaymentFlowTests \
79+
| xcbeautify --report junit
80+
echo "✅ Integration tests completed at $(date)"
81+
82+
- name: Upload test results
83+
uses: actions/upload-artifact@v4
84+
if: success() || failure()
85+
with:
86+
name: integration-test-results
87+
path: ~/Library/Developer/Xcode/DerivedData/**/Logs/Test/*.xcresult

.github/workflows/unit-tests.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,6 @@ jobs:
3232
run: |
3333
brew install xcbeautify
3434
35-
- name: List available simulators
36-
run: |
37-
echo "=== Full Simulator List ==="
38-
xcrun simctl list
39-
echo "\n=== Available Runtimes ==="
40-
xcrun simctl list runtimes
41-
echo "\n=== Device Pairs ==="
42-
xcrun simctl list devicetypes
43-
4435
- name: Cache Swift Package Manager
4536
uses: actions/cache@v4
4637
with:
@@ -56,26 +47,36 @@ jobs:
5647
uses: actions/cache@v4
5748
with:
5849
path: ~/Library/Developer/Xcode/DerivedData
59-
key: ${{ runner.os }}-deriveddata-${{ hashFiles('**/*.swift', '**/*.m', '**/*.h', '**/*.xcodeproj/**') }}
50+
key: ${{ runner.os }}-deriveddata-${{ hashFiles('**/*.swift', '**/*.m', '**/*.h', 'Bitkit.xcodeproj/project.pbxproj') }}
6051
restore-keys: |
6152
${{ runner.os }}-deriveddata-
6253
6354
- name: Install dependencies
6455
run: |
56+
echo "⏱️ Starting dependency resolution at $(date)"
6557
xcodebuild -resolvePackageDependencies | xcbeautify
58+
echo "✅ Dependencies resolved at $(date)"
6659
6760
- name: Pre-start simulator
6861
run: |
62+
echo "⏱️ Starting simulator at $(date)"
6963
xcrun simctl boot "iPhone 16" || true
64+
echo "✅ Simulator started at $(date)"
7065
71-
- name: Run tests
66+
- name: Run unit tests
7267
run: |
68+
echo "⏱️ Starting unit tests at $(date)"
7369
set -o pipefail && xcodebuild test \
7470
-scheme Bitkit \
7571
-destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \
7672
-enableCodeCoverage NO \
7773
-parallel-testing-enabled NO \
74+
-skip-testing:BitkitTests/TxBumpingTests \
75+
-skip-testing:BitkitTests/UtxoSelectionTests \
76+
-skip-testing:BitkitTests/BlocktankTests \
77+
-skip-testing:BitkitTests/PaymentFlowTests \
7878
| xcbeautify --report junit
79+
echo "✅ Unit tests completed at $(date)"
7980
8081
- name: Upload test results
8182
uses: actions/upload-artifact@v4

Bitkit.xcodeproj/project.pbxproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
Models/LnPeer.swift,
9090
Models/Toast.swift,
9191
Services/CoreService.swift,
92+
Services/GeoService.swift,
9293
Services/LightningService.swift,
9394
Services/MigrationsService.swift,
9495
Services/ServiceQueue.swift,
@@ -113,6 +114,7 @@
113114
Models/ReceivedTxSheetDetails.swift,
114115
Models/Toast.swift,
115116
Services/CoreService.swift,
117+
Services/GeoService.swift,
116118
Services/LightningService.swift,
117119
Services/ServiceQueue.swift,
118120
Services/VssStoreIdProvider.swift,
@@ -591,7 +593,7 @@
591593
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
592594
MTL_FAST_MATH = YES;
593595
ONLY_ACTIVE_ARCH = YES;
594-
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
596+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG CHECK_GEOBLOCK $(inherited)";
595597
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
596598
};
597599
name = Debug;
@@ -645,6 +647,7 @@
645647
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
646648
MTL_ENABLE_DEBUG_INFO = NO;
647649
MTL_FAST_MATH = YES;
650+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "CHECK_GEOBLOCK $(inherited)";
648651
SWIFT_COMPILATION_MODE = wholemodule;
649652
};
650653
name = Release;

Bitkit/Components/Activity/ActivityListFilter.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ struct ActivityListFilter: View {
3737
.onTapGesture {
3838
showingTagSelector = true
3939
}
40+
.accessibilityIdentifier("TagsPrompt")
4041
Image("calendar")
4142
.resizable()
4243
.frame(width: 24, height: 24)
4344
.foregroundColor(viewModel.startDate != nil ? .brandAccent : .white64)
4445
.onTapGesture {
4546
showingDateRange = true
4647
}
48+
.accessibilityIdentifier("DatePicker")
4749
}
4850
}
4951
.frame(width: .infinity, height: 48)

Bitkit/Components/Activity/DateRangeSelectorSheet.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ struct DateRangeSelectorSheet: View {
182182
startDate = nil
183183
endDate = nil
184184
viewModel.clearDateRange()
185+
isPresented = false
185186
}
186187
.accessibilityIdentifier("CalendarClearButton")
187188

Bitkit/Components/SegmentedControl.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ struct SegmentedControl<T: Hashable & CustomStringConvertible>: View {
5555
.contentShape(Rectangle())
5656
}
5757
.buttonStyle(PlainButtonStyle())
58+
.accessibilityIdentifier("Tab-\(tabItem.tab.description.lowercased())")
5859
}
5960
}
6061
.frame(maxWidth: .infinity)

Bitkit/Components/SheetIntro.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ struct SheetIntro: View {
9191
) {
9292
onContinue()
9393
}
94-
.accessibilityIdentifier("\(baseTestID)-button-continue")
94+
.accessibilityIdentifier("\(baseTestID)Continue")
9595
}
9696
} else {
9797
CustomButton(
9898
title: continueText
9999
) {
100100
onContinue()
101101
}
102-
.accessibilityIdentifier("\(baseTestID)-button-continue")
102+
.accessibilityIdentifier("\(baseTestID)Continue")
103103
}
104104
}
105105
}

Bitkit/Components/Tag.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ struct Tag: View {
4848
)
4949
.cornerRadius(8)
5050
.fixedSize(horizontal: true, vertical: false)
51+
.accessibilityElement(children: .contain)
52+
.accessibilityIdentifier("Tag-\(value)")
5153
}
5254

5355
var body: some View {
5456
if let onPress {
5557
Button(action: onPress) {
5658
tagContent
5759
}
58-
.accessibilityIdentifier("Tag-\(value)")
5960
.buttonStyle(.plain) // Use plain button style to avoid default button appearance interfering
6061
} else {
6162
tagContent

Bitkit/Constants/Env.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ enum Env {
1616
#endif
1717
static let dustLimit = 547
1818

19+
#if CHECK_GEOBLOCK
20+
static let isGeoblockingEnabled = true
21+
#else
22+
static let isGeoblockingEnabled = ProcessInfo.processInfo.environment["GEO"] == "true"
23+
#endif
24+
1925
/// The current execution context of the app
2026
static var currentExecutionContext: ExecutionContext {
2127
return Bundle.main.bundleIdentifier?.lowercased().contains("notification") == true ? .pushNotificationExtension : .foregroundApp

0 commit comments

Comments
 (0)