-
Notifications
You must be signed in to change notification settings - Fork 3
160 lines (133 loc) · 4.78 KB
/
e2e.yml
File metadata and controls
160 lines (133 loc) · 4.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: E2E
on:
workflow_dispatch:
inputs:
e2e_branch:
description: "Branch of synonymdev/bitkit-e2e-tests to use"
required: false
default: "main"
pull_request:
env:
TERM: xterm-256color
FORCE_COLOR: 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "adopt"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Decode google-services.json
run: echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 -d > app/google-services.json
env:
GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }}
- name: Build debug app
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHATWOOT_API: ${{ secrets.CHATWOOT_API }}
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_${{ github.run_number }}
path: app/build/outputs/apk/dev/debug/bitkit_e2e.apk
e2e-tests:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
shard:
- { name: onboarding_backup_numberpad, grep: "@onboarding|@backup|@numberpad" }
- { name: onchain_boost_receive_widgets, grep: "@onchain|@boost|@receive|@widgets" }
- { name: settings, grep: "@settings" }
name: e2e-tests - ${{ matrix.shard.name }}
steps:
- name: Show selected E2E branch
env:
E2E_BRANCH: ${{ github.event.inputs.e2e_branch || 'main' }}
run: echo $E2E_BRANCH
- name: Clone E2E tests
uses: actions/checkout@v4
with:
repository: synonymdev/bitkit-e2e-tests
path: bitkit-e2e-tests
ref: ${{ github.event.inputs.e2e_branch || 'main' }}
- 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_${{ github.run_number }}
path: bitkit-e2e-tests/aut
- 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 (${{ matrix.shard.name }})
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-front none
script: cd bitkit-e2e-tests && ./ci_run_android.sh --mochaOpts.grep "${{ matrix.shard.grep }}"
env:
RECORD_VIDEO: true
- name: Upload E2E Artifacts (${{ matrix.shard.name }})
if: failure()
uses: actions/upload-artifact@v4
with:
name: e2e-artifacts_${{ matrix.shard.name }}_${{ github.run_number }}
path: bitkit-e2e-tests/artifacts/
- name: Dump docker logs on failure (${{ matrix.shard.name }})
if: failure()
uses: jwalton/gh-docker-logs@v2