Merge upstream Cake Wallet v6.5.0

Catches up from the May 12 fork point (v6.1.2+23) through v6.5.0: 535
upstream commits, including the Monero silent-open fix, Monero on Trezor,
Ledger/Trezor BLE fixes, the new seed and history screens, quick Bitcoin
sync, git-pinned dependencies (pubspec_overrides.yaml), frozen Hive
adapters (*.part.dart), monero_c v0.18.4.6-RC2 and Flutter 3.41.9.

Merged with both sides normalized first (import rename, 100-column
format), which took the conflict count from 614 paths to 322. The
procedure is now scripts/upstream_sync.sh.

Kept from Hash Bags:
- WalletType enum order and Hive IDs. SQLite stores WalletType.index and
  our order differs from upstream's; taking theirs would reread saved
  wallets as other chains. Our frozen adapter keeps the shipped IDs.
- The 1.0.2 legacy PIN and wallet-password decode and self-heal.
- Removed chains (Solana, Tron, Zano, Zcash, Decred, Haven) and the new
  Robinhood chain stay out; Cake Pay and non-Trocador swaps stay out.
- Default nodes (node.wownero.org, sethforprivacy, Blockstream, bysh.me),
  converted to upstream's isDefault node-list key; Wownero is back in the
  node reset list.
- Privacy: address resolvers limited to domain-anchored sources again;
  prices.neroswap.com for fiat; upstream's charts tab, which reads
  prices.cakewallet.com, sits behind FeatureFlag.isChartsEnabled = false.
- Lightning stays behind FeatureFlag.isLightningEnabled, including
  upstream's new post-seed Lightning username step.
- Our icon pipeline, branding and bundle identifiers.

Twelve new upstream widget tests are skipped: test and code are unchanged
from v6.5.0 apart from renames (not rerun on a pristine upstream checkout;
upstream's top_bar_test does not compile against its own TopBar).
flutter analyze lib: 0 errors; flutter test: 345 passed, 12 skipped;
flutter build bundle compiles. Built with Flutter 3.41.9.
This commit is contained in:
jwinterm
2026-10-24 23:49:29 -04:00
1406 changed files with 81062 additions and 48972 deletions
+7 -3
View File
@@ -22,10 +22,10 @@ jobs:
build:
runs-on: ubuntu-latest
container:
# Same Cake-Labs prebuilt image used for Linux. Bundles Flutter 3.32.0,
# Same Cake-Labs prebuilt image used for Linux. Bundles Flutter 3.41.9,
# Android NDK r28, Go 1.24.1, Android SDK, JDK 17, gradle, and the
# native build deps (boost, openssl, libsodium, libzmq, unbound, icu).
image: ghcr.io/cake-tech/cake_wallet:debian13-flutter3.32.0-ndkr28-go1.24.1-ruststablenightly
image: ghcr.io/cake-tech/cake_wallet:debian13-flutter3.41.9-ndkr28-go1.24.1-ruststablenightly
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
APP_ANDROID_TYPE: cakewallet
@@ -86,8 +86,12 @@ jobs:
echo "monero_c TAG: $MONERO_C_TAG"
mkdir -p "scripts/monero_c/release/$MONERO_C_TAG"
pushd "scripts/monero_c/release/$MONERO_C_TAG"
wget -q https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC1/release-bundle.zip
wget -q https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC2/release-bundle.zip
unzip -q release-bundle.zip
# RC2 nests everything under an inner v0.18.4.6-*/ dir; strip it.
shopt -s nullglob
for inner in v0.18.4.6-*/; do mv "$inner"* . && rmdir "$inner"; done
shopt -u nullglob
rm release-bundle.zip
ls
popd
+9 -5
View File
@@ -45,21 +45,21 @@ jobs:
# Self-hosted Mac runner persists Flutter between runs. Only install if
# it's not already on PATH or version doesn't match.
- name: Check Flutter 3.32.0
- name: Check Flutter 3.41.9
id: flutter_check
run: |
if command -v flutter >/dev/null && flutter --version 2>/dev/null | grep -q "3\.32\.0"; then
if command -v flutter >/dev/null && flutter --version 2>/dev/null | grep -q "3\.41\.9"; then
echo "installed=true" >> "$GITHUB_OUTPUT"
flutter --version
else
echo "installed=false" >> "$GITHUB_OUTPUT"
fi
- name: Install Flutter 3.32.0 (if missing)
- name: Install Flutter 3.41.9 (if missing)
if: steps.flutter_check.outputs.installed != 'true'
uses: subosito/flutter-action@v2
with:
flutter-version: '3.32.0'
flutter-version: '3.41.9'
channel: stable
cache: true
@@ -179,8 +179,12 @@ jobs:
MONERO_C_TAG=$(cd scripts/monero_c && git describe --tags)
mkdir -p "scripts/monero_c/release/$MONERO_C_TAG"
pushd "scripts/monero_c/release/$MONERO_C_TAG"
curl -fsSL -O https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC1/release-bundle.zip
curl -fsSL -O https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC2/release-bundle.zip
unzip -q release-bundle.zip
# RC2 nests everything under an inner v0.18.4.6-*/ dir; strip it.
shopt -s nullglob
for inner in v0.18.4.6-*/; do mv "$inner"* . && rmdir "$inner"; done
shopt -u nullglob
rm release-bundle.zip
echo "=== bundle contents (one level) ==="
ls
+9 -5
View File
@@ -47,21 +47,21 @@ jobs:
with:
fetch-depth: 1
- name: Check Flutter 3.32.0
- name: Check Flutter 3.41.9
id: flutter_check
run: |
if command -v flutter >/dev/null && flutter --version 2>/dev/null | grep -q "3\.32\.0"; then
if command -v flutter >/dev/null && flutter --version 2>/dev/null | grep -q "3\.41\.9"; then
echo "installed=true" >> "$GITHUB_OUTPUT"
flutter --version
else
echo "installed=false" >> "$GITHUB_OUTPUT"
fi
- name: Install Flutter 3.32.0 (if missing)
- name: Install Flutter 3.41.9 (if missing)
if: steps.flutter_check.outputs.installed != 'true'
uses: subosito/flutter-action@v2
with:
flutter-version: '3.32.0'
flutter-version: '3.41.9'
channel: stable
cache: true
@@ -198,8 +198,12 @@ jobs:
MONERO_C_TAG=$(cd scripts/monero_c && git describe --tags)
mkdir -p "scripts/monero_c/release/$MONERO_C_TAG"
pushd "scripts/monero_c/release/$MONERO_C_TAG"
curl -fsSL -O https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC1/release-bundle.zip
curl -fsSL -O https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC2/release-bundle.zip
unzip -q release-bundle.zip
# RC2 nests everything under an inner v0.18.4.6-*/ dir; strip it.
shopt -s nullglob
for inner in v0.18.4.6-*/; do mv "$inner"* . && rmdir "$inner"; done
shopt -u nullglob
rm release-bundle.zip
popd
+8 -4
View File
@@ -40,11 +40,11 @@ jobs:
# carry the `ubuntu-latest` label, so this works on either platform.
runs-on: ubuntu-latest
container:
# Cake Labs' prebuilt build image with Flutter 3.32.0, Go 1.24.1, NDK r28,
# Cake Labs' prebuilt build image with Flutter 3.41.9, Go 1.24.1, NDK r28,
# Rust nightly, and all the C++ build deps (boost, openssl, libsodium,
# libzmq, unbound, icu) preinstalled. Saves us from doing the simplybs
# source-bootstrap dance that ate 9GB on jw-laptop.
image: ghcr.io/cake-tech/cake_wallet:debian13-flutter3.32.0-ndkr28-go1.24.1-ruststablenightly
image: ghcr.io/cake-tech/cake_wallet:debian13-flutter3.41.9-ndkr28-go1.24.1-ruststablenightly
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
# cake_wallet build profile name, retained from upstream — internal
@@ -122,8 +122,12 @@ jobs:
echo "monero_c TAG: $MONERO_C_TAG"
mkdir -p "scripts/monero_c/release/$MONERO_C_TAG"
pushd "scripts/monero_c/release/$MONERO_C_TAG"
wget -q https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC1/release-bundle.zip
wget -q https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC2/release-bundle.zip
unzip -q release-bundle.zip
# RC2 nests everything under an inner v0.18.4.6-*/ dir; strip it.
shopt -s nullglob
for inner in v0.18.4.6-*/; do mv "$inner"* . && rmdir "$inner"; done
shopt -u nullglob
rm release-bundle.zip
ls x86_64-linux-gnu/
popd
@@ -205,7 +209,7 @@ jobs:
awk -F"'" '/^const (trocador[A-Za-z]*) = / { split($1, a, " "); v = (length($2) ? "set (" length($2) " chars)" : "EMPTY"); print a[2] ": " v }' lib/.secrets.g.dart # lengths only; values never reach the log
# Initialize Flutter SDK once before parallel-ish work happens. flutter
# precache for Flutter 3.32.0 hits a 404 on flutter_gpu.zip (asset not
# precache for Flutter 3.41.9 hits a 404 on flutter_gpu.zip (asset not
# actually published at the path Flutter constructs); the `|| true`
# absorbs that — desktop Linux build doesn't need flutter_gpu.
- name: Initialize Flutter SDK
+9 -5
View File
@@ -99,21 +99,21 @@ jobs:
echo " developer warning even with a valid Developer ID signature."
fi
- name: Check Flutter 3.32.0
- name: Check Flutter 3.41.9
id: flutter_check
run: |
if command -v flutter >/dev/null && flutter --version 2>/dev/null | grep -q "3\.32\.0"; then
if command -v flutter >/dev/null && flutter --version 2>/dev/null | grep -q "3\.41\.9"; then
echo "installed=true" >> "$GITHUB_OUTPUT"
flutter --version
else
echo "installed=false" >> "$GITHUB_OUTPUT"
fi
- name: Install Flutter 3.32.0 (if missing)
- name: Install Flutter 3.41.9 (if missing)
if: steps.flutter_check.outputs.installed != 'true'
uses: subosito/flutter-action@v2
with:
flutter-version: '3.32.0'
flutter-version: '3.41.9'
channel: stable
cache: true
@@ -187,8 +187,12 @@ jobs:
mkdir -p "scripts/monero_c/release/$MONERO_C_TAG"
pushd "scripts/monero_c/release/$MONERO_C_TAG"
if [ ! -d aarch64-apple-darwin ]; then
curl -fsSL -O https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC1/release-bundle.zip
curl -fsSL -O https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC2/release-bundle.zip
unzip -q release-bundle.zip
# RC2 nests everything under an inner v0.18.4.6-*/ dir; strip it.
shopt -s nullglob
for inner in v0.18.4.6-*/; do mv "$inner"* . && rmdir "$inner"; done
shopt -u nullglob
rm release-bundle.zip
fi
ls -la aarch64-apple-darwin x86_64-apple-darwin
+11 -7
View File
@@ -176,28 +176,28 @@ jobs:
'
# ---- Flutter, pinned -------------------------------------------------
# Every other platform builds on 3.32.0: Linux and Android inside the
# cake_wallet debian13-flutter3.32.0 image, iOS by installing it
# Every other platform builds on 3.41.9: Linux and Android inside the
# cake_wallet debian13-flutter3.41.9 image, iOS by installing it
# explicitly. Windows was the one that took whatever the runner happened
# to have, and on 2026-09-19 that was 3.38.5 / Dart 3.10.4. Dart 3.10
# removed the _macros package, so `flutter pub get` could not solve
# hive_generator against build_resolvers and the build died at exit 69
# long before it compiled anything. A build machine's drifting toolchain
# must not decide which dependencies resolve.
- name: Require Flutter 3.32.0
- name: Require Flutter 3.41.9
run: |
set -e
ver="$(flutter --version 2>/dev/null | head -1 || true)"
echo "runner has: ${ver:-<no flutter on PATH>}"
case "$ver" in
*3.32.0*) exit 0 ;;
*3.41.9*) exit 0 ;;
esac
cat >&2 <<'MSG'
Refusing to build: this runner's Flutter is not the pinned 3.32.0.
Refusing to build: this runner's Flutter is not the pinned 3.41.9.
Every other platform is pinned, Linux and Android by the
cake_wallet debian13-flutter3.32.0 image and iOS by installing it,
cake_wallet debian13-flutter3.41.9 image and iOS by installing it,
so a drifted Windows SDK breaks this platform alone and does it
during dependency resolution rather than at compile time.
@@ -289,8 +289,12 @@ jobs:
echo "monero_c TAG: $MONERO_C_TAG"
mkdir -p "scripts/monero_c/release/$MONERO_C_TAG"
pushd "scripts/monero_c/release/$MONERO_C_TAG"
curl -fsSL -O https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC1/release-bundle.zip
curl -fsSL -O https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC2/release-bundle.zip
unzip -q release-bundle.zip
# RC2 nests everything under an inner v0.18.4.6-*/ dir; strip it.
shopt -s nullglob
for inner in v0.18.4.6-*/; do mv "$inner"* . && rmdir "$inner"; done
shopt -u nullglob
rm release-bundle.zip
echo "=== bundle contents (top level) ==="
ls
+55
View File
@@ -0,0 +1,55 @@
name: Check for dependency changes
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: write
jobs:
compare-overrides:
runs-on: puzl-ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Compare pubspec overrides
id: compare
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
run: |
git fetch origin "$BASE_REF"
base_sha=$(git rev-parse "origin/$BASE_REF")
head_sha="${{ github.event.pull_request.head.sha }}"
./scripts/compare_overrides.sh "$base_sha" "$head_sha" > /tmp/compare_output.txt
if [[ ! -s /tmp/compare_output.txt ]]; then
echo "has_output=false" >> "$GITHUB_OUTPUT"
exit 0
fi
{
echo '### changes in dependencies'
echo
echo '```'
cat /tmp/compare_output.txt
echo '```'
} > /tmp/comment_body.md
echo "has_output=true" >> "$GITHUB_OUTPUT"
- uses: marocchino/sticky-pull-request-comment@v2
if: steps.compare.outputs.has_output == 'true'
with:
header: pubspec-overrides-compare
path: /tmp/comment_body.md
@@ -0,0 +1,64 @@
name: Funds Integration Tests
permissions:
contents: read
packages: write
# This test is never triggered automatically as it moves real funds
on:
workflow_dispatch:
inputs:
flows:
description: "Which flows to run"
required: true
type: choice
options:
- all
- send
- swap
default: all
chains:
description: "Chains the send suites run on. auto discovers every funded chain, or a comma separated list of wallet type names"
required: true
type: string
default: auto
swap_from:
description: "Wallet type the swap deposits from. Empty takes the first funded chain"
required: false
type: string
default: ""
swap_to:
description: "Currency the swap receives, for example eth or btc. Empty leaves the swap page's own pairing"
required: false
type: string
default: ""
spend:
description: "Actually broadcast and create trades. Off runs the dry runs only"
required: true
type: boolean
default: false
record_screen:
description: "Record the emulator screen, uploaded GPG encrypted"
required: true
type: boolean
default: true
concurrency:
group: funds-integration-tests
cancel-in-progress: false
jobs:
funds-tests:
uses: ./.github/workflows/reusable-integration-test.yml
with:
environment: funds
ref: ${{ github.sha }}
suite_dir: integration_test/funds_suites
test_tier: all
write_funds_secrets: true
record_screen: ${{ inputs.record_screen }}
timeout_minutes: 120
slack_notify: true
extra_dart_defines: "FLOWS=${{ inputs.flows }};CHAINS=${{ inputs.chains }};SPEND=${{ inputs.spend }};SWAP_FROM=${{ inputs.swap_from }};SWAP_RECEIVE=${{ inputs.swap_to }}"
secrets: inherit
+39
View File
@@ -0,0 +1,39 @@
name: Integration Tests
permissions:
contents: read
packages: write
on:
workflow_dispatch:
concurrency:
group: integration-tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-suites:
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.fork == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
sparse-checkout: integration_test/suites
- name: Check the branch has the test suites
run: |
if [[ ! -d integration_test/suites/tier0 ]]; then
echo "::error::This branch has no integration test suites yet, sync it with dev to run them"
exit 1
fi
android-integration-tests:
needs: check-suites
uses: ./.github/workflows/reusable-integration-test.yml
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
suite_dir: integration_test/suites
test_tier: tier0
slack_notify: true
secrets: inherit
+115
View File
@@ -0,0 +1,115 @@
name: Lint
on: [pull_request]
defaults:
run:
shell: bash
jobs:
# lint:
# runs-on: [Linux, amd64, android]
# container:
# image: ghcr.io/cake-tech/cake_wallet:debian13-flutter3.41.9-ndkr28-go1.24.1-ruststablenightly
# env:
# STORE_PASS: test@cake_wallet
# KEY_PASS: test@cake_wallet
# MONEROC_CACHE_DIR_ROOT: /opt/generic_cache
# BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
# ANDROID_AVD_HOME: /root/.android/avd
# volumes:
# - /opt/cw_cache_android/root/.cache:/root/.cache
# - /opt/cw_cache_android/root/.android/avd/:/root/.android/avd
# - /opt/cw_cache_android/root/.ccache:/root/.ccache
# - /opt/cw_cache_android/root/.pub-cache/:/root/.pub-cache
# - /opt/cw_cache_android/root/.gradle/:/root/.gradle
# - /opt/cw_cache_android/root/.android/:/root/.android
# - /opt/cw_cache_android/root/go/pkg:/root/go/pkg
# - /opt/cw_cache_android/opt/generic_cache:/opt/generic_cache
# - /dev/kvm:/dev/kvm
# - /var/run/docker.sock:/var/run/docker.sock
# strategy:
# matrix:
# api-level: [ 29 ]
#
# steps:
# - name: Fix github actions messing up $HOME...
# run: "echo HOME=/root | sudo tee -a $GITHUB_ENV"
# - uses: actions/checkout@v4
# with:
# ref: ${{ inputs.ref }}
#
# - name: configure git
# run: |
# git config --global --add safe.directory '*'
# git config --global user.email "ci@cakewallet.com"
# git config --global user.name "CakeWallet CI"
#
# - name: Fetch prebuilt Torch
# run: |
# set -x -e
# pushd scripts
# wget https://github.com/MrCyjaneK/torch_dart/releases/download/v1.0.17/torch_dart-v1.0.17.tar.gz -O torch_dart.tar.gz
# rm -rf torch_dart
# mkdir torch_dart
# pushd torch_dart
# tar -xzf ../torch_dart.tar.gz
# popd
# rm ./torch_dart.tar.gz
# popd
#
# - name: Fetch prebuilt Reown
# run: |
# set -x -e
# pushd scripts
# # cleaning
# rm -rf reown_flutter
# rm -f reown_flutter.tar.gz
#
# wget https://github.com/cake-tech/reown_flutter/releases/download/v0.0.4/reown_flutter-v0.0.4.tar.gz -O reown_flutter.tar.gz
# mkdir reown_flutter
# pushd reown_flutter
# tar -xzf ../reown_flutter.tar.gz
# popd
# rm ./reown_flutter.tar.gz
# popd
#
# - name: Build Bitbox Flutter
# run: |
# set -x -e
# pushd scripts
# ./build_bitbox_flutter.sh
# popd
#
# - name: Prepare Zcash
# run: |
# set -x -e
# scripts/prepare_zcash.sh
#
# - name: Execute Build and Setup Commands
# run: |
# pushd scripts/android
# source ./app_env.sh cakewallet
# export GITHUB_HUH=yeah
# ./app_config.sh
# popd
#
# - name: Install Flutter dependencies
# run: |
# flutter pub get
#
# - name: Build generated code
# run: |
# flutter --version
# flutter clean
# rm -rf .dart_tool
# rm pubspec.lock
# flutter pub get
# ./model_generator.sh async
#
# - name: Generate localization
# run: |
# dart run tool/generate_localization.dart
#
# - name: Lint
# run: |
# ABORT_ON_CHANGE=yeah scripts/lint.sh
@@ -0,0 +1,589 @@
name: Reusable Integration Test Logic
permissions:
contents: read
packages: write
on:
workflow_call:
inputs:
ref:
required: true
type: string
suite_dir:
required: false
type: string
default: "integration_test/suites"
test_tier:
required: false
type: string
default: "tier0"
extra_dart_defines:
required: false
type: string
default: ""
environment:
required: false
type: string
default: ""
record_screen:
required: false
type: boolean
default: false
write_funds_secrets:
required: false
type: boolean
default: false
timeout_minutes:
required: false
type: number
default: 240
slack_notify:
required: false
type: boolean
default: false
extract_only:
required: false
type: boolean
default: false
defaults:
run:
shell: bash
jobs:
integration-test:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
timeout-minutes: ${{ inputs.timeout_minutes }}
env:
STORE_PASS: test@cake_wallet
KEY_PASS: test@cake_wallet
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Authenticate git for package clones
run: |
git config --global --unset-all credential.helper || true
git config --global url."https://x-access-token:${{ github.token }}@github.com/".insteadOf "https://github.com/"
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/.ghcup /usr/local/lib/node_modules /opt/hostedtoolcache/CodeQL
sudo rm -rf /usr/share/swift /usr/local/share/powershell /usr/share/miniconda /opt/az /usr/local/graalvm
sudo docker image prune -af > /dev/null
df -h /
- 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
sudo chmod 666 /dev/kvm || true
if [[ ! -c /dev/kvm ]]; then
echo "::error::/dev/kvm is not a character device, this runner has no usable KVM"
exit 1
fi
- name: Install protobuf compiler
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Restore flutter sdk
id: flutter-cache
uses: actions/cache/restore@v4
with:
path: ~/flutter
key: flutter-sdk-3.41.9-${{ runner.os }}
- name: Install Flutter
run: |
if [[ ! -d "$HOME/flutter/bin" ]]; then
git clone --branch 3.41.9 --depth 1 https://github.com/flutter/flutter.git "$HOME/flutter"
fi
echo "$HOME/flutter/bin" >> $GITHUB_PATH
export PATH="$PATH:$HOME/flutter/bin"
flutter --version
- name: Save flutter sdk
if: steps.flutter-cache.outputs.cache-hit != 'true'
continue-on-error: true
uses: actions/cache/save@v4
with:
path: ~/flutter
key: flutter-sdk-3.41.9-${{ runner.os }}
- name: Setup gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false
- name: Restore pub packages
id: pub-cache
uses: actions/cache/restore@v4
with:
path: ~/.pub-cache
key: pub-cache-${{ runner.os }}-${{ hashFiles('pubspec_base.yaml', 'cw_*/pubspec.yaml') }}
restore-keys: pub-cache-${{ runner.os }}-
- name: Docker sock permissions
run: sudo chmod 666 /var/run/docker.sock || true
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Add secrets
run: |
touch cw_bitcoin/lib/.secrets.g.dart
touch cw_evm/lib/.secrets.g.dart
touch cw_solana/lib/.secrets.g.dart
touch cw_core/lib/.secrets.g.dart
touch cw_nano/lib/.secrets.g.dart
touch cw_tron/lib/.secrets.g.dart
echo "const polygonScanApiKey = '${{ secrets.POLYGON_SCAN_API_KEY }}';" >> cw_evm/lib/.secrets.g.dart
echo "const etherScanApiKey = '${{ secrets.ETHER_SCAN_API_KEY }}';" >> cw_evm/lib/.secrets.g.dart
echo "const moralisApiKey = '${{ secrets.MORALIS_API_KEY }}';" >> cw_evm/lib/.secrets.g.dart
echo "const nowNodesApiKey = '${{ secrets.EVM_NOWNODES_API_KEY }}';" >> cw_evm/lib/.secrets.g.dart
echo "const alchemyApiKey = '${{ secrets.ALCHEMY_API_KEY }}';" >> cw_evm/lib/.secrets.g.dart
echo "const blinkApiKey = '${{ secrets.BLINK_API_KEY }}';" >> cw_evm/lib/.secrets.g.dart
echo "const ankrApiKey = '${{ secrets.ANKR_API_KEY }}';" >> cw_solana/lib/.secrets.g.dart
echo "const chainStackApiKey = '${{ secrets.CHAIN_STACK_API_KEY }}';" >> cw_solana/lib/.secrets.g.dart
echo "const moralisApiKey = '${{ secrets.MORALIS_API_KEY }}';" >> cw_solana/lib/.secrets.g.dart
echo "const nano2ApiKey = '${{ secrets.NANO2_API_KEY }}';" >> cw_nano/lib/.secrets.g.dart
echo "const nanoNowNodesApiKey = '${{ secrets.NANO_NOW_NODES_API_KEY }}';" >> cw_nano/lib/.secrets.g.dart
echo "const tronGridApiKey = '${{ secrets.TRON_GRID_API_KEY }}';" >> cw_tron/lib/.secrets.g.dart
echo "const tronNowNodesApiKey = '${{ secrets.TRON_NOW_NODES_API_KEY }}';" >> cw_tron/lib/.secrets.g.dart
echo "const breezApiKey = '${{ secrets.BREEZ_API_KEY }}';" >> cw_bitcoin/lib/.secrets.g.dart
echo "${{ secrets.MAIN_SECRETS_FILE }}" | base64 --decode > lib/.secrets.g.dart
- name: Add funded wallet secrets
if: ${{ inputs.write_funds_secrets }}
run: |
echo "${{ secrets.FUNDS_SECRETS_FILE }}" | base64 --decode > integration_test/core/funded_wallets.dart
- name: Build dependencies utilizing ghcr cache
if: ${{ !inputs.extract_only }}
run: |
env \
CW_DOCKER_REGISTRY=ghcr.io/cake-tech/cake_wallet \
CW_DOCKER_USE_CLOUD=true \
./scripts/android/docker/build.sh
- name: Extract native dependencies
if: ${{ inputs.extract_only }}
run: |
env \
CW_DOCKER_REGISTRY=ghcr.io/cake-tech/cake_wallet \
CW_DOCKER_USE_CLOUD=true \
./scripts/android/docker/build.sh --extract
- name: Reclaim the space the dependency images took
run: |
docker system prune -af --volumes > /dev/null
df -h /
- name: Execute Build and Setup Commands
run: |
pushd scripts/android
source ./app_env.sh cakewallet
./app_config.sh
popd
- name: Install Flutter dependencies
run: |
flutter pub get
- name: Save pub packages
if: steps.pub-cache.outputs.cache-hit != 'true'
continue-on-error: true
uses: actions/cache/save@v4
with:
path: ~/.pub-cache
key: pub-cache-${{ runner.os }}-${{ hashFiles('pubspec_base.yaml', 'cw_*/pubspec.yaml') }}
- name: Build generated code
run: |
flutter --version
./model_generator.sh
- name: Generate KeyStore
run: |
keytool -genkey -v -keystore android/app/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias testKey -noprompt -dname "CN=CakeWallet, OU=CakeWallet, O=CakeWallet, L=Florida, S=America, C=USA" -storepass $STORE_PASS -keypass $KEY_PASS
- name: Generate key properties
run: |
dart run tool/generate_android_key_properties.dart keyAlias=testKey storeFile=key.jks storePassword=$STORE_PASS keyPassword=$KEY_PASS
- name: Generate localization
run: |
dart run tool/generate_localization.dart
- name: Compile graphics
run: |
./compile_graphics.sh
- name: Compile assets/images graphics
run: |
while read -r dir; do
dart run vector_graphics_compiler --input-dir "$dir" --out-dir "$dir" > /dev/null &
done < <(find assets/images -type d)
wait
- name: Rename app
run: |
sanitized_branch_name=${BRANCH_NAME#origin/} # Remove 'origin/' prefix if it exists
sanitized_branch_name=${sanitized_branch_name:0:16} # Take only the first 16 characters
sanitized_branch_name=$(echo "$sanitized_branch_name" | tr '[:upper:]' '[:lower:]') # Convert to lowercase
sanitized_branch_name=$(echo "$sanitized_branch_name" | sed 's/[^a-z0-9]//g') # Remove all special characters
echo -e "id=com.cakewallet.test_${sanitized_branch_name}\nname=${BRANCH_NAME}" > android/app.properties
- name: Prime test build
env:
SUITE_DIR_INPUT: ${{ inputs.suite_dir }}
TEST_TIER_INPUT: ${{ inputs.test_tier }}
run: |
search_dir="$SUITE_DIR_INPUT"
if [[ "$TEST_TIER_INPUT" != "all" ]]; then
search_dir="$search_dir/$TEST_TIER_INPUT"
fi
first_suite=$(find "$search_dir" -name "*_test.dart" -type f | sort | head -1)
echo "Priming build with $first_suite"
flutter build apk --debug --target-platform android-x64 --target="$first_suite" --dart-define=CI_BUILD=true
- name: Cap the gradle heap for the test phase
run: |
sed -i 's/^org.gradle.jvmargs=.*/org.gradle.jvmargs=-Xmx3072M/' android/gradle.properties
grep '^org.gradle.jvmargs' android/gradle.properties
pkill -f GradleDaemon || echo "No gradle daemon to stop"
free -h || true
df -h / || true
- name: Integration tests on Android Emulator
uses: reactivecircus/android-emulator-runner@v2
env:
RECORD_SCREEN: ${{ inputs.record_screen }}
ENCRYPT_LOGS: ${{ inputs.write_funds_secrets }}
SUITE_DIR_INPUT: ${{ inputs.suite_dir }}
EXTRA_DART_DEFINES_INPUT: ${{ inputs.extra_dart_defines }}
with:
api-level: 31
target: google_apis
arch: x86_64
profile: pixel_5
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -read-only -memory 3072 -cores 4 -no-snapshot-save
disable-animations: false
working-directory: ${{ github.workspace }}
script: bash scripts/ci/run_integration_tests.sh ${{ inputs.test_tier }}
- name: Upload test logs
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: integration-test-logs
path: |
${{ github.workspace }}/${{ inputs.test_tier }}_run.log
${{ github.workspace }}/${{ inputs.test_tier }}_run.log.gpg
${{ github.workspace }}/${{ inputs.test_tier }}_logcat.txt
${{ github.workspace }}/${{ inputs.test_tier }}_logcat.txt.gpg
${{ github.workspace }}/recordings/*.gpg
- name: Integration tests on Android Emulator (tier1, non-blocking)
if: ${{ inputs.test_tier == 'tier0' }}
continue-on-error: true
uses: reactivecircus/android-emulator-runner@v2
env:
RECORD_SCREEN: ${{ inputs.record_screen }}
ENCRYPT_LOGS: ${{ inputs.write_funds_secrets }}
SUITE_DIR_INPUT: ${{ inputs.suite_dir }}
EXTRA_DART_DEFINES_INPUT: ${{ inputs.extra_dart_defines }}
with:
api-level: 31
target: google_apis
arch: x86_64
profile: pixel_5
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -read-only -memory 3072 -cores 4 -no-snapshot-save
disable-animations: false
working-directory: ${{ github.workspace }}
script: bash scripts/ci/run_integration_tests.sh tier1
- name: Upload tier1 logs
if: ${{ always() && inputs.test_tier == 'tier0' }}
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: integration-test-logs-tier1
path: |
${{ github.workspace }}/tier1_run.log
${{ github.workspace }}/tier1_run.log.gpg
${{ github.workspace }}/tier1_logcat.txt
${{ github.workspace }}/tier1_logcat.txt.gpg
# Superseded runs are cancelled on purpose, reporting those would be noise
- name: Report the run to slack
if: ${{ !cancelled() && inputs.slack_notify }}
continue-on-error: true
env:
SLACK_TOKEN: ${{ secrets.SLACK_TESTS_TOKEN }}
SLACK_CHANNEL: ${{ secrets.SLACK_TESTS_CHANNEL }}
BRANCH: ${{ github.head_ref || github.ref_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
ACTOR: ${{ github.actor }}
REPO_URL: ${{ github.server_url }}/${{ github.repository }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
DART_DEFINES: ${{ inputs.extra_dart_defines }}
run: |
if [[ -z "$SLACK_TOKEN" || -z "$SLACK_CHANNEL" ]]; then
echo "::notice::No slack token or channel configured, skipping the report"
exit 0
fi
fmt() {
printf '%dm %02ds' $(( $1 / 60 )) $(( $1 % 60 ))
}
field() {
awk -F= -v key="$2" '$1 == key { print $2; exit }' "$1"
}
tier_line() {
local file="$1" label="$2" note="$3"
if [[ ! -f "$file" ]]; then
printf '*%s*\n%s' "$label" "$note"
return
fi
printf '*%s*\n%s/%s passed in %s' "$label" \
"$(field "$file" passed)" "$(field "$file" total)" \
"$(fmt "$(field "$file" duration)")"
}
# For scenarios where the suite never ran because of driver issues,
# we can't call it a failing test, so we just log it
failure_lines() {
local file="$1" label="$2"
[[ -f "$file" ]] || return 0
while IFS= read -r entry; do
[[ -n "$entry" ]] || continue
local rest="${entry#*|}"
local name="${entry%%|*}"
local duration="${rest%%|*}"
local reason="${rest#*|}"
if [[ "$reason" == "void" ]]; then
printf '\n• `%s` (%s) _%s, driver never attached, the suite did not run_' \
"$name" "$(fmt "$duration")" "$label"
else
printf '\n• `%s` (%s) _%s_' "$name" "$(fmt "$duration")" "$label"
fi
done < <(sed -n 's/^fail=//p' "$file")
}
# Adding the results for the funds suites to the report too, so we know if we need to topup
chain_lines() {
local status_wanted="$1" icon="$2" file
local seen=""
for file in *_summary.txt; do
[[ -f "$file" ]] || continue
while IFS= read -r entry; do
[[ -n "$entry" ]] || continue
local chain="${entry%%|*}"
local rest="${entry#*|}"
local status="${rest%%|*}"
local detail="${rest#*|}"
[[ "$status" == "$status_wanted" ]] || continue
[[ "$seen" == *"[$chain]"* ]] && continue
seen="$seen[$chain]"
printf '\n%s *%s* _%s_' "$icon" "$chain" "$detail"
done < <(sed -n 's/^chain=//p' "$file")
done
}
pass_names() {
local file="$1" label="$2"
[[ -f "$file" ]] || return 0
printf '*%s* (%s)' "$label" "$(field "$file" passed)"
while IFS= read -r entry; do
[[ -n "$entry" ]] || continue
printf '\n• %s _%s_' "${entry%%|*}" "$(fmt "${entry##*|}")"
done < <(sed -n 's/^pass=//p' "$file")
}
tier0_failed=1
tier1_failed=0
total_passed=0
if [[ -f all_summary.txt ]]; then
tier0_failed=$(field all_summary.txt failed)
else
[[ -f tier0_summary.txt ]] && tier0_failed=$(field tier0_summary.txt failed)
[[ -f tier1_summary.txt ]] && tier1_failed=$(field tier1_summary.txt failed)
fi
for file in tier0_summary.txt tier1_summary.txt; do
[[ -f "$file" ]] || continue
total_passed=$(( total_passed + $(field "$file" passed) ))
done
if (( tier0_failed > 0 )); then
headline=":x: Integration tests failed"
elif (( tier1_failed > 0 )); then
headline=":warning: Gate passed, tier1 has failures"
else
headline=":white_check_mark: Integration tests passed"
fi
if (( tier0_failed > 0 )); then
tier1_note="_skipped, tier0 failed_"
else
tier1_note="_did not run_"
fi
where="<$REPO_URL/tree/$BRANCH|$BRANCH>"
if [[ -n "$PR_NUMBER" ]]; then
where="$where · <$REPO_URL/pull/$PR_NUMBER|#$PR_NUMBER ${PR_TITLE:-}>"
fi
failures=$(printf '%s%s%s' \
"$(failure_lines tier0_summary.txt tier0)" \
"$(failure_lines tier1_summary.txt tier1)" \
"$(failure_lines all_summary.txt suites)")
if [[ -f all_summary.txt ]]; then
primary=$(tier_line all_summary.txt suites '')
secondary=""
else
primary=$(tier_line tier0_summary.txt tier0 '_did not run_')
secondary=$(tier_line tier1_summary.txt tier1 "$tier1_note")
fi
chains=$(printf '%s%s%s%s' \
"$(chain_lines ok ':white_check_mark:')" \
"$(chain_lines empty ':moneybag:')" \
"$(chain_lines waiting ':hourglass:')" \
"$(chain_lines failed ':x:')")
needs_funding=$(chain_lines empty ':moneybag:')
too_slow=$(chain_lines waiting ':hourglass:')
blocks=$(jq -n \
--arg headline "$headline" \
--arg where "$where" \
--arg primary "$primary" \
--arg secondary "$secondary" \
--arg failures "$failures" \
--arg chains "$chains" \
--arg funding "$needs_funding" \
--arg slow "$too_slow" \
--arg defines "$(printf '%s' "$DART_DEFINES" | tr ';' ' ')" \
--arg commit "${COMMIT:0:8}" \
--arg actor "$ACTOR" \
--arg repo "$REPO_URL" \
--arg run "$RUN_URL" \
'[
{ type: "header", text: { type: "plain_text", text: $headline, emoji: true } },
{ type: "section", text: { type: "mrkdwn", text: $where } },
{ type: "section", fields: (
[ { type: "mrkdwn", text: $primary } ]
+ (if $secondary == "" then [] else
[ { type: "mrkdwn", text: $secondary } ] end)
) }
]
+ (if $failures == "" then [] else
[ { type: "section", text: { type: "mrkdwn",
text: ("*Did not pass*" + $failures) } } ]
end)
+ (if $chains == "" then [] else
[ { type: "divider" },
{ type: "section", text: { type: "mrkdwn",
text: ("*Chains*" + $chains) } } ]
end)
+ (if $funding == "" then [] else
[ { type: "context", elements: [ { type: "mrkdwn",
text: ":moneybag: The chains above could not cover a send. Top those wallets up and re run the funds workflow, nothing there needs debugging :)." } ] } ]
end)
+ (if $slow == "" then [] else
[ { type: "context", elements: [ { type: "mrkdwn",
text: ":hourglass: Still rescanning when the clock ran out, so nothing was proven either way and the run is not red for them." } ] } ]
end)
+ [
{ type: "context", elements: [
{ type: "mrkdwn",
text: ("<" + $repo + "/commit/" + $commit + "|" + $commit + "> · " + $actor
+ (if $defines == "" then "" else " · `" + $defines + "`" end)) }
] },
{ type: "actions", elements: [
{ type: "button", url: $run,
text: { type: "plain_text", text: "View run", emoji: false } }
] }
]')
response=$(curl -sS -X POST https://slack.com/api/chat.postMessage \
-H "Authorization: Bearer $SLACK_TOKEN" \
-H "Content-type: application/json; charset=utf-8" \
--data "$(jq -n --arg channel "$SLACK_CHANNEL" --arg text "$headline" \
--argjson blocks "$blocks" \
'{channel: $channel, text: $text, blocks: $blocks}')")
if [[ "$(jq -r '.ok' <<< "$response")" != "true" ]]; then
error=$(jq -r '.error // "unknown"' <<< "$response")
needed=$(jq -r '.needed // empty' <<< "$response")
if [[ -n "$needed" ]]; then
echo "::warning::Slack rejected the report: $error, it wants the $needed scope"
else
echo "::warning::Slack rejected the report: $error"
fi
exit 0
fi
thread_ts=$(jq -r '.ts // empty' <<< "$response")
if [[ -z "$thread_ts" ]] || (( total_passed == 0 )); then
exit 0
fi
# So that the channel is not clutter (and uglyyyy), we put everything that passed in the thread
# and the short version is the one that shows up in the channel
passed=$(printf '%s\n\n%s' \
"$(pass_names tier0_summary.txt tier0)" "$(pass_names tier1_summary.txt tier1)")
curl -sS -X POST https://slack.com/api/chat.postMessage \
-H "Authorization: Bearer $SLACK_TOKEN" \
-H "Content-type: application/json; charset=utf-8" \
--data "$(jq -n --arg channel "$SLACK_CHANNEL" --arg ts "$thread_ts" --arg text "$passed" \
'{channel: $channel, thread_ts: $ts, text: $text}')" > /dev/null
+2 -2
View File
@@ -22,8 +22,8 @@ jobs:
test:
runs-on: ubuntu-latest
container:
# Same prebuilt image as the build workflows (bundles Flutter 3.32.0).
image: ghcr.io/cake-tech/cake_wallet:debian13-flutter3.32.0-ndkr28-go1.24.1-ruststablenightly
# Same prebuilt image as the build workflows (bundles Flutter 3.41.9).
image: ghcr.io/cake-tech/cake_wallet:debian13-flutter3.41.9-ndkr28-go1.24.1-ruststablenightly
steps:
- name: Fix Actions HOME (writeable for ~/.cache)