Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ad0aff1
test: wire iOS E2E to local Spark
piotr-iohk Nov 19, 2026
562760b
ci: isolate and validate iOS Spark dispatches
piotr-iohk Nov 19, 2026
83303ed
test: split Spark sweep signature preimage assembly
piotr-iohk Nov 19, 2026
475881f
ci: run Spark in the local E2E nightly
piotr-iohk Nov 19, 2026
d4289e0
ci: retry Spark nightly tests and retain attempt artifacts
piotr-iohk Nov 19, 2026
78236a1
ci: prepare iOS Spark fixture images on hosted Linux
piotr-iohk Nov 19, 2026
f886269
ci: compress the iOS Spark image archive for transfer
piotr-iohk Nov 19, 2026
b343d89
ci: build the Spark simulator app on hosted macOS
piotr-iohk Nov 19, 2026
5e49585
ci: build the Spark simulator app for ARM64
piotr-iohk Nov 19, 2026
095fc73
ci: reuse verified Spark images on the shared Mac
piotr-iohk Nov 19, 2026
7367ef7
ci: summarize local E2E nightly in Slack
piotr-iohk Nov 20, 2026
c597201
ci: preserve explicit Spark case outcomes
piotr-iohk Nov 20, 2026
a80b117
ci: report Spark app setup failures across retries
piotr-iohk Nov 20, 2026
8508ed6
ci: temporarily dispatch the Spark nightly from the draft branch
piotr-iohk Nov 20, 2026
968e431
ci: restore the regular E2E workflow after Spark dispatch
piotr-iohk Nov 20, 2026
e94140e
ci: report local nightly results by job
piotr-iohk Nov 20, 2026
deb25d3
ci: use reusable E2E retry step names
piotr-iohk Nov 20, 2026
5291501
fix: share the local Spark chain across wallet operations
piotr-iohk Nov 20, 2026
e939dbd
ci: isolate the Spark image cache and keep retry diagnostics
piotr-iohk Nov 20, 2026
8f026be
fix: guard local Spark funding against custom Electrum servers
piotr-iohk Nov 20, 2026
fe94c4a
ci: share the iOS regtest Compose project
piotr-iohk Nov 20, 2026
0b5f8c6
ci: retain iOS Spark logs before each retry
piotr-iohk Nov 20, 2026
2ad8013
Run self-hosted iOS E2E on iPhone 17 Pro
piotr-iohk Nov 23, 2026
763a19a
ci: run self-hosted iOS E2E on iOS 27.2
piotr-iohk Nov 23, 2026
ee4dcdc
ci: rerun the native iOS PR checks
piotr-iohk Nov 24, 2026
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
323 changes: 323 additions & 0 deletions .github/workflows/e2e-local-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,323 @@
name: Local E2E Nightly (iOS)

on:
schedule:
- cron: "35 5 * * *"
workflow_dispatch:
inputs:
e2e_branch:
description: "Ref in synonymdev/bitkit-e2e-tests"
type: string
default: main
post_to_slack:
description: "Post Local E2E Nightly summary to Slack (#bitkit-staging-nightly)"
type: boolean
default: false

permissions:
contents: read

env:
TERM: xterm-256color
FORCE_COLOR: 1
GIT_LFS_SKIP_SMUDGE: "1"

concurrency:
group: bitkit-local-e2e-nightly-ios
cancel-in-progress: false

jobs:
spark-images:
runs-on: ubuntu-24.04-arm
timeout-minutes: 80
outputs:
e2e-sha: ${{ steps.e2e.outputs.sha }}
spark-config: ${{ steps.settings.outputs.SPARK_LOCAL_CONFIG_B64 }}
spark-chain-url: ${{ steps.settings.outputs.SPARK_LOCAL_CHAIN_URL }}
image-fingerprint: ${{ steps.settings.outputs.image-fingerprint }}
steps:
- uses: actions/checkout@v7
with:
repository: synonymdev/bitkit-e2e-tests
ref: ${{ inputs.e2e_branch || 'main' }}
persist-credentials: false

- name: Record shared E2E revision
id: e2e
run: |
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
if [[ "$(git symbolic-ref --quiet HEAD)" == refs/heads/main ]]; then
echo 'save-cache=true' >> "$GITHUB_OUTPUT"
fi

- name: Restore pinned Spark fixture images
id: images
uses: actions/cache/restore@v6
with:
path: ${{ runner.temp }}/spark-images.tar
key: spark-fixture-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('BITKIT_DOCKER_REVISION') }}

- name: Package pinned Spark fixture images
if: steps.images.outputs.cache-hit != 'true'
run: ./scripts/local-backend spark-pack "$RUNNER_TEMP/spark-images.tar"

- name: Generate pinned Spark app settings
id: settings
run: |
docker image load --quiet --input "$RUNNER_TEMP/spark-images.tar"
./scripts/local-backend spark-init-env >> "$GITHUB_OUTPUT"
fingerprint="$(./scripts/local-backend spark-image-fingerprint)"
echo "image-fingerprint=$fingerprint" >> "$GITHUB_OUTPUT"

- name: Save pinned Spark fixture images
if: steps.images.outputs.cache-hit != 'true' && steps.e2e.outputs.save-cache == 'true'
continue-on-error: true
uses: actions/cache/save@v6
with:
path: ${{ runner.temp }}/spark-images.tar
key: ${{ steps.images.outputs.cache-primary-key }}

- name: Compress the fixture archive for transfer
run: gzip -1 -c "$RUNNER_TEMP/spark-images.tar" > "$RUNNER_TEMP/spark-images.tar.gz"

- uses: actions/upload-artifact@v7
with:
name: spark-fixture-images
path: ${{ runner.temp }}/spark-images.tar.gz
if-no-files-found: error
compression-level: 0
retention-days: 3

build-spark-ios:
needs: spark-images
runs-on: macos-26
timeout-minutes: 45
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- uses: actions/checkout@v7
with:
repository: synonymdev/bitkit-e2e-tests
ref: ${{ needs.spark-images.outputs.e2e-sha }}
path: bitkit-e2e-tests
persist-credentials: false

- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "26.6"

- name: Install xcbeautify
run: brew install xcbeautify

- name: Swift packages
uses: ./.github/actions/swift-packages

- name: Build iOS Spark app
working-directory: bitkit-e2e-tests
env:
IOS_ROOT: ${{ github.workspace }}
IOS_SIMULATOR_ARCH: arm64
SPARK_LOCAL_CONFIG_B64: ${{ needs.spark-images.outputs.spark-config }}
SPARK_LOCAL_CHAIN_URL: ${{ needs.spark-images.outputs.spark-chain-url }}
run: |
test -n "$SPARK_LOCAL_CONFIG_B64"
test -n "$SPARK_LOCAL_CHAIN_URL"
./scripts/build-ios-sim.sh
tar -C aut -czf "$RUNNER_TEMP/spark-ios-app.tar.gz" Bitkit.app

- uses: actions/upload-artifact@v7
with:
name: spark-ios-app
path: ${{ runner.temp }}/spark-ios-app.tar.gz
if-no-files-found: error
compression-level: 0
retention-days: 3

e2e-spark:
needs: [spark-images, build-spark-ios]
runs-on: [self-hosted, macOS]
timeout-minutes: 120
env:
SIMULATOR_NAME: "iPhone 17"
SIMULATOR_OS_VERSION: "27.2"
# The PR suite uses the same fixed Bitcoin and Electrum ports on this Mac.
COMPOSE_PROJECT_NAME: docker
steps:
- uses: actions/checkout@v7
with:
repository: synonymdev/bitkit-e2e-tests
ref: ${{ needs.spark-images.outputs.e2e-sha }}
path: bitkit-e2e-tests
persist-credentials: false

- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
cache-dependency-path: bitkit-e2e-tests/package-lock.json

- name: Install Appium dependencies
working-directory: bitkit-e2e-tests
run: npm ci

- name: Check the local Spark images
id: local-images
working-directory: bitkit-e2e-tests
env:
SPARK_IMAGE_FINGERPRINT: ${{ needs.spark-images.outputs.image-fingerprint }}
run: |
if [[ "$RUNNER_ARCH" != ARM64 ]]; then
echo "::error::The Spark fixture archive requires an ARM64 Mac runner."
exit 1
fi
test -n "$SPARK_IMAGE_FINGERPRINT"
./scripts/local-backend prepare
if actual="$(./scripts/local-backend spark-image-fingerprint 2>/dev/null)" &&
[[ "$actual" == "$SPARK_IMAGE_FINGERPRINT" ]]; then
echo 'Reusing the exact pinned Spark images on this runner.'
echo 'match=true' >> "$GITHUB_OUTPUT"
fi

- uses: actions/download-artifact@v8
if: steps.local-images.outputs.match != 'true'
with:
name: spark-fixture-images
path: ${{ runner.temp }}

- name: Load the pinned Spark images
if: steps.local-images.outputs.match != 'true'
run: |
docker image load --input "$RUNNER_TEMP/spark-images.tar.gz"
rm -f "$RUNNER_TEMP/spark-images.tar.gz"

- uses: actions/download-artifact@v8
with:
name: spark-ios-app
path: ${{ runner.temp }}

- name: Unpack the hosted simulator build
working-directory: bitkit-e2e-tests
run: |
mkdir -p aut
tar -C aut -xzf "$RUNNER_TEMP/spark-ios-app.tar.gz"
rm -f "$RUNNER_TEMP/spark-ios-app.tar.gz"

- name: Start pinned Spark fixture
id: spark
working-directory: bitkit-e2e-tests
env:
SPARK_IMAGE_FINGERPRINT: ${{ needs.spark-images.outputs.image-fingerprint }}
SPARK_LOCAL_CONFIG_B64: ${{ needs.spark-images.outputs.spark-config }}
SPARK_LOCAL_CHAIN_URL: ${{ needs.spark-images.outputs.spark-chain-url }}
run: |
(cd "$(./scripts/local-backend path)" && docker compose --profile spark down --remove-orphans -v)
./scripts/local-backend spark-up
expected="$(printf 'SPARK_LOCAL_CONFIG_B64=%s\nSPARK_LOCAL_CHAIN_URL=%s' "$SPARK_LOCAL_CONFIG_B64" "$SPARK_LOCAL_CHAIN_URL")"
if [[ "$(./scripts/local-backend spark-env)" != "$expected" ]]; then
echo "::error::The running Spark fixture differs from the simulator build settings."
exit 1
fi

- name: Run E2E tests (attempt 1)
continue-on-error: true
id: test1
working-directory: bitkit-e2e-tests
run: ./scripts/run-spark-e2e.sh ios
env:
RECORD_VIDEO: true
ATTEMPT: 1

- name: Collect Spark logs after attempt 1
if: steps.test1.outcome == 'failure'
continue-on-error: true
working-directory: bitkit-e2e-tests
run: |
mkdir -p artifacts/attempt-1
./scripts/local-backend spark-logs --tail 200 > artifacts/attempt-1/spark-docker.log 2>&1

- name: Run E2E tests (attempt 2)
continue-on-error: true
if: steps.test1.outcome != 'success'
id: test2
working-directory: bitkit-e2e-tests
run: ./scripts/run-spark-e2e.sh ios
env:
RECORD_VIDEO: true
ATTEMPT: 2

- name: Collect Spark logs after attempt 2
if: steps.test2.outcome == 'failure'
continue-on-error: true
working-directory: bitkit-e2e-tests
run: |
mkdir -p artifacts/attempt-2
./scripts/local-backend spark-logs --tail 200 > artifacts/attempt-2/spark-docker.log 2>&1

- name: Run E2E tests (attempt 3)
if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success'
id: test3
working-directory: bitkit-e2e-tests
run: ./scripts/run-spark-e2e.sh ios
env:
RECORD_VIDEO: true
ATTEMPT: 3

- name: Collect Spark logs
if: failure()
working-directory: bitkit-e2e-tests
run: |
mkdir -p artifacts
./scripts/local-backend spark-logs --tail 200 > artifacts/spark-docker.log 2>&1 || true

- name: Stop Spark fixture
if: always() && steps.spark.outcome != 'skipped'
working-directory: bitkit-e2e-tests
run: cd "$(./scripts/local-backend path)" && docker compose --profile spark down --remove-orphans -v

- name: Remove the imported archives
if: always()
run: rm -f "$RUNNER_TEMP/spark-images.tar.gz" "$RUNNER_TEMP/spark-ios-app.tar.gz"

# Preserve logs and recordings from failed attempts even when a retry passes.
- uses: actions/upload-artifact@v7
if: always()
with:
name: spark-ios-${{ github.run_number }}
Comment thread
piotr-iohk marked this conversation as resolved.
Resolved
path: bitkit-e2e-tests/artifacts/
retention-days: 7

slack-report:
if: >-
always() &&
(github.event_name == 'schedule' ||
(github.event_name == 'workflow_dispatch' && inputs.post_to_slack == true))
needs: [spark-images, build-spark-ios, e2e-spark]
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read
steps:
- name: Checkout shared Slack reporter
uses: actions/checkout@v7
with:
repository: synonymdev/bitkit-e2e-tests
ref: main
persist-credentials: false

- name: Post Slack summary
run: python3 scripts/slack_summary.py e2e-local-nightly
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_STAGING }}
PLATFORM: ios
LOCAL_NIGHTLY_RESULT: >-
${{ contains(needs.*.result, 'failure') && 'failure' ||
contains(needs.*.result, 'cancelled') && 'cancelled' || needs.e2e-spark.result }}
SPARK_IMAGES_RESULT: ${{ needs.spark-images.result }}
BUILD_RESULT: ${{ needs.build-spark-ios.result }}
E2E_TESTS_REF: ${{ needs.spark-images.outputs.e2e-sha || inputs.e2e_branch || 'main' }}
E2E_TESTS_RESULT: ${{ needs.e2e-spark.result }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
RUN_ATTEMPT: ${{ github.run_attempt }}
9 changes: 6 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ jobs:
runs-on: [self-hosted, macOS]
needs: [detect-changes, build-local, e2e-branch]
env:
SIMULATOR_NAME: "iPhone 17"
SIMULATOR_OS_VERSION: "27.2"
Comment thread
ovitrif marked this conversation as resolved.
Resolved
# Reuse the legacy project so reset also clears containers left after a ref switch.
COMPOSE_PROJECT_NAME: docker
# Match the legacy fixture for the iOS manual channel funding Max case.
Expand Down Expand Up @@ -323,7 +325,8 @@ jobs:
run: |
if [ -x ./scripts/local-backend ]; then
./scripts/local-backend prepare
./scripts/local-backend down --remove-orphans -v -t 300
# Include services left by an interrupted Spark nightly on this Mac.
COMPOSE_PROFILES=spark ./scripts/local-backend down --remove-orphans -v -t 300
./scripts/local-backend up
./scripts/local-backend github-env >> "$GITHUB_ENV"
else
Expand Down Expand Up @@ -351,7 +354,7 @@ jobs:
- name: Clear iOS Simulator environment
run: |
xcrun simctl shutdown all || true
xcrun simctl erase "iPhone 17" || true
xcrun simctl erase "$SIMULATOR_NAME" || true
defaults write com.apple.iphonesimulator DisableAllNotifications -bool true

- name: Run E2E Tests 1 (${{ matrix.shard.name }})
Expand Down Expand Up @@ -396,7 +399,7 @@ jobs:
working-directory: bitkit-e2e-tests
run: |
if [ -x ./scripts/local-backend ]; then
./scripts/local-backend down --remove-orphans -v || true
COMPOSE_PROFILES=spark ./scripts/local-backend down --remove-orphans -v || true
else
(cd docker && docker compose --profile trezor down --remove-orphans -v) || true
fi
Expand Down
Loading
Loading