Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 74 additions & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ name: E2E

on:
workflow_dispatch:
pull_request:

env:
TERM: xterm-256color
FORCE_COLOR: 1

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -35,11 +40,16 @@ jobs:
E2E: true
run: ./gradlew assembleDevDebug

- name: Rename APK
run: |
apk=$(find app/build/outputs/apk/dev/debug -name 'bitkit-android-*-devDebug.apk')
mv "$apk" app/build/outputs/apk/dev/debug/bitkit_e2e.apk

- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: bitkit-e2e-apk
path: app/build/outputs/apk/dev/debug/bitkit-android-11-devDebug.apk
path: app/build/outputs/apk/dev/debug/bitkit_e2e.apk

e2e-tests:
runs-on: ubuntu-latest
Expand All @@ -52,14 +62,74 @@ jobs:
repository: synonymdev/bitkit-e2e-tests
path: bitkit-e2e-tests

- 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

- name: Download APK
uses: actions/download-artifact@v4
with:
name: bitkit-e2e-apk
path: bitkit-e2e-tests/aut

- name: Rename APK
run: mv bitkit-e2e-tests/aut/bitkit-android-11-devDebug.apk bitkit-e2e-tests/aut/bitkit_e2e.apk

- name: List APK directory contents
run: ls -l bitkit-e2e-tests/aut

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Cache npm cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

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

- name: Run regtest setup
working-directory: bitkit-e2e-tests
run: |
cd docker
mkdir lnd && chmod 777 lnd
docker compose pull --quiet
docker compose up -d

- name: Wait for electrum server and LND
working-directory: bitkit-e2e-tests
timeout-minutes: 10
run: |
while ! nc -z '127.0.0.1' 60001; do sleep 1; done
sudo bash -c "while [ ! -f docker/lnd/data/chain/bitcoin/regtest/admin.macaroon ]; do sleep 1; done"
sudo chmod -R 777 docker/lnd

- name: Run E2E Tests
uses: reactivecircus/android-emulator-runner@v2
with:
profile: pixel_6
api-level: 33
arch: x86_64
avd-name: Pixel_6
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none
script: cd bitkit-e2e-tests && npm run e2e:android -- --mochaOpts.grep "Can start onboarding"
env:
RECORD_VIDEO: true

- name: Upload E2E Artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: e2e-artifacts
path: bitkit-e2e-tests/artifacts/

- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
2 changes: 1 addition & 1 deletion app/src/main/java/to/bitkit/env/Env.kt
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ internal object Env {
protocol = ElectrumProtocol.TCP,
)
val E2E = ElectrumServer(
host = "127.0.0.1",
host = "10.0.2.2",
tcp = 60001,
ssl = 60002,
protocol = ElectrumProtocol.TCP,
Expand Down