-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (118 loc) · 4.59 KB
/
migration-wallet-setup.yml
File metadata and controls
133 lines (118 loc) · 4.59 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
name: Migration Wallet Setup
on:
workflow_call:
inputs:
e2e_branch:
description: "Branch of synonymdev/bitkit-e2e-tests to use"
required: true
type: string
rn_version:
description: "Legacy RN app version to use for setup (e.g., v1.1.6)"
required: false
type: string
default: "v1.1.6"
setup_type:
description: "Wallet setup type (standard | passphrase | sweep)"
required: true
type: string
scenario_name:
description: "Migration scenario name for artifact naming"
required: true
type: string
env:
TERM: xterm-256color
FORCE_COLOR: 1
jobs:
prepare-wallets:
runs-on: ubuntu-latest
steps:
- name: Clone E2E tests
uses: actions/checkout@v4
with:
repository: synonymdev/bitkit-e2e-tests
path: bitkit-e2e-tests
ref: ${{ inputs.e2e_branch }}
- 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 RN app for migration
run: |
mkdir -p bitkit-e2e-tests/aut
curl -L -o bitkit-e2e-tests/aut/bitkit_rn_regtest.apk \
https://github.com/synonymdev/bitkit-e2e-tests/releases/download/migration-rn-regtest/bitkit_rn_regtest_${{ inputs.rn_version }}.apk
# Symlink to bitkit_e2e.apk so wdio.conf.ts can initialize the Appium session
cd bitkit-e2e-tests/aut && ln -sf bitkit_rn_regtest.apk bitkit_e2e.apk
- 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: Clear previous migration env files
working-directory: bitkit-e2e-tests
run: |
rm -f artifacts/migration_setup_standard.env
rm -f artifacts/migration_setup_passphrase.env
rm -f artifacts/migration_setup_sweep.env
- name: Prepare migration wallet 1
continue-on-error: true
id: prepare1
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 "@migration_setup_${{ inputs.setup_type }}"
env:
BACKEND: regtest
- name: Prepare migration wallet 2
continue-on-error: true
id: prepare2
if: steps.prepare1.outcome != 'success'
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 "@migration_setup_${{ inputs.setup_type }}"
env:
BACKEND: regtest
- name: Prepare migration wallet 3
id: prepare3
if: steps.prepare1.outcome != 'success' && steps.prepare2.outcome != 'success'
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 "@migration_setup_${{ inputs.setup_type }}"
env:
BACKEND: regtest
- name: Verify migration env file
run: |
set -euo pipefail
test -f "bitkit-e2e-tests/artifacts/migration_setup_${{ inputs.setup_type }}.env"
- name: Upload migration env file
uses: actions/upload-artifact@v4
with:
name: migration-env_${{ inputs.rn_version }}_${{ inputs.scenario_name }}
path: bitkit-e2e-tests/artifacts/migration_setup_${{ inputs.setup_type }}.env