feat: android e2e tests #41
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: douglascamata/setup-docker-macos-action@v1-alpha | |
id: docker1 | |
continue-on-error: true | |
- name: Setup Docker Colima 2 | |
if: steps.docker1.outcome != 'success' | |
uses: douglascamata/setup-docker-macos-action@v1-alpha | |
id: docker2 | |
continue-on-error: true | |
- 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: 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: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.17 | |
cache: 'yarn' # cache packages, but not node_modules | |
- 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: 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: kek | |
uses: reactivecircus/android-emulator-runner@v2 | |
continue-on-error: true | |
# id: test1 | |
with: | |
api-level: 31 | |
profile: 5.4in FWVGA | |
# target: google_apis | |
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: | | |
avdmanager list device | |
- name: Yarn Install | |
run: yarn --no-audit --prefer-offline || yarn --no-audit --prefer-offline | |
env: | |
HUSKY: 0 | |
- name: Build | |
run: yarn e2e:build:android-release || yarn e2e:build:android-release | |
- name: Test attempt 1 | |
uses: reactivecircus/android-emulator-runner@v2 | |
# continue-on-error: true | |
id: test1 | |
with: | |
api-level: 31 | |
profile: 5.4in FWVGA | |
# target: google_apis | |
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: | | |
adb root | |
adb reverse tcp:80 tcp:80 | |
adb reverse tcp:8080 tcp:8080 | |
adb reverse tcp:9735 tcp:9735 | |
adb reverse tcp:10009 tcp:10009 | |
adb reverse tcp:28334 tcp:28334 | |
adb reverse tcp:28335 tcp:28335 | |
adb reverse tcp:28336 tcp:28336 | |
adb reverse tcp:39388 tcp:39388 | |
adb reverse tcp:43782 tcp:43782 | |
adb reverse tcp:60001 tcp:60001 | |
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all || yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all || yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all | |
# - name: Test attempt 2 | |
# uses: reactivecircus/android-emulator-runner@v2 | |
# continue-on-error: true | |
# id: test2 | |
# if: steps.test1.outcome != 'success' | |
# with: | |
# api-level: 31 | |
# profile: 5.4in FWVGA | |
# # target: google_apis | |
# 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: | | |
# adb root | |
# adb reverse tcp:80 tcp:80 | |
# adb reverse tcp:8080 tcp:8080 | |
# adb reverse tcp:9735 tcp:9735 | |
# adb reverse tcp:10009 tcp:10009 | |
# adb reverse tcp:28334 tcp:28334 | |
# adb reverse tcp:28335 tcp:28335 | |
# adb reverse tcp:28336 tcp:28336 | |
# adb reverse tcp:39388 tcp:39388 | |
# adb reverse tcp:43782 tcp:43782 | |
# adb reverse tcp:60001 tcp:60001 | |
# yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all | |
# - name: Test attempt 3 | |
# uses: reactivecircus/android-emulator-runner@v2 | |
# continue-on-error: true | |
# id: test3 | |
# if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' | |
# with: | |
# api-level: 31 | |
# profile: 5.4in FWVGA | |
# # target: google_apis | |
# 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: | | |
# adb root | |
# adb reverse tcp:80 tcp:80 | |
# adb reverse tcp:8080 tcp:8080 | |
# adb reverse tcp:9735 tcp:9735 | |
# adb reverse tcp:10009 tcp:10009 | |
# adb reverse tcp:28334 tcp:28334 | |
# adb reverse tcp:28335 tcp:28335 | |
# adb reverse tcp:28336 tcp:28336 | |
# adb reverse tcp:39388 tcp:39388 | |
# adb reverse tcp:43782 tcp:43782 | |
# adb reverse tcp:60001 tcp:60001 | |
# yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all | |
# - name: Test attempt 4 | |
# uses: reactivecircus/android-emulator-runner@v2 | |
# if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' && steps.test3.outcome != 'success' | |
# with: | |
# api-level: 31 | |
# profile: 5.4in FWVGA | |
# # target: google_apis | |
# avd-name: Pixel_API_31_AOSP | |
# force-avd-creation: true | |
# 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: | | |
# adb root | |
# adb reverse tcp:80 tcp:80 | |
# adb reverse tcp:8080 tcp:8080 | |
# adb reverse tcp:9735 tcp:9735 | |
# adb reverse tcp:10009 tcp:10009 | |
# adb reverse tcp:28334 tcp:28334 | |
# adb reverse tcp:28335 tcp:28335 | |
# adb reverse tcp:28336 tcp:28336 | |
# adb reverse tcp:39388 tcp:39388 | |
# adb reverse tcp:43782 tcp:43782 | |
# adb reverse tcp:60001 tcp:60001 | |
# yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all | |
- 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 |