feat: android e2e tests #135
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: | |
workflow_dispatch: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
E2E_TESTS: 1 # build without transform-remove-console babel plugin | |
DEBUG: 'lnurl* lnurl server' | |
jobs: | |
e2e: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Enable KVM group perms | |
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: Free Disk Space | |
uses: jlumbroso/free-disk-space@main | |
with: | |
# this might remove tools that are actually needed, | |
# if set to "true" but frees about 6 GB | |
tool-cache: false | |
android: false | |
dotnet: true | |
haskell: true | |
large-packages: true | |
docker-images: true | |
swap-storage: true | |
- name: yarn and gradle caches in /mnt | |
run: | | |
rm -rf ~/.yarn | |
rm -rf ~/.gradle | |
sudo mkdir -p /mnt/.yarn | |
sudo mkdir -p /mnt/.gradle | |
sudo chown -R runner /mnt/.yarn | |
sudo chown -R runner /mnt/.gradle | |
ln -s /mnt/.yarn /home/runner/ | |
ln -s /mnt/.gradle /home/runner/ | |
- name: Create artifacts directory on /mnt | |
run: | | |
sudo mkdir -p /mnt/artifacts | |
sudo chown -R runner /mnt/artifacts | |
- name: Specify node version | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Use gradle caches | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Use yarn caches | |
uses: actions/cache@v4 | |
with: | |
path: ~/.yarn | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Activate enviroment variables | |
run: cp .env.test.template .env | |
- name: Yarn Install | |
run: yarn || yarn | |
env: | |
HUSKY: 0 | |
- name: Activate Gradle variables | |
run: | | |
cp .github/workflows/gradle.properties ~/.gradle/gradle.properties | |
patch -p1 -i ./.github/workflows/react-native-quick-crypto.patch | |
- name: Use specific Java version for sdkmanager to work | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Build | |
run: yarn e2e:build:android-release || yarn e2e:build:android-release | |
- name: Kill java processes | |
run: pkill -9 -f java || true | |
- name: Run regtest setup | |
run: | | |
cd docker | |
mkdir lnd && chmod 777 lnd | |
docker-compose pull --quiet | |
docker compose up -d | |
- name: Wait for electrum server | |
timeout-minutes: 10 | |
run: while ! nc -z '127.0.0.1' 60001; do sleep 1; done | |
- name: Run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
profile: 5.1in WVGA | |
api-level: 31 | |
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: yarn e2e:test:android-release --record-videos all --record-logs all --take-screenshots all --headless -d 200000 -R 3 --artifacts-location /mnt/artifacts | |
# script: avdmanager list device | |
- uses: actions/upload-artifact@v4 | |
# if: failure() | |
with: | |
name: e2e-test-videos | |
path: /mnt/artifacts/ | |
- name: Dump docker logs on failure | |
if: failure() | |
uses: jwalton/gh-docker-logs@v2 | |
# - name: Clean docker | |
# if: ${{ always() }} | |
# run: | | |
# cd docker && docker compose down -v | |
# id: 0 or "tv_1080p" | |
# Name: Android TV (1080p) | |
# OEM : Google | |
# Tag : android-tv | |
# --------- | |
# id: 1 or "tv_4k" | |
# Name: Android TV (4K) | |
# OEM : Google | |
# Tag : android-tv | |
# --------- | |
# id: 2 or "tv_720p" | |
# Name: Android TV (720p) | |
# OEM : Google | |
# Tag : android-tv | |
# --------- | |
# id: 3 or "automotive_1024p_landscape" | |
# Name: Automotive (1024p landscape) | |
# OEM : Google | |
# Tag : android-automotive-playstore | |
# --------- | |
# id: 4 or "Galaxy Nexus" | |
# Name: Galaxy Nexus | |
# OEM : Google | |
# --------- | |
# id: 5 or "desktop_large" | |
# Name: Large Desktop | |
# OEM : Google | |
# Tag : android-desktop | |
# --------- | |
# id: 6 or "desktop_medium" | |
# Name: Medium Desktop | |
# OEM : Google | |
# Tag : android-desktop | |
# --------- | |
# id: 7 or "Nexus 10" | |
# Name: Nexus 10 | |
# OEM : Google | |
# --------- | |
# id: 8 or "Nexus 4" | |
# Name: Nexus 4 | |
# OEM : Google | |
# --------- | |
# id: 9 or "Nexus 5" | |
# Name: Nexus 5 | |
# OEM : Google | |
# --------- | |
# id: 10 or "Nexus 5X" | |
# Name: Nexus 5X | |
# OEM : Google | |
# --------- | |
# id: 11 or "Nexus 6" | |
# Name: Nexus 6 | |
# OEM : Google | |
# --------- | |
# id: 12 or "Nexus 6P" | |
# Name: Nexus 6P | |
# OEM : Google | |
# --------- | |
# id: 13 or "Nexus 7 2013" | |
# Name: Nexus 7 | |
# OEM : Google | |
# --------- | |
# id: 14 or "Nexus 7" | |
# Name: Nexus 7 (2012) | |
# OEM : Google | |
# --------- | |
# id: 15 or "Nexus 9" | |
# Name: Nexus 9 | |
# OEM : Google | |
# --------- | |
# id: 16 or "Nexus One" | |
# Name: Nexus One | |
# OEM : Google | |
# --------- | |
# id: 17 or "Nexus S" | |
# Name: Nexus S | |
# OEM : Google | |
# --------- | |
# id: 18 or "pixel" | |
# Name: Pixel | |
# OEM : Google | |
# --------- | |
# id: 19 or "pixel_2" | |
# Name: Pixel 2 | |
# OEM : Google | |
# --------- | |
# id: 20 or "pixel_2_xl" | |
# Name: Pixel 2 XL | |
# OEM : Google | |
# --------- | |
# id: 21 or "pixel_3" | |
# Name: Pixel 3 | |
# OEM : Google | |
# --------- | |
# id: 22 or "pixel_3_xl" | |
# Name: Pixel 3 XL | |
# OEM : Google | |
# OEM : Generic | |
# --------- | |
# id: 47 or "4in WVGA (Nexus S)" | |
# Name: 4" WVGA (Nexus S) | |
# OEM : Generic | |
# --------- | |
# id: 48 or "4.65in 720p (Galaxy Nexus)" | |
# Name: 4.65" 720p (Galaxy Nexus) | |
# OEM : Generic | |
# --------- | |
# id: 49 or "4.7in WXGA" | |
# Name: 4.7" WXGA | |
# OEM : Generic | |
# --------- | |
# id: 50 or "5.1in WVGA" | |
# Name: 5.1" WVGA | |
# OEM : Generic | |
# --------- | |
# id: 51 or "5.4in FWVGA" | |
# Name: 5.4" FWVGA | |
# OEM : Generic | |
# --------- | |
# id: 52 or "6.7in Foldable" | |
# Name: 6.7" Horizontal Fold-in | |
# OEM : Generic | |
# --------- | |
# id: 53 or "7in WSVGA (Tablet)" | |
# Name: 7" WSVGA (Tablet) | |
# OEM : Generic | |
# --------- | |
# id: 54 or "7.4in Rollable" | |
# Name: 7.4" Rollable | |
# OEM : Generic | |
# --------- | |
# id: 55 or "7.6in Foldable" | |
# Name: 7.6" Fold-in with outer display | |
# OEM : Generic | |
# --------- | |
# id: 56 or "8in Foldable" | |
# Name: 8" Fold-out | |
# OEM : Generic | |
# --------- | |
# id: 57 or "10.1in WXGA (Tablet)" | |
# Name: 10.1" WXGA (Tablet) | |
# OEM : Generic | |
# --------- | |
# id: 58 or "13.5in Freeform" | |
# Name: 13.5" Freeform | |
# OEM : Generic |