|
| 1 | +name: e2e-android |
| 2 | + |
| 3 | +on: pull_request |
| 4 | + |
| 5 | +env: |
| 6 | + E2E_TESTS: 1 # build without transform-remove-console babel plugin |
| 7 | + DEBUG: 'lnurl* lnurl server' |
| 8 | + |
| 9 | +jobs: |
| 10 | + e2e: |
| 11 | + runs-on: macos-12 |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: Checkout |
| 15 | + uses: actions/checkout@v3 |
| 16 | + with: |
| 17 | + fetch-depth: 1 |
| 18 | + |
| 19 | + - name: Setup Docker Colima 1 |
| 20 | + uses: douglascamata/setup-docker-macos-action@v1-alpha |
| 21 | + id: docker1 |
| 22 | + continue-on-error: true |
| 23 | + |
| 24 | + - name: Setup Docker Colima 2 |
| 25 | + if: steps.docker1.outcome != 'success' |
| 26 | + uses: douglascamata/setup-docker-macos-action@v1-alpha |
| 27 | + id: docker2 |
| 28 | + continue-on-error: true |
| 29 | + |
| 30 | + - name: Setup Docker Default |
| 31 | + if: steps.docker1.outcome != 'success' && steps.docker2.outcome != 'success' |
| 32 | + uses: docker-practice/[email protected] |
| 33 | + timeout-minutes: 30 |
| 34 | + |
| 35 | + - name: Run regtest setup |
| 36 | + run: cd docker && mkdir lnd && chmod 777 lnd && docker-compose up -d |
| 37 | + |
| 38 | + - name: Wait for bitcoind |
| 39 | + timeout-minutes: 2 |
| 40 | + run: while ! nc -z '127.0.0.1' 43782; do sleep 1; done |
| 41 | + |
| 42 | + - name: Wait for electrum server |
| 43 | + timeout-minutes: 2 |
| 44 | + run: while ! nc -z '127.0.0.1' 60001; do sleep 1; done |
| 45 | + |
| 46 | + - name: Setup Node |
| 47 | + uses: actions/setup-node@v3 |
| 48 | + with: |
| 49 | + node-version: 18.17 |
| 50 | + cache: 'yarn' # cache packages, but not node_modules |
| 51 | + |
| 52 | + - name: Activate enviroment variables |
| 53 | + run: cp .env.test.template .env |
| 54 | + |
| 55 | + - name: Activate react-native-skia-stub |
| 56 | + run: patch -p1 < .github/workflows/react-native-skia-stub.patch |
| 57 | + |
| 58 | + - name: Activate Gradle variables |
| 59 | + run: cp .github/workflows/gradle.properties ~/.gradle/gradle.properties |
| 60 | + |
| 61 | + - name: Use specific Java version for sdkmanager to work |
| 62 | + uses: actions/setup-java@v2 |
| 63 | + with: |
| 64 | + distribution: 'temurin' |
| 65 | + java-version: '11' |
| 66 | + |
| 67 | + - name: Yarn Install |
| 68 | + run: yarn --no-audit --prefer-offline || yarn --no-audit --prefer-offline |
| 69 | + env: |
| 70 | + HUSKY: 0 |
| 71 | + |
| 72 | + - name: Build |
| 73 | + run: yarn e2e:build:android-release || yarn e2e:build:android-release |
| 74 | + |
| 75 | + - name: Test attempt 1 |
| 76 | + uses: reactivecircus/android-emulator-runner@v2 |
| 77 | + # continue-on-error: true |
| 78 | + id: test1 |
| 79 | + with: |
| 80 | + api-level: 31 |
| 81 | + avd-name: Pixel_API_31_AOSP |
| 82 | + force-avd-creation: false |
| 83 | + emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 |
| 84 | + arch: x86_64 |
| 85 | + script: | |
| 86 | + adb root |
| 87 | + adb reverse tcp:80 tcp:80 |
| 88 | + adb reverse tcp:8080 tcp:8080 |
| 89 | + adb reverse tcp:9735 tcp:9735 |
| 90 | + adb reverse tcp:10009 tcp:10009 |
| 91 | + adb reverse tcp:28334 tcp:28334 |
| 92 | + adb reverse tcp:28335 tcp:28335 |
| 93 | + adb reverse tcp:28336 tcp:28336 |
| 94 | + adb reverse tcp:39388 tcp:39388 |
| 95 | + adb reverse tcp:43782 tcp:43782 |
| 96 | + adb reverse tcp:60001 tcp:60001 |
| 97 | + yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all |
| 98 | +
|
| 99 | + # - name: Test attempt 2 |
| 100 | + # uses: reactivecircus/android-emulator-runner@v2 |
| 101 | + # continue-on-error: true |
| 102 | + # id: test2 |
| 103 | + # if: steps.test1.outcome != 'success' |
| 104 | + # with: |
| 105 | + # api-level: 31 |
| 106 | + # avd-name: Pixel_API_31_AOSP |
| 107 | + # force-avd-creation: false |
| 108 | + # emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 |
| 109 | + # arch: x86_64 |
| 110 | + # script: | |
| 111 | + # adb root |
| 112 | + # adb reverse tcp:80 tcp:80 |
| 113 | + # adb reverse tcp:8080 tcp:8080 |
| 114 | + # adb reverse tcp:9735 tcp:9735 |
| 115 | + # adb reverse tcp:10009 tcp:10009 |
| 116 | + # adb reverse tcp:28334 tcp:28334 |
| 117 | + # adb reverse tcp:28335 tcp:28335 |
| 118 | + # adb reverse tcp:28336 tcp:28336 |
| 119 | + # adb reverse tcp:39388 tcp:39388 |
| 120 | + # adb reverse tcp:43782 tcp:43782 |
| 121 | + # adb reverse tcp:60001 tcp:60001 |
| 122 | + # yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all |
| 123 | + |
| 124 | + # - name: Test attempt 3 |
| 125 | + # uses: reactivecircus/android-emulator-runner@v2 |
| 126 | + # continue-on-error: true |
| 127 | + # id: test3 |
| 128 | + # if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' |
| 129 | + # with: |
| 130 | + # api-level: 31 |
| 131 | + # avd-name: Pixel_API_31_AOSP |
| 132 | + # force-avd-creation: false |
| 133 | + # emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 |
| 134 | + # arch: x86_64 |
| 135 | + # script: | |
| 136 | + # adb root |
| 137 | + # adb reverse tcp:80 tcp:80 |
| 138 | + # adb reverse tcp:8080 tcp:8080 |
| 139 | + # adb reverse tcp:9735 tcp:9735 |
| 140 | + # adb reverse tcp:10009 tcp:10009 |
| 141 | + # adb reverse tcp:28334 tcp:28334 |
| 142 | + # adb reverse tcp:28335 tcp:28335 |
| 143 | + # adb reverse tcp:28336 tcp:28336 |
| 144 | + # adb reverse tcp:39388 tcp:39388 |
| 145 | + # adb reverse tcp:43782 tcp:43782 |
| 146 | + # adb reverse tcp:60001 tcp:60001 |
| 147 | + # yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all |
| 148 | + |
| 149 | + # - name: Test attempt 4 |
| 150 | + # uses: reactivecircus/android-emulator-runner@v2 |
| 151 | + # if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' && steps.test3.outcome != 'success' |
| 152 | + # with: |
| 153 | + # api-level: 31 |
| 154 | + # avd-name: Pixel_API_31_AOSP |
| 155 | + # force-avd-creation: false |
| 156 | + # emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 |
| 157 | + # arch: x86_64 |
| 158 | + # script: | |
| 159 | + # adb root |
| 160 | + # adb reverse tcp:80 tcp:80 |
| 161 | + # adb reverse tcp:8080 tcp:8080 |
| 162 | + # adb reverse tcp:9735 tcp:9735 |
| 163 | + # adb reverse tcp:10009 tcp:10009 |
| 164 | + # adb reverse tcp:28334 tcp:28334 |
| 165 | + # adb reverse tcp:28335 tcp:28335 |
| 166 | + # adb reverse tcp:28336 tcp:28336 |
| 167 | + # adb reverse tcp:39388 tcp:39388 |
| 168 | + # adb reverse tcp:43782 tcp:43782 |
| 169 | + # adb reverse tcp:60001 tcp:60001 |
| 170 | + # yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all |
| 171 | + |
| 172 | + - uses: actions/upload-artifact@v3 |
| 173 | + if: failure() |
| 174 | + with: |
| 175 | + name: e2e-test-videos |
| 176 | + path: ./artifacts/ |
| 177 | + |
| 178 | + - name: Dump docker logs on failure |
| 179 | + if: failure() |
| 180 | + uses: jwalton/gh-docker-logs@v2 |
0 commit comments