QA: report-only e2e lanes (android / iOS / cache nightly) (#3700)
What changed, and why it matters
This commit adds three new automated testing pipelines for the Cake Wallet mobile app: one for Android, one for iOS, and a weekly overnight test. These are explicitly marked as 'reply-only' experiments, meaning a failure will not block releases. The pipelines run real app builds in cloud test environments, send test commands to the app, and use sensitive test wallet seed phrases and API keys. The commit also includes several safety measures: it keeps secrets out of logs, uses encrypted storage for detailed test recordings, and avoids a subtle iOS issue where a common test runner could accidentally expose secrets in the process list. Because this is new infrastructure handling real secrets and running real app code, it deserves a security review, but it is not a known vulnerability in the app itself.
Treat this as a security-sensitive infrastructure change, not an app vulnerability. Reviewers should verify: (1) secrets are not echoed in workflow logs or uploaded unredacted; (2) the `OLLAMA_API_KEY`/`OLLAMA_API_KEY` values are scoped and rotated; (3) the deploy key for `cake-wallet-qa` has only the minimum required permissions; (4) the encrypted artifact passphrase is stored separately from the artifacts; (5) the `NO_REPLY` setting is intentional and documented so a failing security-relevant test does not get ignored; (6) the iOS build VM is genuinely isolated from the test VM. No user-facing patch is required.
Security signals we found
New CI/CD pipeline handling wallet seed phrases and API keys
Use of `NO_REPLY` / `continue-on-error: true` to avoid blocking merges
Explicit mitigation: avoids `npx` on macOS to prevent environment-variable leakage via process title
Explicit mitigation: redacts seed-like strings from uploaded artifacts
Explicit mitigation: encrypts detailed test recordings with a passphrase before upload
iOS build stage runs without secrets; secrets only enter the test stage
Overnight job uses a deploy key to push replay data to a separate repo
No changes to application source code; purely infrastructure/test automation
Evidence from the diff
The commit introduces .github/workflows/vector-android.yml, vector-ios.yml, vector-overnight.yml, and scripts/vector/ios_build.sh. They build or download Android/iOS app artifacts, run a separate cake-tech/cake-wallet-qa test suite, and feed it wallet seeds (SEED_*) and API keys (OLLAMA_API_KEY/OLLAMA_API_KEY fallback). Notable security-relevant details: (1) the spec uses NO_REPLY / continue-on-error: true everywhere; (2) it avoids npx on macOS because npm exec rewrites the process title and can leak environment variables including seeds into ps output; (3) it redacts seed-like strings before uploading artifacts; (4) detailed logs are encrypted with a passphrase before upload; (5) the iOS build runs in a separate VM without secrets, then only the test VM receives secrets; (6) the overnight job can push updated test replay data back to the cake-wallet-qa repo using a deploy key. The spec also fixes several reliability issues (control-token loops, VM budget, emoji packs, etc.). There is no patch to application code, no disclosed vulnerability, and no attribution to a researcher.
Changed components
.github/workflows/vector-android.yml.github/workflows/vector-ios.yml.github/workflows/vector-overnight.ymlscripts/vector/ios_build.shInspect captured patch +801 / −0
### .github/workflows/e2e_android.yml
@@ -0,0 +1,297 @@
+# Layer-B e2e lane (QA handoff §6 4-a).
+#
+# REPORT-ONLY — permanently until Seth says otherwise: `continue-on-error: true`
+# at job level, never a required check. It tests the SAME run's pr_test_build
+# "android apk" artifact (no rebuild, no dev fallback) and the QA project from
+# cake-qa (deploy key), with the no-funds slice in read-only cache (the runner
+# is CI, so e2e defaults to `cache: read-only` and never records).
+name: E2E (Android)
+
+on:
+ workflow_dispatch:
+ inputs:
+ runs_on:
+ description: "runner label: ubuntu-latest (hosted KVM) or a self-hosted label"
+ type: string
+ default: ubuntu-latest
+ build_run:
+ description: "pr_test_build run id whose x86_64 APK artifact to test (empty = auto-resolve from the head SHA)"
+ type: string
+ default: ""
+ shard:
+ description: "e.g. 2/3 (empty = single run)"
+ type: string
+ default: ""
+ qa_ref:
+ description: "cake-qa git ref to test (empty = that repo's default branch). Used by the broken-label acceptance run."
+ type: string
+ default: ""
+ suite:
+ description: "test file/glob to run (empty = the no-funds slice)"
+ type: string
+ default: ""
+ grep:
+ description: "only tests whose title matches this regular expression (empty = all)"
+ type: string
+ default: ""
+ pull_request:
+ types: [opened, synchronize, reopened]
+
+permissions:
+ contents: read
+ pull-requests: write
+ # the resolve job's auto-retry runs `gh run rerun --failed`; without this the
+ # 403 was swallowed by `|| true` and the retry silently never happened.
+ actions: write
+
+concurrency:
+ group: e2e-android-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ resolve:
+ # The artifact wait lives in its OWN job: pr_test_build runs the app build
+ # AND integration tests (~90min), and keeping the wait in the suite job
+ # blew GitHub's 4h job cap before the suite even started.
+ if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.fork == false
+ runs-on: ${{ inputs.runs_on || 'ubuntu-latest' }}
+ # REPORT-ONLY (a red step must not block; never a required check).
+ continue-on-error: true
+ timeout-minutes: 215
+ outputs:
+ run_id: ${{ steps.resolve.outputs.run_id }}
+ steps:
+ - name: Resolve and download the build artifact
+ id: resolve
+ # Criterion = OWNING an x86_64 APK artifact ("<branch>_x86.apk"; "android apk" on older runs); the run's conclusion can
+ # be failure after the upload (learned on the 6.5.0 RC). No dev fallback.
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ set -euo pipefail
+ RUN_ID="${{ inputs.build_run }}"
+ if [ -z "$RUN_ID" ]; then
+ SHA="${{ github.event.pull_request.head.sha || github.sha }}"
+ RERUN_TRIED=0
+ LOG_TRIES=0
+ # The e2e lane starts in parallel with pr_test_build — WAIT for a
+ # run that owns the artifact instead of racing it (learned on
+ # PR #3700's first attempt). It gives up at the deadline below or
+ # as soon as it can tell no artifact is coming.
+ DEADLINE=$(( $(date +%s) + 11400 )) # builds observed 60-190min; job timeout is 210min
+ while :; do
+ RUNS=$(gh api "repos/${{ github.repository }}/actions/workflows/pr_test_build_android.yml/runs?head_sha=${SHA}&per_page=10" --jq '.workflow_runs[] | "\(.id) \(.status) \(.conclusion // "running")"') || {
+ # A failed API call is a blip, not "no build": wait and ask again until the deadline.
+ if [ "$(date +%s)" -ge "$DEADLINE" ]; then echo "::error::timed out waiting for the pr_test_build artifact for ${SHA}"; exit 1; fi
+ echo "::warning::listing pr_test_build runs failed; retrying"
+ sleep 30
+ continue
+ }
+ ALL_FINISHED=1
+ while read -r id status conclusion; do
+ [ -z "$id" ] && continue
+ [ "$status" = "completed" ] || ALL_FINISHED=0
+ if [ "$(gh api "repos/${{ github.repository }}/actions/runs/${id}/artifacts" --jq '[.artifacts[] | select(.expired == false) | .name | select(. == "android apk" or endswith("_x86.apk"))] | length > 0')" = "true" ]; then
+ RUN_ID=$id
+ break
+ fi
+ done <<< "$RUNS"
+ [ -n "$RUN_ID" ] && break
+ if [ "$ALL_FINISHED" = "1" ] && [ -n "$RUNS" ]; then
+ NEWEST=$(echo "$RUNS" | head -n 1 | awk '{print $1}')
+ # The failed log can lag the run's completion: an empty or failed download is retried, not read as "not the flake".
+ FAILED_LOG=""
+ if [ "$RERUN_TRIED" -eq 0 ]; then
+ FAILED_LOG=$(gh run view "$NEWEST" --log-failed -R "${{ github.repository }}" 2>/dev/null || true)
+ if [ -z "$FAILED_LOG" ] && [ "$LOG_TRIES" -lt 5 ]; then
+ LOG_TRIES=$((LOG_TRIES + 1))
+ sleep 30
+ continue
+ fi
+ fi
+ if [ "$RERUN_TRIED" -eq 0 ] && grep -q 'IncrementalSplitterRunnable' <<< "$FAILED_LOG"; then
+ echo "::warning::pr_test_build for ${SHA} hit the gradle packageRelease/IncrementalSplitterRunnable flake — retrying its failed jobs once"
+ gh run rerun "$NEWEST" --failed -R "${{ github.repository }}" || true
+ RERUN_TRIED=1
+ else
+ echo "::error::pr_test_build for ${SHA} finished without an x86_64 APK artifact and it is not the packageRelease flake, or its one retry already ran (no dev fallback, per handoff)"
+ exit 1
+ fi
+ elif [ -z "$RUNS" ] && [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
+ echo "::error::no pr_test_build run for ${SHA}; pass build_run or dispatch on a branch with an open PR"
+ exit 1
+ fi
+ if [ "$(date +%s)" -ge "$DEADLINE" ]; then
+ echo "::error::timed out waiting for the pr_test_build artifact for ${SHA}"
+ exit 1
+ fi
+ sleep 30
+ done
+ fi
+ if [ -z "$RUN_ID" ]; then
+ echo "::error::no pr_test_build run with an x86_64 APK artifact for this ref (no dev fallback, per handoff)"
+ exit 1
+ fi
+ echo "BUILD_RUN=$RUN_ID" >> "$GITHUB_ENV"
+ ART=$(gh api "repos/${{ github.repository }}/actions/runs/${RUN_ID}/artifacts" --jq '[.artifacts[] | select(.expired == false) | .name | select(. == "android apk" or endswith("_x86.apk"))][0] // empty')
+ [ -n "$ART" ] || { echo "::error::run ${RUN_ID} has no x86_64 APK artifact"; exit 1; }
+ gh run download "$RUN_ID" -n "$ART" -D apk -R "${{ github.repository }}"
+ # The build names the x86_64 APK after its branch (<branch>_x86.apk); the suite installs one fixed name.
+ [ -f apk/app-x86_64-release.apk ] || mv "$(ls apk/*_x86.apk | head -n 1)" apk/app-x86_64-release.apk
+ test -f apk/app-x86_64-release.apk || { echo "::error::app-x86_64-release.apk missing from artifact"; exit 1; }
+ echo "run_id=$RUN_ID" >> "$GITHUB_OUTPUT"
+
+
+ - name: Hand the APK to the suite job
+ uses: actions/upload-artifact@v4
+ with:
+ name: e2e-apk
+ path: apk/
+ if-no-files-found: error
+
+ e2e:
+ needs: resolve
+ # Suite only when resolve handed us an artifact (its run_id output).
+ if: >-
+ needs.resolve.outputs.run_id != '' &&
+ (github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.fork == false)
+ runs-on: ${{ inputs.runs_on || 'ubuntu-latest' }}
+ environment: qa
+ # REPORT-ONLY, permanently until Seth says otherwise.
+ continue-on-error: true
+ timeout-minutes: 210
+ steps:
+ - name: Checkout the QA project (cake-qa, via deploy key)
+ uses: actions/checkout@v4
+ with:
+ repository: cake-tech/cake-qa
+ ref: ${{ inputs.qa_ref || 'main' }}
+ path: cake-qa
+ ssh-key: ${{ secrets.QA_DEPLOY_KEY }}
+ persist-credentials: false
+
+ - name: Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: "26"
+ cache: npm
+ cache-dependency-path: cake-qa/package-lock.json
+
+ - name: Install the QA project
+ working-directory: cake-qa
+ run: npm ci
+
+ - name: Download the build artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: e2e-apk
+ path: apk
+
+ # Hosted runners need the udev rule or the action falls back to
+ # -accel off (software emulation): 12-minute boots and the adb daemon
+ # wedging under CPU load (three CI failures: 'Daemon request timed out').
+ - name: Enable KVM
+ run: |
+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
+ sudo udevadm control --reload-rules
+ sudo udevadm trigger --name-match=kvm
+ ls -la /dev/kvm
+
+ - name: Boot the emulator and run the no-funds slice
+ uses: reactivecircus/android-emulator-runner@v2
+ env:
+ GLM_BASE_URL: https://llm.cakewallet.com/v1
+ GLM_API_KEY: ${{ secrets.LLM_API_KEY || secrets.DSPARK_API_KEY }}
+ E2E_SECRET_SEED_BTC: ${{ secrets.E2E_SECRET_SEED_BTC }}
+ E2E_SECRET_SEED_SOL: ${{ secrets.E2E_SECRET_SEED_SOL }}
+ E2E_SECRET_SEED_XMR: ${{ secrets.E2E_SECRET_SEED_XMR }}
+ E2E_SECRET_SEED_NANO: ${{ secrets.E2E_SECRET_SEED_NANO }}
+ with:
+ api-level: 34
+ target: google_apis
+ arch: x86_64
+ # hosted runners booted in 764s once and blew the 600s default on
+ # the next run; 20min removes the flake, 4 cores shorten the boot.
+ emulator-boot-timeout: 1200
+ cores: 4
+ force-avd-creation: false
+ emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -read-only -memory 4096 -no-snapshot-save
+ # The handoff pins animations off, but NOT via the action's own
+ # step: after a slow boot (764s observed) its `settings put` dies
+ # with "Broken pipe" and the action tears the emulator down
+ # (adb exit 224). The script settles first and sets the three
+ # animation scales itself.
+ disable-animations: false
+ # NOTE: the action's parseScript() runs EACH LINE as its own
+ # `/usr/bin/sh -c` (dash): no bashisms, no multi-line constructs,
+ # and `set -eu` on its own line has no effect on the others.
+ script: |
+ i=0; until adb shell settings get global window_animation_scale >/dev/null 2>&1; do i=$((i+1)); if [ "$i" -ge 60 ]; then break; fi; sleep 10; done
+ adb shell settings put global window_animation_scale 0 || true
+ adb shell settings put global transition_animation_scale 0 || true
+ adb shell settings put global animator_duration_scale 0 || true
+ adb install -r apk/app-x86_64-release.apk
+ nohup node cake-qa/tools/glm-proxy.mjs > "$RUNNER_TEMP/glm-proxy.log" 2>&1 &
+ sleep 2
+ adb kill-server; adb start-server; i=0; until adb shell true >/dev/null 2>&1; do i=$((i+1)); if [ "$i" -ge 30 ]; then break; fi; sleep 2; done
+ CW_PACKAGE=$(adb shell pm list packages | tr -d '\r' | sed -n 's/^package://p' | grep -m1 'com\.cakewallet\.test'); [ -n "$CW_PACKAGE" ] || exit 1; SUITE="${{ inputs.suite || 'tests/generated/no-funds.e2e.ts' }}"; GREP="${{ inputs.grep }}"; if [ -n "${{ inputs.shard }}" ]; then cd cake-qa && CW_PACKAGE="$CW_PACKAGE" node node_modules/.bin/e2e run --target pixel "$SUITE" --reporter list,junit,markdown ${GREP:+--grep} ${GREP:+"$GREP"} --shard "${{ inputs.shard }}"; else cd cake-qa && CW_PACKAGE="$CW_PACKAGE" node node_modules/.bin/e2e run --target pixel "$SUITE" --reporter list,junit,markdown ${GREP:+--grep} ${GREP:+"$GREP"}; fi
+
+ - name: Redact seed-like word runs from the results
+ id: redact
+ if: always()
+ run: node cake-qa/tools/qa/redact.mjs cake-qa/.e2e
+
+ - name: Upload results
+ if: always() && steps.redact.outcome == 'success'
+ uses: actions/upload-artifact@v4
+ with:
+ name: e2e-results
+ path: |
+ cake-qa/.e2e/junit.xml
+ cake-qa/.e2e/summary.md
+ if-no-files-found: warn
+
+ - name: Encrypt the agent trace and screenshots
+ if: always() && steps.redact.outcome == 'success'
+ working-directory: cake-qa/.e2e
+ env:
+ QA_ARTIFACT_PASSPHRASE: ${{ secrets.QA_ARTIFACT_PASSPHRASE }}
+ run: |
+ [ -n "$QA_ARTIFACT_PASSPHRASE" ] || exit 0
+ FILES=$(ls -d report.json artifacts 2>/dev/null || true)
+ [ -n "$FILES" ] || exit 0
+ tar czf - $FILES | openssl enc -aes-256-cbc -pbkdf2 -salt -pass env:QA_ARTIFACT_PASSPHRASE -out "$RUNNER_TEMP/e2e-trace.tgz.enc"
+
+ - name: Upload the encrypted trace
+ if: always() && steps.redact.outcome == 'success'
+ uses: actions/upload-artifact@v4
+ with:
+ name: e2e-trace
+ path: ${{ runner.temp }}/e2e-trace.tgz.enc
+ if-no-files-found: ignore
+
+ - name: PR comment with counts, cost and cache hit rate
+ # A cancelled run has no summary and must not overwrite the last real result.
+ if: ${{ !cancelled() && github.event_name == 'pull_request' }}
+ uses: actions/github-script@v7
+ with:
+ script: |
+ const fs = require('fs');
+ const marker = '<!-- qa-e2e-android -->';
+ let body = '_the run produced no summary (see the e2e-results artifact)_';
+ try {
+ const md = fs.readFileSync('cake-qa/.e2e/summary.md', 'utf8');
+ const lines = md.split('\n').slice(0, 6).join('\n'); // counts + AI/cost line
+ body = `${marker}\n#### QA e2e (report-only lane)\n\n${lines}\n\nArtifact: this run's \`e2e-results\`.`;
+ } catch (e) {
+ body = `${marker}\n#### QA e2e (report-only lane)\n\n_summary.md missing (${e.message}) — see the \`e2e-results\` artifact._`;
+ }
+ const { owner, repo } = context.repo;
+ const issue_number = context.payload.pull_request.number;
+ const { data: comments } = await github.rest.issues.listComments({ owner, repo, issue_number, per_page: 100 });
+ const prev = comments.find((c) => c.body && c.body.includes(marker));
+ if (prev) {
+ await github.rest.issues.updateComment({ owner, repo, comment_id: prev.id, body });
+ } else {
+ await github.rest.issues.createComment({ owner, repo, issue_number, body });
+ }
### .github/workflows/e2e_cache_nightly.yml
@@ -0,0 +1,186 @@
+# Nightly replay-cache refresh (QA handoff §6 4-c).
+# Builds dev, runs the no-funds slice against that APK with cache READ-WRITE,
+# then pushes the refreshed .e2e/cache to a `nightly/*` branch in cake-qa;
+# cake-qa's own "Open cache-refresh PR" workflow (same-repo GITHUB_TOKEN)
+# opens the PR. CI PR lanes stay read-only — only this job records.
+name: E2E cache nightly
+
+on:
+ schedule:
+ - cron: "0 3 * * *"
+ workflow_dispatch:
+ inputs:
+ runs_on:
+ description: "runner label"
+ type: string
+ default: ubuntu-latest
+
+permissions:
+ contents: read
+
+concurrency:
+ group: e2e-cache-nightly
+ cancel-in-progress: false
+
+jobs:
+ build:
+ permissions:
+ contents: read
+ packages: write
+ uses: ./.github/workflows/reusable-build.yml
+ with:
+ ref: ${{ github.sha }}
+ pr_number: ${{ github.ref_name }}
+ secrets: inherit
+
+ refresh:
+ needs: build
+ # The APK is uploaded before the build's own integration tests run, so a red test there must not skip the night.
+ if: ${{ !cancelled() }}
+ runs-on: ${{ inputs.runs_on || 'ubuntu-latest' }}
+ # qa-nightly holds the only key that can write to cake-qa; it is limited to dev.
+ environment: qa-nightly
+ # Report-only family: a red night must not page anyone (handoff §9).
+ continue-on-error: true
+ timeout-minutes: 150
+ steps:
+ - name: Checkout the QA project (cake-qa)
+ uses: actions/checkout@v4
+ with:
+ repository: cake-tech/cake-qa
+ path: cake-qa
+ ssh-key: ${{ secrets.QA_DEPLOY_KEY }}
+ persist-credentials: false
+
+ - name: Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: "26"
+ cache: npm
+ cache-dependency-path: cake-qa/package-lock.json
+
+ - name: Install the QA project
+ working-directory: cake-qa
+ run: npm ci
+
+ - name: Download this run's x86_64 APK
+ uses: actions/download-artifact@v4
+ with:
+ pattern: "*_x86.apk"
+ path: apk
+ merge-multiple: true
+
+ - name: Give the APK the name the suite installs
+ run: |
+ set -euo pipefail
+ mv "$(ls apk/*_x86.apk | head -n 1)" apk/app-x86_64-release.apk
+ echo "BUILD_RUN=${{ github.run_id }}" >> "$GITHUB_ENV"
+
+ # Hosted runners need the udev rule or the action falls back to
+ # -accel off (software emulation): 12-minute boots and the adb daemon
+ # wedging under CPU load (three CI failures: 'Daemon request timed out').
+ - name: Enable KVM
+ run: |
+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
+ sudo udevadm control --reload-rules
+ sudo udevadm trigger --name-match=kvm
+ ls -la /dev/kvm
+
+ - name: Boot the emulator and record the cache (read-write)
+ id: record
+ uses: reactivecircus/android-emulator-runner@v2
+ env:
+ GLM_BASE_URL: https://llm.cakewallet.com/v1
+ GLM_API_KEY: ${{ secrets.LLM_API_KEY || secrets.DSPARK_API_KEY }}
+ E2E_SECRET_SEED_BTC: ${{ secrets.E2E_SECRET_SEED_BTC }}
+ E2E_SECRET_SEED_SOL: ${{ secrets.E2E_SECRET_SEED_SOL }}
+ E2E_SECRET_SEED_XMR: ${{ secrets.E2E_SECRET_SEED_XMR }}
+ E2E_SECRET_SEED_NANO: ${{ secrets.E2E_SECRET_SEED_NANO }}
+ # the one override this lane exists for:
+ QA_CACHE_MODE: read-write
+ with:
+ api-level: 34
+ target: google_apis
+ arch: x86_64
+ # hosted runners booted in 764s once and blew the 600s default on
+ # the next run; 20min removes the flake, 4 cores shorten the boot.
+ emulator-boot-timeout: 1200
+ cores: 4
+ force-avd-creation: false
+ emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -read-only -memory 3072 -no-snapshot-save
+ disable-animations: false
+ # parseScript(): one sh -c (dash) per line — no bashisms, no loops
+ # spanning lines, no reliance on `set -eu` persisting.
+ script: |
+ i=0; until adb shell settings get global window_animation_scale >/dev/null 2>&1; do i=$((i+1)); if [ "$i" -ge 60 ]; then break; fi; sleep 10; done
+ adb shell settings put global window_animation_scale 0 || true
+ adb shell settings put global transition_animation_scale 0 || true
+ adb shell settings put global animator_duration_scale 0 || true
+ adb install -r apk/app-x86_64-release.apk
+ nohup node cake-qa/tools/glm-proxy.mjs > "$RUNNER_TEMP/glm-proxy.log" 2>&1 &
+ sleep 2
+ adb kill-server; adb start-server; i=0; until adb shell true >/dev/null 2>&1; do i=$((i+1)); if [ "$i" -ge 30 ]; then break; fi; sleep 2; done
+ CW_PACKAGE=$(adb shell pm list packages | tr -d '\r' | sed -n 's/^package://p' | grep -m1 'com\.cakewallet\.test'); [ -n "$CW_PACKAGE" ] || exit 1; cd cake-qa && CW_PACKAGE="$CW_PACKAGE" node node_modules/.bin/e2e run --target pixel tests/generated/no-funds.e2e.ts --reporter list,junit,markdown
+
+ - name: Redact seed-like word runs from the results
+ id: redact
+ if: always()
+ run: |
+ # Redact copies: the recorded cache under .e2e must be pushed as recorded.
+ mkdir -p "$RUNNER_TEMP/results"
+ cp cake-qa/.e2e/junit.xml cake-qa/.e2e/summary.md cake-qa/.e2e/report.json "$RUNNER_TEMP/results/" 2>/dev/null || true
+ node cake-qa/tools/qa/redact.mjs "$RUNNER_TEMP/results"
+
+ - name: Upload results
+ if: always() && steps.redact.outcome == 'success'
+ uses: actions/upload-artifact@v4
+ with:
+ name: e2e-nightly-results
+ path: |
+ ${{ runner.temp }}/results/junit.xml
+ ${{ runner.temp }}/results/summary.md
+ if-no-files-found: warn
+
+ - name: Encrypt the agent trace and screenshots
+ if: always() && steps.redact.outcome == 'success'
+ working-directory: ${{ runner.temp }}/results
+ env:
+ QA_ARTIFACT_PASSPHRASE: ${{ secrets.QA_ARTIFACT_PASSPHRASE }}
+ run: |
+ [ -n "$QA_ARTIFACT_PASSPHRASE" ] || exit 0
+ FILES=$(ls -d report.json 2>/dev/null || true)
+ [ -n "$FILES" ] || exit 0
+ tar czf - $FILES | openssl enc -aes-256-cbc -pbkdf2 -salt -pass env:QA_ARTIFACT_PASSPHRASE -out "$RUNNER_TEMP/e2e-nightly-trace.tgz.enc"
+
+ - name: Upload the encrypted trace
+ if: always() && steps.redact.outcome == 'success'
+ uses: actions/upload-artifact@v4
+ with:
+ name: e2e-nightly-trace
+ path: ${{ runner.temp }}/e2e-nightly-trace.tgz.enc
+ if-no-files-found: ignore
+
+ - name: Push the refreshed cache to a nightly branch
+ if: always() && steps.record.outcome == 'success'
+ working-directory: cake-qa
+ env:
+ QA_DEPLOY_KEY: ${{ secrets.QA_DEPLOY_KEY }}
+ run: |
+ set -euo pipefail
+ # The write key exists on disk only for this step, after the suite and npm have finished.
+ KEY=$(mktemp); HOSTS=$(mktemp); trap 'rm -f "$KEY" "$HOSTS"' EXIT
+ printf '%s\n' "$QA_DEPLOY_KEY" > "$KEY"
+ echo "github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl" > "$HOSTS"
+ export GIT_SSH_COMMAND="ssh -i $KEY -o IdentitiesOnly=yes -o UserKnownHostsFile=$HOSTS -o StrictHostKeyChecking=yes"
+ BRANCH="nightly/cache-$(date -u +%Y%m%d)-${{ github.run_id }}-${{ github.run_attempt }}"
+ git config user.name "qa-nightly-bot"
+ git config user.email "qa-nightly-bot@users.noreply.github.com"
+ git checkout -B "$BRANCH"
+ git add -f .e2e/cache
+ if git diff --cached --quiet; then
+ echo "cache unchanged — no PR needed"
+ exit 0
+ fi
+ git commit -m "nightly: refresh replay cache from dev (build run ${{ env.BUILD_RUN }})"
+ git push git@github.com:cake-tech/cake-qa.git "HEAD:refs/heads/$BRANCH"
+ echo "pushed $BRANCH — cake-qa's PR workflow will open the PR"
### .github/workflows/e2e_ios.yml
@@ -0,0 +1,213 @@
+# Layer-B e2e lane, iOS (QA handoff §6 4-b). REPORT-ONLY like the Android lane
+# (continue-on-error at job level; never a required check).
+#
+# Both jobs run in throwaway VMs (cake-tech/mac-ci-runner): each gets a fresh
+# macOS VM that reaches the internet and nothing else, deleted when the job ends.
+# build builds this ref's simulator app. No environment, no secrets.
+# e2e installs that app and runs the suite with the qa secrets. It never
+# checks out or builds this repository's code.
+name: E2E (iOS)
+
+on:
+ workflow_dispatch:
+ inputs:
+ shard:
+ description: "e.g. 2/3 (empty = single run)"
+ type: string
+ default: ""
+ qa_ref:
+ description: "cake-qa git ref to test (empty = that repo's default branch)"
+ type: string
+ default: ""
+ suite:
+ description: "test file/glob to run (empty = the no-funds slice)"
+ type: string
+ default: ""
+ grep:
+ description: "only tests whose title matches this regular expression (empty = all)"
+ type: string
+ default: ""
+
+permissions:
+ contents: read
+
+concurrency:
+ group: e2e-ios-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ build:
+ runs-on: [self-hosted, cake-m5-ultra]
+ # REPORT-ONLY, permanently until Seth says otherwise.
+ continue-on-error: true
+ timeout-minutes: 90
+ outputs:
+ built: ${{ steps.pack.outputs.built }}
+ steps:
+ - name: Checkout the app
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+
+ # Same protoc as pr_test_build_ios.yml: the Rust pods' build scripts need it.
+ - name: Install protoc
+ env:
+ PROTOC_VERSION: "35.1"
+ run: |
+ set -euo pipefail
+ curl -sSL --retry 3 --retry-delay 5 -o "$RUNNER_TEMP/protoc.zip" \
+ "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-osx-universal_binary.zip"
+ unzip -q -o "$RUNNER_TEMP/protoc.zip" -d "$RUNNER_TEMP/protoc"
+ echo "$RUNNER_TEMP/protoc/bin" >> "$GITHUB_PATH"
+ "$RUNNER_TEMP/protoc/bin/protoc" --version
+
+ - name: Build the simulator app
+ env:
+ GIT_CONFIG_COUNT: "2"
+ GIT_CONFIG_KEY_0: user.email
+ GIT_CONFIG_VALUE_0: ci@example.invalid
+ GIT_CONFIG_KEY_1: user.name
+ GIT_CONFIG_VALUE_1: CI
+ run: bash scripts/ci/ios_sim_build.sh "$GITHUB_WORKSPACE"
+
+ - name: Pack the app
+ id: pack
+ run: |
+ tar -C build/ios/iphonesimulator -czf "$RUNNER_TEMP/Runner.app.tgz" Runner.app
+ echo "built=true" >> "$GITHUB_OUTPUT"
+
+ - name: Hand the app to the suite job
+ uses: actions/upload-artifact@v4
+ with:
+ name: e2e-ios-app
+ path: ${{ runner.temp }}/Runner.app.tgz
+ if-no-files-found: error
+ retention-days: 3
+
+ e2e:
+ needs: build
+ # build is report-only, so it "succeeds" even when it fails: run only when it handed over an app.
+ if: needs.build.outputs.built == 'true'
+ runs-on: [self-hosted, cake-m5-ultra]
+ environment: qa
+ # REPORT-ONLY, permanently until Seth says otherwise.
+ continue-on-error: true
+ timeout-minutes: 180
+ steps:
+ - name: Checkout the QA project (cake-qa, via deploy key)
+ uses: actions/checkout@v4
+ with:
+ repository: cake-tech/cake-qa
+ ref: ${{ inputs.qa_ref || 'main' }}
+ path: cake-qa
+ ssh-key: ${{ secrets.QA_DEPLOY_KEY }}
+ persist-credentials: false
+
+ - name: Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: "26"
+
+ - name: Install the QA project
+ working-directory: cake-qa
+ run: npm ci
+
+ - name: Download the app
+ uses: actions/download-artifact@v4
+ with:
+ name: e2e-ios-app
+ path: ${{ runner.temp }}
+
+ - name: Unpack the app
+ run: |
+ mkdir -p app
+ tar -C app -xzf "$RUNNER_TEMP/Runner.app.tgz"
+ test -d app/Runner.app
+
+ - name: Simulator runtime
+ # The VM template carries Xcode but no simulator runtime.
+ run: |
+ set -euo pipefail
+ available() {
+ xcrun simctl list runtimes -j | python3 -c "
+ import json,sys
+ sys.exit(0 if any(r.get('platform')=='iOS' and r.get('isAvailable') for r in json.load(sys.stdin)['runtimes']) else 1)"
+ }
+ available || xcodebuild -downloadPlatform iOS
+ available
+
+ - name: Boot the simulator and install
+ run: |
+ set -euo pipefail
+ read -r RUNTIME DEVICE_TYPE < <(xcrun simctl list runtimes -j | python3 -c "
+ import json,re,sys
+ rts=[r for r in json.load(sys.stdin)['runtimes'] if r.get('platform')=='iOS' and r.get('isAvailable',True)]
+ rts.sort(key=lambda r: [int(x) for x in r['version'].split('.')])
+ rt=rts[-1]
+ ds=[d for d in rt['supportedDeviceTypes'] if d.get('productFamily')=='iPhone']
+ pick=([d for d in ds if re.fullmatch(r'iPhone \\d+ Pro', d['name'])] or [d for d in ds if re.fullmatch(r'iPhone \\d+', d['name'])] or ds)[-1]
+ print(rt['identifier'], pick['identifier'])")
+ echo "runtime=$RUNTIME device=$DEVICE_TYPE"
+ UDID=$(xcrun simctl create qa-e2e "$DEVICE_TYPE" "$RUNTIME")
+ echo "UDID=$UDID" >> "$GITHUB_ENV"
+ xcrun simctl bootstatus "$UDID" -b
+ xcrun simctl install "$UDID" app/Runner.app
+
+ - name: Run the no-funds slice
+ working-directory: cake-qa
+ env:
+ GLM_BASE_URL: https://llm.cakewallet.com/v1
+ GLM_API_KEY: ${{ secrets.LLM_API_KEY || secrets.DSPARK_API_KEY }}
+ E2E_SECRET_SEED_BTC: ${{ secrets.E2E_SECRET_SEED_BTC }}
+ E2E_SECRET_SEED_SOL: ${{ secrets.E2E_SECRET_SEED_SOL }}
+ E2E_SECRET_SEED_XMR: ${{ secrets.E2E_SECRET_SEED_XMR }}
+ E2E_SECRET_SEED_NANO: ${{ secrets.E2E_SECRET_SEED_NANO }}
+ CW_IOS_DEVICE: qa-e2e
+ CW_IOS_APP: ${{ github.workspace }}/app/Runner.app
+ SUITE: ${{ inputs.suite || 'tests/generated/no-funds.e2e.ts' }}
+ GREP: ${{ inputs.grep }}
+ SHARD: ${{ inputs.shard }}
+ run: |
+ set -euo pipefail
+ nohup node tools/glm-proxy.mjs > "$RUNNER_TEMP/glm-proxy.log" 2>&1 &
+ sleep 2
+ ARGS=(--target sim --reporter "list,junit,markdown")
+ if [ -n "$SHARD" ]; then ARGS+=(--shard "$SHARD"); fi
+ if [ -n "$GREP" ]; then ARGS+=(--grep "$GREP"); fi
+ # node directly, not npx: npm rewrites its process title and on macOS the overflow
+ # exposes the job's environment (the wallet seeds) to `ps`.
+ node node_modules/.bin/e2e run "$SUITE" "${ARGS[@]}"
+
+ - name: Redact seed-like word runs from the results
+ id: redact
+ if: always()
+ run: node cake-qa/tools/qa/redact.mjs cake-qa/.e2e
+
+ - name: Upload results
+ if: always() && steps.redact.outcome == 'success'
+ uses: actions/upload-artifact@v4
+ with:
+ name: e2e-results-ios
+ path: |
+ cake-qa/.e2e/junit.xml
+ cake-qa/.e2e/summary.md
+ if-no-files-found: warn
+
+ - name: Encrypt the agent trace and screenshots
+ if: always() && steps.redact.outcome == 'success'
+ working-directory: cake-qa/.e2e
+ env:
+ QA_ARTIFACT_PASSPHRASE: ${{ secrets.QA_ARTIFACT_PASSPHRASE }}
+ run: |
+ [ -n "$QA_ARTIFACT_PASSPHRASE" ] || exit 0
+ FILES=$(ls -d report.json artifacts 2>/dev/null || true)
+ [ -n "$FILES" ] || exit 0
+ tar czf - $FILES | openssl enc -aes-256-cbc -pbkdf2 -salt -pass env:QA_ARTIFACT_PASSPHRASE -out "$RUNNER_TEMP/e2e-trace-ios.tgz.enc"
+
+ - name: Upload the encrypted trace
+ if: always() && steps.redact.outcome == 'success'
+ uses: actions/upload-artifact@v4
+ with:
+ name: e2e-trace-ios
+ path: ${{ runner.temp }}/e2e-trace-ios.tgz.enc
+ if-no-files-found: ignore
### scripts/ci/ios_sim_build.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+# Simulator build of the app for the iOS e2e lane (.github/workflows/e2e_ios.yml).
+# It needs no secrets: API keys are placeholders, so providers that need one are unavailable.
+#
+# Usage: scripts/ci/ios_sim_build.sh <path-to-cake_wallet>
+# Produces: build/ios/iphonesimulator/Runner.app (flutter --simulator --debug)
+set -euo pipefail
+
+WALLET="${1:?usage: ios_sim_build.sh <path-to-cake_wallet>}"
+cd "$WALLET"
+
+# A freshly cloned Flutter SDK has no engine packages (sky_engine) until a flutter command
+# fetches them; the `dart run` steps below would fail to resolve without this.
+flutter precache --ios
+
+# 0. torch_dart: cw_core depends on the Dart package at scripts/torch_dart. Clone it at the
+# pinned commit, then take the prebuilt LibTorch.xcframework from the upstream release:
+# it carries the ios-arm64-simulator slice, which the app's own CI images omit, and
+# building Tor from source on macOS is not workable.
+TORCH_RELEASE="v1.0.18"
+./scripts/prepare_torch.sh
+if [[ ! -d scripts/torch_dart/ios/LibTorch.xcframework/ios-arm64-simulator ]]; then
+ TMPT="$(mktemp -d)"
+ curl -fsSL "https://github.com/MrCyjaneK/torch_dart/releases/download/${TORCH_RELEASE}/torch_dart-${TORCH_RELEASE}.tar.gz" -o "$TMPT/torch.tgz"
+ mkdir -p "$TMPT/x" scripts/torch_dart/ios
+ tar -xzf "$TMPT/torch.tgz" -C "$TMPT/x" ./ios/LibTorch.xcframework
+ rm -rf scripts/torch_dart/ios/LibTorch.xcframework
+ mv "$TMPT/x/ios/LibTorch.xcframework" scripts/torch_dart/ios/LibTorch.xcframework
+ rm -rf "$TMPT"
+fi
+test -d scripts/torch_dart/ios/LibTorch.xcframework/ios-arm64-simulator
+
+# 1. monero_c source at the pinned commit (with patches applied).
+./scripts/prepare_moneroc.sh
+
+# 2. Prebuilt monero_c bundle (device + simulator dylibs), then the xcframeworks.
+# The zip's top directory is the tag, which is the layout gen_framework.sh reads
+# when MONEROC_TAG names it. Coins the bundle lacks are dropped from the Xcode
+# project the way the app's own CI does (their wallets fail to open; the build passes).
+MONEROC_TAG="v0.18.4.6-RC2"
+BUNDLE_URL="https://github.com/MrCyjaneK/monero_c/releases/download/${MONEROC_TAG}/release-bundle.zip"
+TMPB="$(mktemp -d)"
+if [[ ! -d "scripts/monero_c/release/${MONEROC_TAG}/aarch64-apple-ios-simulator" ]]; then
+ curl -fsSL "$BUNDLE_URL" -o "$TMPB/release-bundle.zip"
+ rm -rf "scripts/monero_c/release/${MONEROC_TAG}"
+ mkdir -p scripts/monero_c/release
+ unzip -qo "$TMPB/release-bundle.zip" -d scripts/monero_c/release
+fi
+test -d "scripts/monero_c/release/${MONEROC_TAG}/aarch64-apple-ios-simulator"
+( cd scripts/ios && MONEROC_TAG="$MONEROC_TAG" ./gen_framework.sh )
+test -d ios/MoneroWallet.xcframework
+for fw in WowneroWallet ZanoWallet; do
+ [[ -d "ios/${fw}.xcframework" ]] || sed -i '' -e "/${fw}\.xcframework/d" ios/Runner.xcodeproj/project.pbxproj
+done
+
+# 3. cw_decred for the SIMULATOR: the script hardcodes -target arm64-apple-ios
+# and the iphoneos SDK; patch a copy (script itself stays untouched).
+sed -e 's/arm64-apple-ios/arm64-apple-ios-simulator/g' \
+ -e 's/--sdk iphoneos/--sdk iphonesimulator/g' \
+ scripts/ios/build_decred.sh > scripts/ios/.build_decred_sim.sh
+( cd scripts/ios && bash .build_decred_sim.sh )
+rm -f scripts/ios/.build_decred_sim.sh
+
+# 4. cw_mweb for the SIMULATOR (supports it natively); then fix the ffigen
+# config the script's sed misses (pattern looks for mweb.h, the config says
+# libmweb.h) and regenerate bindings from the XCFramework header, restoring
+# the config afterwards.
+( cd scripts/ios && ./build_mwebd.sh --install )
+( cd cw_mweb
+ cp ffigen_config.yaml ffigen_config.yaml.ci.bak
+ sed -i '' -e "s|android/src/main/jniLibs/arm64-v8a/libmweb.h|ios/Mwebd.xcframework/ios-arm64/Mwebd.framework/Headers/Mwebd.h|" ffigen_config.yaml
+ dart run ffigen --config ffigen_config.yaml
+ mv ffigen_config.yaml.ci.bak ffigen_config.yaml )
+
+# 5. Configure the app the way the app's CI does: reown sources, placeholder API
+# secrets (the lane has none; providers that need a key are simply unavailable),
+# pubspec + per-coin configuration, generated code, localization, graphics.
+./scripts/prepare_reown.sh
+for p in cw_bitcoin cw_evm cw_solana cw_core cw_nano cw_tron; do touch "$p/lib/.secrets.g.dart"; done
+( cd scripts/ios
+ source ./app_env.sh cakewallet
+ ./app_config.sh )
+dart run tool/generate_new_secrets.dart
+add_secret() { grep -q "const $2 " "$1" 2>/dev/null || printf "const %s = '';\n" "$2" >> "$1"; }
+for k in polygonScanApiKey etherScanApiKey moralisApiKey nowNodesApiKey blinkApiKey alchemyApiKey; do add_secret cw_evm/lib/.secrets.g.dart "$k"; done
+for k in ankrApiKey chainStackApiKey moralisApiKey; do add_secret cw_solana/lib/.secrets.g.dart "$k"; done
+for k in nano2ApiKey nanoNowNodesApiKey; do add_secret cw_nano/lib/.secrets.g.dart "$k"; done
+for k in tronGridApiKey tronNowNodesApiKey; do add_secret cw_tron/lib/.secrets.g.dart "$k"; done
+add_secret cw_bitcoin/lib/.secrets.g.dart breezApiKey
+flutter pub get
+./model_generator.sh
+dart run tool/generate_localization.dart
+./compile_graphics.sh
+
+# 6. CocoaPods: homebrew's pod is broken (brew ruby 4.0 vs cellar gems) —
+# install into the user gem dir like P0-e did.
+if ! command -v pod >/dev/null 2>&1 || ! pod --version >/dev/null 2>&1; then
+ gem install --user-install cocoapods
+fi
+export PATH="$PATH:$(ruby -e 'print Gem.user_dir' 2>/dev/null)/bin"
+cd ios && pod install && cd ..
+
+# 7. The simulator build itself.
+flutter build ios --simulator --debug
+echo "simulator app: build/ios/iphonesimulator/Runner.app"Why this scored 27/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.