Repository navigation
test: enable local Spark E2E on iOS #1371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 562760b
ci: isolate and validate iOS Spark dispatches
piotr-iohk 83303ed
test: split Spark sweep signature preimage assembly
piotr-iohk 475881f
ci: run Spark in the local E2E nightly
piotr-iohk d4289e0
ci: retry Spark nightly tests and retain attempt artifacts
piotr-iohk 78236a1
ci: prepare iOS Spark fixture images on hosted Linux
piotr-iohk f886269
ci: compress the iOS Spark image archive for transfer
piotr-iohk b343d89
ci: build the Spark simulator app on hosted macOS
piotr-iohk 5e49585
ci: build the Spark simulator app for ARM64
piotr-iohk 095fc73
ci: reuse verified Spark images on the shared Mac
piotr-iohk 7367ef7
ci: summarize local E2E nightly in Slack
piotr-iohk c597201
ci: preserve explicit Spark case outcomes
piotr-iohk a80b117
ci: report Spark app setup failures across retries
piotr-iohk 8508ed6
ci: temporarily dispatch the Spark nightly from the draft branch
piotr-iohk 968e431
ci: restore the regular E2E workflow after Spark dispatch
piotr-iohk e94140e
ci: report local nightly results by job
piotr-iohk deb25d3
ci: use reusable E2E retry step names
piotr-iohk 5291501
fix: share the local Spark chain across wallet operations
piotr-iohk e939dbd
ci: isolate the Spark image cache and keep retry diagnostics
piotr-iohk 8f026be
fix: guard local Spark funding against custom Electrum servers
piotr-iohk fe94c4a
ci: share the iOS regtest Compose project
piotr-iohk 0b5f8c6
ci: retain iOS Spark logs before each retry
piotr-iohk 2ad8013
Run self-hosted iOS E2E on iPhone 17 Pro
piotr-iohk 763a19a
ci: run self-hosted iOS E2E on iOS 27.2
piotr-iohk ee4dcdc
ci: rerun the native iOS PR checks
piotr-iohk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} | ||
| 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 }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.