fix: linux builds (#3485)

This commit is contained in:
cyan
2026-08-07 22:10:27 +02:00
committed by GitHub
parent b60b5a59f7
commit 43cd125942
15 changed files with 288 additions and 71 deletions
+30 -69
View File
@@ -2,9 +2,15 @@ name: Cake Wallet Linux
on: [pull_request]
permissions:
contents: read
packages: write
defaults:
run:
shell: bash
jobs:
PR_test_build:
runs-on: [Linux, amd64, forlinux]
@@ -26,6 +32,14 @@ jobs:
steps:
- name: Fix github actions messing up $HOME...
run: "echo HOME=/root | sudo tee -a $GITHUB_ENV"
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
@@ -35,6 +49,7 @@ jobs:
git config --global --add safe.directory '*'
git config --global user.email "ci@cakewallet.com"
git config --global user.name "CakeWallet CI"
- name: Get the full commit message
run: |
FULL_MESSAGE="$(git log -1 --pretty=%B)"
@@ -54,8 +69,8 @@ jobs:
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 blinkApiKey = '${{ secrets.BLINK_API_KEY }}';" >> cw_evm/lib/.secrets.g.dart
echo "const nowNodesApiKey = '${{ secrets.EVM_NOWNODES_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
@@ -65,72 +80,19 @@ jobs:
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: 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
mkdir torch_dart
pushd torch_dart
tar -xzf ../torch_dart.tar.gz
popd
rm ./torch_dart.tar.gz
popd
- name: Fetch prebuilt Reown
- name: Build dependencies utilizing ghcr cache
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
env \
CW_DOCKER_REGISTRY=ghcr.io/cake-tech/cake_wallet \
CW_DOCKER_USE_CLOUD=true \
./scripts/linux/docker/build.sh
- name: Build Zcash Lib
run: |
set -x -e
pushd scripts/linux
./build_zcash.sh
popd
- name: Build Bitbox Flutter
run: |
set -x -e
pushd scripts
./build_bitbox_flutter.sh
popd
- name: Build monero_c
run: |
./scripts/prepare_moneroc.sh
mkdir -p scripts/monero_c/release
pushd scripts/monero_c/release
TAG=$(git describe --tags)
mkdir -p "$TAG"
pushd "$TAG"
wget https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC2/release-bundle.zip
unzip release-bundle.zip
# RC2's bundle puts 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
popd
- name: Execute Build and Setup Commands
run: |
@@ -143,15 +105,6 @@ jobs:
run: |
flutter pub get
- name: Build mwebd
run: |
set -x -e
export MWEBD_HASH=$(cat scripts/android/build_mwebd.sh | grep 'git reset --hard' | xargs | awk '{ print $4 }')
echo MWEBD_HASH=$MWEBD_HASH >> /etc/environment
pushd scripts/android
./build_mwebd.sh
popd
- name: Build generated code
run: |
./model_generator.sh async
@@ -159,6 +112,7 @@ jobs:
- name: Generate localization
run: |
dart run tool/generate_localization.dart
- name: Build linux
run: |
flutter build linux --dart-define=hasDevOptions=true --release
@@ -198,6 +152,7 @@ jobs:
xmessage -timeout 30 "confirm_seeds_flow_test" &
rm -rf ~/.local/share/com.example.cake_wallet/ ~/Documents/cake_wallet/ ~/cake_wallet
exec timeout --signal=SIGKILL 900 flutter drive --driver=test_driver/integration_test.dart --target=integration_test/test_suites/confirm_seeds_flow_test.dart
- name: Test [create_wallet_flow_test]
if: ${{ contains(env.message, 'run tests') }}
timeout-minutes: 20
@@ -205,6 +160,7 @@ jobs:
xmessage -timeout 30 "create_wallet_flow_test" &
rm -rf ~/.local/share/com.example.cake_wallet/ ~/Documents/cake_wallet/ ~/cake_wallet
exec timeout --signal=SIGKILL 900 flutter drive --driver=test_driver/integration_test.dart --target=integration_test/test_suites/create_wallet_flow_test.dart
# - name: Test [exchange_flow_test]
# if: ${{ contains(env.message, 'run tests') }}
# timeout-minutes: 20
@@ -212,6 +168,7 @@ jobs:
# xmessage -timeout 30 "exchange_flow_test" &
# rm -rf ~/.local/share/com.example.cake_wallet/ ~/Documents/cake_wallet/ ~/cake_wallet
# exec timeout --signal=SIGKILL 900 flutter drive --driver=test_driver/integration_test.dart --target=integration_test/test_suites/exchange_flow_test.dart
- name: Test [restore_wallet_through_seeds_flow_test]
if: ${{ contains(env.message, 'run tests') }}
timeout-minutes: 20
@@ -219,12 +176,15 @@ jobs:
xmessage -timeout 30 "restore_wallet_through_seeds_flow_test" &
rm -rf ~/.local/share/com.example.cake_wallet/ ~/Documents/cake_wallet/ ~/cake_wallet
exec timeout --signal=SIGKILL 900 flutter drive --driver=test_driver/integration_test.dart --target=integration_test/test_suites/restore_wallet_through_seeds_flow_test.dart
- name: Test [cw_core]
timeout-minutes: 15
run: cd cw_core && flutter test
- name: Test [cw_monero]
timeout-minutes: 15
run: cd cw_monero && flutter test
- name: Stop screen recording, encrypt and upload
if: always()
run: |
@@ -245,6 +205,7 @@ jobs:
/opt/screen_grab.mkv
rm /opt/screen_grab.mkv
mv /opt/screen_grab.mkv.gpg ./screen_grab.mkv.gpg
- name: Upload Artifact to github
if: always()
continue-on-error: true