@@ -2,13 +2,19 @@ name: E2E
22
33on :
44 workflow_dispatch :
5+ pull_request :
56
67env :
78 TERM : xterm-256color
89 FORCE_COLOR : 1
910
11+ concurrency :
12+ group : ${{ github.workflow }}-${{ github.ref }}
13+ cancel-in-progress : true
14+
1015jobs :
1116 build :
17+ if : github.event.pull_request.draft == false
1218 runs-on : ubuntu-latest
1319
1420 steps :
@@ -35,13 +41,19 @@ jobs:
3541 E2E : true
3642 run : ./gradlew assembleDevDebug
3743
44+ - name : Rename APK
45+ run : |
46+ apk=$(find app/build/outputs/apk/dev/debug -name 'bitkit-android-*-devDebug.apk')
47+ mv "$apk" app/build/outputs/apk/dev/debug/bitkit_e2e.apk
48+
3849 - name : Upload APK
3950 uses : actions/upload-artifact@v4
4051 with :
41- name : bitkit-e2e-apk
42- path : app/build/outputs/apk/dev/debug/bitkit-android-11-devDebug .apk
52+ name : bitkit-e2e-apk_${{ github.run_number }}
53+ path : app/build/outputs/apk/dev/debug/bitkit_e2e .apk
4354
4455 e2e-tests :
56+ if : github.event.pull_request.draft == false
4557 runs-on : ubuntu-latest
4658 needs : build
4759
@@ -52,14 +64,77 @@ jobs:
5264 repository : synonymdev/bitkit-e2e-tests
5365 path : bitkit-e2e-tests
5466
67+ - name : Enable KVM
68+ run : |
69+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
70+ sudo udevadm control --reload-rules
71+ sudo udevadm trigger --name-match=kvm
72+
5573 - name : Download APK
5674 uses : actions/download-artifact@v4
5775 with :
58- name : bitkit-e2e-apk
76+ name : bitkit-e2e-apk_${{ github.run_number }}
5977 path : bitkit-e2e-tests/aut
6078
61- - name : Rename APK
62- run : mv bitkit-e2e-tests/aut/bitkit-android-11-devDebug.apk bitkit-e2e-tests/aut/bitkit_e2e.apk
63-
6479 - name : List APK directory contents
6580 run : ls -l bitkit-e2e-tests/aut
81+
82+ - name : Setup Node.js
83+ uses : actions/setup-node@v4
84+ with :
85+ node-version : 22
86+
87+ - name : Cache npm cache
88+ uses : actions/cache@v3
89+ with :
90+ path : ~/.npm
91+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
92+ restore-keys : |
93+ ${{ runner.os }}-node-
94+
95+ - name : Install dependencies
96+ working-directory : bitkit-e2e-tests
97+ run : npm ci
98+
99+ - name : Run regtest setup
100+ working-directory : bitkit-e2e-tests
101+ run : |
102+ cd docker
103+ mkdir lnd && chmod 777 lnd
104+ docker compose pull --quiet
105+ docker compose up -d
106+
107+ - name : Wait for electrum server and LND
108+ working-directory : bitkit-e2e-tests
109+ timeout-minutes : 10
110+ run : |
111+ while ! nc -z '127.0.0.1' 60001; do sleep 1; done
112+ sudo bash -c "while [ ! -f docker/lnd/data/chain/bitcoin/regtest/admin.macaroon ]; do sleep 1; done"
113+ sudo chmod -R 777 docker/lnd
114+
115+ - name : Run E2E Tests
116+ uses : reactivecircus/android-emulator-runner@v2
117+ with :
118+ profile : pixel_6
119+ api-level : 33
120+ arch : x86_64
121+ avd-name : Pixel_6
122+ force-avd-creation : false
123+ emulator-options : -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none
124+ script : |
125+ # adb port forwarding for regtest
126+ adb reverse tcp:60001 tcp:60001
127+ cd bitkit-e2e-tests && npm run e2e:android -- --mochaOpts.grep "Can start onboarding"
128+ env :
129+ RECORD_VIDEO : true
130+
131+ - name : Upload E2E Artifacts
132+ if : failure()
133+ uses : actions/upload-artifact@v4
134+ with :
135+ name : e2e-artifacts_${{ github.run_number }}
136+ path : bitkit-e2e-tests/artifacts/
137+
138+ - name : Dump docker logs on failure
139+ if : failure()
140+ uses : jwalton/gh-docker-logs@v2
0 commit comments