Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 0c5f468

Browse files
committed
Replace CI upgrade test with local script
Remove GitHub Actions workflow and consolidate upgrade test into a single `just test-upgrade <commit>` command that uses git worktree for isolation.
1 parent 33851ee commit 0c5f468

3 files changed

Lines changed: 85 additions & 106 deletions

File tree

.github/workflows/upgrade_tests.yml

Lines changed: 0 additions & 101 deletions
This file was deleted.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
COMMIT="${1:?Usage: just upgrade-test <commit-or-tag>}"
5+
REPO_ROOT="$(git rev-parse --show-toplevel)"
6+
WORKTREE_DIR="/tmp/gem-upgrade-test-$$"
7+
SIMULATOR_NAME="${SIMULATOR_NAME:-iPhone 17}"
8+
SIMULATOR_DEST="platform=iOS Simulator,name=$SIMULATOR_NAME"
9+
OLD_DERIVED_DATA="$WORKTREE_DIR/build/DerivedData"
10+
OLD_SPM_CACHE="$WORKTREE_DIR/build/SourcePackages"
11+
BUILD_THREADS="$(sysctl -n hw.ncpu)"
12+
13+
cleanup() {
14+
echo "==> Cleaning up worktree"
15+
cd "$REPO_ROOT"
16+
git worktree remove --force "$WORKTREE_DIR" 2>/dev/null || true
17+
}
18+
trap cleanup EXIT
19+
20+
echo "==> Phase 1: Build old version ($COMMIT)"
21+
22+
git worktree add "$WORKTREE_DIR" "$COMMIT"
23+
cd "$WORKTREE_DIR"
24+
git submodule update --init
25+
26+
echo "==> Generating stone (old)"
27+
just generate-stone
28+
29+
echo "==> Building old version for UI testing"
30+
set -o pipefail && xcodebuild -project Gem.xcodeproj \
31+
-scheme GemUITests \
32+
-testPlan ui_tests \
33+
ONLY_ACTIVE_ARCH=YES \
34+
-destination "$SIMULATOR_DEST" \
35+
-derivedDataPath "$OLD_DERIVED_DATA" \
36+
-clonedSourcePackagesDirPath "$OLD_SPM_CACHE" \
37+
-allowProvisioningUpdates \
38+
-allowProvisioningDeviceRegistration \
39+
-parallelizeTargets \
40+
-jobs "$BUILD_THREADS" \
41+
build-for-testing | xcbeautify --quieter --is-ci
42+
43+
echo "==> Resetting simulator"
44+
cd "$REPO_ROOT"
45+
just reset-simulator
46+
47+
echo "==> Running ImportWalletReceiveBitcoinUITests (old version)"
48+
cd "$WORKTREE_DIR"
49+
set -o pipefail && xcodebuild -project Gem.xcodeproj \
50+
-scheme GemUITests \
51+
-testPlan ui_tests \
52+
ONLY_ACTIVE_ARCH=YES \
53+
-destination "$SIMULATOR_DEST" \
54+
-derivedDataPath "$OLD_DERIVED_DATA" \
55+
-clonedSourcePackagesDirPath "$OLD_SPM_CACHE" \
56+
-allowProvisioningUpdates \
57+
-allowProvisioningDeviceRegistration \
58+
-only-testing GemUITests/ImportWalletReceiveBitcoinUITests \
59+
test-without-building | xcbeautify --quieter --is-ci
60+
61+
echo "==> Phase 2: Build current version"
62+
cd "$REPO_ROOT"
63+
64+
just build-for-testing-ui
65+
66+
DERIVED_DATA="build/DerivedData"
67+
SPM_CACHE="build/SourcePackages"
68+
69+
echo "==> Running UpgradeVerificationTests (current version)"
70+
set -o pipefail && xcodebuild -project Gem.xcodeproj \
71+
-scheme GemUITests \
72+
-testPlan ui_tests \
73+
ONLY_ACTIVE_ARCH=YES \
74+
-destination "$SIMULATOR_DEST" \
75+
-derivedDataPath "$DERIVED_DATA" \
76+
-clonedSourcePackagesDirPath "$SPM_CACHE" \
77+
-allowProvisioningUpdates \
78+
-allowProvisioningDeviceRegistration \
79+
-only-testing GemUITests/UpgradeVerificationTests \
80+
test-without-building | xcbeautify --quieter --is-ci
81+
82+
echo "==> Upgrade test passed!"

justfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,9 @@ build-for-testing-ui: (_test-ui "build-for-testing")
139139

140140
test-ui-without-building: reset-simulator (_test-ui "test-without-building")
141141

142-
# Run ImportWalletReceiveBitcoinUITests without building (phase 1 of upgrade test)
143-
test-upgrade-setup: (_test-ui "test-without-building" "GemUITests/ImportWalletReceiveBitcoinUITests")
144-
145-
# Run UpgradeVerificationTests without building and without resetting the simulator (phase 2 of upgrade test)
146-
test-upgrade-verify: (_test-ui "test-without-building" "GemUITests/UpgradeVerificationTests")
142+
# Run full upgrade test: build old version, create wallet, build current, verify wallet survives
143+
test-upgrade COMMIT:
144+
@bash build-system/scripts/upgrade-test.sh {{COMMIT}}
147145

148146
reset-simulator NAME=SIMULATOR_NAME:
149147
@echo "==> Resetting {{NAME}} simulator to clean state"

0 commit comments

Comments
 (0)