feat: android e2e tests #95
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: e2e-android | |
on: pull_request | |
env: | |
E2E_TESTS: 1 # build without transform-remove-console babel plugin | |
DEBUG: 'lnurl* lnurl server' | |
jobs: | |
e2e: | |
runs-on: macos-13 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Setup Docker Colima 1 | |
uses: limpbrains/setup-docker-macos-action@48929bfd0b688ddb9e259c8ed1efb12ba3db863c | |
id: docker1 | |
continue-on-error: true | |
with: | |
lima: v0.18.0 | |
colima: v0.5.6 | |
# colima-params: --vm-type=vz --vz-rosetta | |
colima-params: --cpu 1 --memory 1 | |
# - name: Setup Docker Colima 2 | |
# if: steps.docker1.outcome != 'success' | |
# uses: limpbrains/setup-docker-macos-action@48929bfd0b688ddb9e259c8ed1efb12ba3db863c | |
# id: docker2 | |
# continue-on-error: true | |
# with: | |
# lima: v0.18.0 | |
# colima: v0.5.6 | |
# | |
# - name: Setup Docker Default | |
# if: steps.docker1.outcome != 'success' && steps.docker2.outcome != 'success' | |
# uses: docker-practice/[email protected] | |
# timeout-minutes: 30 | |
- name: Run regtest setup | |
run: cd docker && mkdir lnd && chmod 777 lnd && docker-compose up -d | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.17 | |
cache: 'yarn' # cache packages, but not node_modules | |
- name: Wait for bitcoind | |
timeout-minutes: 2 | |
run: while ! nc -z '127.0.0.1' 43782; do sleep 1; done | |
- name: Wait for electrum server | |
timeout-minutes: 2 | |
run: while ! nc -z '127.0.0.1' 60001; do sleep 1; done | |
- name: Activate enviroment variables | |
run: cp .env.test.template .env | |
- name: Activate react-native-skia-stub | |
run: patch -p1 < .github/workflows/react-native-skia-stub.patch | |
- name: Activate Gradle variables | |
run: mkdir -p ~/.gradle/; cp .github/workflows/gradle.properties ~/.gradle/gradle.properties | |
- name: Use specific Java version for sdkmanager to work | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Yarn Install | |
run: yarn --no-audit --prefer-offline || yarn --no-audit --prefer-offline | |
env: | |
HUSKY: 0 | |
- name: Collect Workflow Telemetry | |
uses: catchpoint/[email protected] | |
- name: Build | |
run: yarn e2e:build:android-release || yarn e2e:build:android-release | |
- name: Kill java processes | |
run: pkill -9 -f java || true | |
- name: Memory | |
run: | | |
df -h | |
top -l 1 | grep -E "^CPU|^Phys" | |
ps x -o rss,vsz,command | awk 'NR>1 {$1=int($1/1024)"M"; $2=int($2/1024)"M";}{ print ;}' | |
- name: Test backup | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
cores: 1 | |
ram-size: 2048M | |
heap-size: 512M | |
disk-size: 2048M | |
profile: 5.4in FWVGA | |
avd-name: Pixel_API_31_AOSP | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | |
arch: x86_64 | |
script: | | |
sleep 1 | |
adb root | |
echo "::group::attempt 1" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/backup.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 2" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/backup.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 3" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/backup.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 4" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/backup.e2e.js || true | |
echo "::endgroup::" | |
- name: Memory | |
run: | | |
df -h | |
top -l 1 | grep -E "^CPU|^Phys" | |
ps x -o rss,vsz,command | awk 'NR>1 {$1=int($1/1024)"M"; $2=int($2/1024)"M";}{ print ;}' | |
- name: Test channels | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
cores: 1 | |
ram-size: 2048M | |
heap-size: 512M | |
disk-size: 2048M | |
profile: 5.4in FWVGA | |
avd-name: Pixel_API_31_AOSP | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | |
arch: x86_64 | |
script: | | |
sleep 1 | |
adb root | |
echo "::group::attempt 1" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/channels.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 2" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/channels.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 3" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/channels.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 4" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/channels.e2e.js || true | |
echo "::endgroup::" | |
- name: Memory | |
run: | | |
df -h | |
top -l 1 | grep -E "^CPU|^Phys" | |
ps x -o rss,vsz,command | awk 'NR>1 {$1=int($1/1024)"M"; $2=int($2/1024)"M";}{ print ;}' | |
- name: Test lightning | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
cores: 1 | |
ram-size: 2048M | |
heap-size: 512M | |
disk-size: 2048M | |
profile: 5.4in FWVGA | |
avd-name: Pixel_API_31_AOSP | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | |
arch: x86_64 | |
script: | | |
sleep 1 | |
adb root | |
echo "::group::attempt 1" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/lightning.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 2" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/lightning.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 3" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/lightning.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 4" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/lightning.e2e.js || true | |
echo "::endgroup::" | |
- name: Memory | |
run: | | |
df -h | |
top -l 1 | grep -E "^CPU|^Phys" | |
ps x -o rss,vsz,command | awk 'NR>1 {$1=int($1/1024)"M"; $2=int($2/1024)"M";}{ print ;}' | |
- name: Test lnurl | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
cores: 1 | |
ram-size: 2048M | |
heap-size: 512M | |
disk-size: 2048M | |
profile: 5.4in FWVGA | |
avd-name: Pixel_API_31_AOSP | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | |
arch: x86_64 | |
script: | | |
sleep 1 | |
adb root | |
echo "::group::attempt 1" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/lnurl.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 2" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/lnurl.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 3" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/lnurl.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 4" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/lnurl.e2e.js || true | |
echo "::endgroup::" | |
- name: Memory | |
run: | | |
df -h | |
top -l 1 | grep -E "^CPU|^Phys" | |
ps x -o rss,vsz,command | awk 'NR>1 {$1=int($1/1024)"M"; $2=int($2/1024)"M";}{ print ;}' | |
- name: Test numberpad | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
cores: 1 | |
ram-size: 2048M | |
heap-size: 512M | |
disk-size: 2048M | |
profile: 5.4in FWVGA | |
avd-name: Pixel_API_31_AOSP | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | |
arch: x86_64 | |
script: | | |
sleep 1 | |
adb root | |
echo "::group::attempt 1" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/numberpad.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 2" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/numberpad.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 3" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/numberpad.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 4" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/numberpad.e2e.js || true | |
echo "::endgroup::" | |
- name: Memory | |
run: | | |
df -h | |
top -l 1 | grep -E "^CPU|^Phys" | |
ps x -o rss,vsz,command | awk 'NR>1 {$1=int($1/1024)"M"; $2=int($2/1024)"M";}{ print ;}' | |
- name: Test onchain | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
cores: 1 | |
ram-size: 2048M | |
heap-size: 512M | |
disk-size: 2048M | |
profile: 5.4in FWVGA | |
avd-name: Pixel_API_31_AOSP | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | |
arch: x86_64 | |
script: | | |
sleep 1 | |
adb root | |
echo "::group::attempt 1" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/onchain.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 2" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/onchain.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 3" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/onchain.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 4" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/onchain.e2e.js || true | |
echo "::endgroup::" | |
- name: Memory | |
run: | | |
df -h | |
top -l 1 | grep -E "^CPU|^Phys" | |
ps x -o rss,vsz,command | awk 'NR>1 {$1=int($1/1024)"M"; $2=int($2/1024)"M";}{ print ;}' | |
- name: Test receive | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
cores: 1 | |
ram-size: 2048M | |
heap-size: 512M | |
disk-size: 2048M | |
profile: 5.4in FWVGA | |
avd-name: Pixel_API_31_AOSP | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | |
arch: x86_64 | |
script: | | |
sleep 1 | |
adb root | |
echo "::group::attempt 1" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/receive.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 2" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/receive.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 3" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/receive.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 4" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/receive.e2e.js || true | |
echo "::endgroup::" | |
- name: Memory | |
run: | | |
df -h | |
top -l 1 | grep -E "^CPU|^Phys" | |
ps x -o rss,vsz,command | awk 'NR>1 {$1=int($1/1024)"M"; $2=int($2/1024)"M";}{ print ;}' | |
- name: Test settings | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
cores: 1 | |
ram-size: 2048M | |
heap-size: 512M | |
disk-size: 2048M | |
profile: 5.4in FWVGA | |
avd-name: Pixel_API_31_AOSP | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | |
arch: x86_64 | |
script: | | |
sleep 1 | |
adb root | |
echo "::group::attempt 1" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/settings.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 2" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/settings.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 3" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/settings.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 4" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/settings.e2e.js || true | |
echo "::endgroup::" | |
- name: Memory | |
run: | | |
df -h | |
top -l 1 | grep -E "^CPU|^Phys" | |
ps x -o rss,vsz,command | awk 'NR>1 {$1=int($1/1024)"M"; $2=int($2/1024)"M";}{ print ;}' | |
- name: Test slashtags | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
cores: 1 | |
ram-size: 2048M | |
heap-size: 512M | |
disk-size: 2048M | |
profile: 5.4in FWVGA | |
avd-name: Pixel_API_31_AOSP | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | |
arch: x86_64 | |
script: | | |
sleep 1 | |
adb root | |
echo "::group::attempt 1" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/slashtags.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 2" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/slashtags.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 3" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/slashtags.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 4" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/slashtags.e2e.js || true | |
echo "::endgroup::" | |
- name: Memory | |
run: | | |
df -h | |
top -l 1 | grep -E "^CPU|^Phys" | |
ps x -o rss,vsz,command | awk 'NR>1 {$1=int($1/1024)"M"; $2=int($2/1024)"M";}{ print ;}' | |
- name: Test widgets | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
cores: 1 | |
ram-size: 2048M | |
heap-size: 512M | |
disk-size: 2048M | |
profile: 5.4in FWVGA | |
avd-name: Pixel_API_31_AOSP | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | |
arch: x86_64 | |
script: | | |
sleep 1 | |
adb root | |
echo "::group::attempt 1" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/widgets.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 2" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/widgets.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 3" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/widgets.e2e.js || true | |
echo "::endgroup::" | |
echo "::group::attempt 4" | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/widgets.e2e.js || true | |
echo "::endgroup::" | |
- name: Memory | |
run: | | |
df -h | |
top -l 1 | grep -E "^CPU|^Phys" | |
ps x -o rss,vsz,command | awk 'NR>1 {$1=int($1/1024)"M"; $2=int($2/1024)"M";}{ print ;}' | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: e2e-test-videos | |
path: ./artifacts/ | |
- name: Dump docker logs on failure | |
if: failure() | |
uses: jwalton/gh-docker-logs@v2 |