Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 0 additions & 96 deletions .github/scripts/namespace-stack.sh

This file was deleted.

18 changes: 6 additions & 12 deletions .github/workflows/ai-device-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
trezor-emu:
if: inputs.suite == 'trezor-emu'
name: Trezor emulator dashboard
runs-on: namespace-profile-mac
runs-on: [self-hosted, macOS]
timeout-minutes: 90

steps:
Expand Down Expand Up @@ -66,15 +66,6 @@ jobs:
run: |
xcodebuild -resolvePackageDependencies -onlyUsePackageVersionsFromResolvedFile | xcbeautify

- name: Start remote Docker
run: |
awk '{ print } /^ trezor-user-env-mac:$/ { print " extra_hosts:\n - \"host.docker.internal:host-gateway\"" }' \
bitkit-docker/docker-compose.yml > /tmp/docker-compose.yml
mv /tmp/docker-compose.yml bitkit-docker/docker-compose.yml
mkdir -p bitkit-docker/lnd bitkit-docker/.trezor-user-env/{trezor-suite,logs/screens,logs/mcp-screenshots,firmware/user_downloaded}
.github/scripts/namespace-stack.sh up bitkit-docker
.github/scripts/namespace-stack.sh forward 43782 39388 60001 21325 21328 9001 23902

- name: Start regtest and Trezor emulator
working-directory: bitkit-docker
run: |
Expand Down Expand Up @@ -148,6 +139,9 @@ jobs:
path: ai-device-artifacts/trezor
if-no-files-found: warn

- name: Tear down emulator stack
- name: Stop emulator services
if: always()
run: .github/scripts/namespace-stack.sh down
working-directory: bitkit-docker
run: |
./scripts/trezor-emulator stop || true
docker compose down || true
55 changes: 20 additions & 35 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,8 @@ jobs:
checks: write
actions: write
if: github.event.pull_request.draft == false && needs.detect-changes.outputs.code == 'true'
runs-on: namespace-profile-mac
runs-on: [self-hosted, macOS]
needs: [detect-changes, build-local, e2e-branch]
env:
SIMULATOR_NAME: "iPhone 17"
SIMULATOR_OS_VERSION: "26.5"

strategy:
fail-fast: false
Expand All @@ -247,12 +244,6 @@ jobs:
name: e2e-tests-local - ${{ matrix.shard.name }}

steps:
- name: Checkout stack scripts
uses: actions/checkout@v7
with:
ref: ${{ inputs.merge_commit || '' }}
sparse-checkout: .github/scripts

- name: Checkout retarget reporter
if: inputs.retarget_run != ''
uses: actions/checkout@v7
Expand Down Expand Up @@ -315,11 +306,23 @@ jobs:
working-directory: bitkit-e2e-tests
run: npm ci

- name: Docker info
run: |
docker --version
docker info
docker ps
docker compose version

- name: Reset regtest environment
working-directory: bitkit-e2e-tests/docker
continue-on-error: true
run: docker compose --verbose down -v -t 300

- name: Run regtest setup
working-directory: bitkit-e2e-tests/docker
run: |
.github/scripts/namespace-stack.sh up bitkit-e2e-tests/docker
(cd bitkit-e2e-tests/docker && docker compose up --force-recreate -d)
.github/scripts/namespace-stack.sh forward 43782 39388 60001 8080 9735 10009 3003 9001 9002 21325 21328
mkdir -p lnd && chmod 777 lnd
docker compose --verbose up --force-recreate -d

- name: Wait for electrum server
run: |
Expand All @@ -329,17 +332,6 @@ jobs:
done
exit 1

- name: Copy LND credentials
working-directory: bitkit-e2e-tests/docker
run: |
mkdir -p lnd/data/chain/bitcoin/regtest
for _ in $(seq 1 60); do
docker cp lnd:/home/lnd/.lnd/data/chain/bitcoin/regtest/admin.macaroon lnd/data/chain/bitcoin/regtest/ 2>/dev/null && break
sleep 5
done
docker cp lnd:/home/lnd/.lnd/tls.cert lnd/tls.cert
test -s lnd/data/chain/bitcoin/regtest/admin.macaroon

- name: Clear previous E2E artifacts
working-directory: bitkit-e2e-tests
run: |
Expand All @@ -348,16 +340,8 @@ jobs:

- name: Clear iOS Simulator environment
run: |
udid=$(xcrun simctl list devices available -j | python3 -c '
import json, os, sys
runtime = "com.apple.CoreSimulator.SimRuntime.iOS-" + os.environ["SIMULATOR_OS_VERSION"].replace(".", "-")
devices = json.load(sys.stdin)["devices"].get(runtime, [])
print(next(d["udid"] for d in devices if d["name"] == os.environ["SIMULATOR_NAME"]))
')
xcrun simctl shutdown all || true
xcrun simctl erase "$udid"
xcrun simctl boot "$udid"
xcrun simctl bootstatus "$udid" -b
xcrun simctl erase "iPhone 17" || true
defaults write com.apple.iphonesimulator DisableAllNotifications -bool true

- name: Run E2E Tests 1 (${{ matrix.shard.name }})
Expand Down Expand Up @@ -397,9 +381,10 @@ jobs:
path: bitkit-e2e-tests/artifacts/
retention-days: 7

- name: Tear down regtest stack
- name: Cleanup Docker containers
if: always()
run: .github/scripts/namespace-stack.sh down
working-directory: bitkit-e2e-tests/docker
run: docker compose down -v || true

e2e-status:
if: always() && github.event.pull_request.draft == false
Expand Down
57 changes: 38 additions & 19 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ jobs:
cache-mode: read
if: github.event.pull_request.draft == false
name: Run Integration Tests
# The suites fund and mine on a local regtest stack. macOS runners cannot run Docker, so this
# runs on Namespace, which hosts the stack on a Linux instance (see namespace-stack.sh).
runs-on: namespace-profile-mac
runs-on: macos-26
timeout-minutes: 60
permissions:
contents: read
Expand Down Expand Up @@ -88,23 +86,41 @@ jobs:
const {reportRetargetResult} = require('./retarget-ci/.github/scripts/retarget-tests.cjs');
await reportRetargetResult({github, context, core, name: 'Run Integration Tests', phase: 'start'});

- name: Checkout bitkit-docker
uses: actions/checkout@v7
- name: Install bitcoind
run: |
curl -fsSL -o /tmp/bitcoin.tar.gz https://bitcoincore.org/bin/bitcoin-core-26.0/bitcoin-26.0-arm64-apple-darwin.tar.gz
tar -xzf /tmp/bitcoin.tar.gz -C /tmp
echo "/tmp/bitcoin-26.0/bin" >> "$GITHUB_PATH"

- name: Cache electrs
id: electrs-cache
uses: actions/cache@v6
with:
repository: synonymdev/bitkit-docker
ref: main
path: bitkit-docker
path: ~/.cargo/bin/electrs
key: electrs-0.10.2-${{ runner.os }}-${{ runner.arch }}

- name: Start local regtest
- name: Build electrs
if: steps.electrs-cache.outputs.cache-hit != 'true'
run: |
.github/scripts/namespace-stack.sh up bitkit-docker
.github/scripts/namespace-stack.sh forward 43782 60001
(cd bitkit-docker && docker compose up -d bitcoind bitcoinsetup electrs)
cargo install electrs --version 0.10.2 --locked

# A separate step: `namespace-stack.sh up` puts its `docker exec` wrapper on the PATH for later steps only.
- name: Mine initial blocks
timeout-minutes: 5
run: until docker exec bitcoin bitcoin-cli -regtest -rpcport=43782 -rpcuser=polaruser -rpcpassword=polarpass -generate 101; do sleep 2; done
- name: Start local regtest
env:
BITCOIN_DIR: ${{ runner.temp }}/bitcoin
ELECTRS_DB: ${{ runner.temp }}/electrs
run: |
mkdir -p "$BITCOIN_DIR" "$ELECTRS_DB"
bitcoind -regtest -daemon -datadir="$BITCOIN_DIR" \
-rpcport=43782 -rpcbind=127.0.0.1 -rpcallowip=127.0.0.1 -port=39388 \
-rpcauth='polaruser:5e5e98c21f5c814568f8b55d83b23c1c$066b03f92df30b11de8e4b1b1cd5b1b4281aa25205bd57df9be82caf97a05526' \
-txindex=1 -fallbackfee=0.00002 -maxmempool=500
cli() { bitcoin-cli -regtest -rpcport=43782 -rpcuser=polaruser -rpcpassword=polarpass "$@"; }
until cli getblockchaininfo >/dev/null 2>&1; do sleep 1; done
cli createwallet default >/dev/null
cli -generate 101 >/dev/null
nohup ~/.cargo/bin/electrs --network regtest --db-dir "$ELECTRS_DB" --daemon-dir "$BITCOIN_DIR" \
--daemon-rpc-addr 127.0.0.1:43782 --daemon-p2p-addr 127.0.0.1:39388 \
--electrum-rpc-addr 127.0.0.1:60001 > "${{ runner.temp }}/electrs.log" 2>&1 &

- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
Expand Down Expand Up @@ -210,9 +226,12 @@ jobs:
name: integration-test-results
path: ${{ env.RESULT_BUNDLE }}

- name: Tear down regtest stack
if: always()
run: .github/scripts/namespace-stack.sh down
- name: Upload electrs log
if: failure()
uses: actions/upload-artifact@v7
with:
name: electrs-log
path: ${{ runner.temp }}/electrs.log

report-retarget-result:
name: Report retarget integration result
Expand Down
Loading