Boost UX improvements #31
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| env: | |
| TERM: xterm-256color | |
| FORCE_COLOR: 1 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| if: github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "17" | |
| distribution: "adopt" | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Decode google-services.json | |
| run: echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 -d > app/google-services.json | |
| env: | |
| GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }} | |
| - name: Build debug app | |
| env: | |
| CHATWOOT_API: ${{ secrets.CHATWOOT_API }} | |
| E2E: true | |
| run: ./gradlew assembleDevDebug | |
| - name: Rename APK | |
| run: | | |
| apk=$(find app/build/outputs/apk/dev/debug -name 'bitkit-android-*-devDebug.apk') | |
| mv "$apk" app/build/outputs/apk/dev/debug/bitkit_e2e.apk | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bitkit-e2e-apk_${{ github.run_number }} | |
| path: app/build/outputs/apk/dev/debug/bitkit_e2e.apk | |
| e2e-tests: | |
| if: github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Clone E2E tests | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: synonymdev/bitkit-e2e-tests | |
| path: bitkit-e2e-tests | |
| - 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 APK | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: bitkit-e2e-apk_${{ github.run_number }} | |
| path: bitkit-e2e-tests/aut | |
| - name: List APK directory contents | |
| run: ls -l bitkit-e2e-tests/aut | |
| - 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: Run regtest setup | |
| working-directory: bitkit-e2e-tests | |
| run: | | |
| cd docker | |
| mkdir lnd && chmod 777 lnd | |
| docker compose pull --quiet | |
| docker compose up -d | |
| - name: Wait for electrum server and LND | |
| working-directory: bitkit-e2e-tests | |
| timeout-minutes: 10 | |
| run: | | |
| while ! nc -z '127.0.0.1' 60001; do sleep 1; done | |
| sudo bash -c "while [ ! -f docker/lnd/data/chain/bitcoin/regtest/admin.macaroon ]; do sleep 1; done" | |
| sudo chmod -R 777 docker/lnd | |
| - name: Run E2E Tests | |
| 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-back none -camera-front none | |
| script: | | |
| # adb port forwarding for regtest | |
| adb reverse tcp:60001 tcp:60001 | |
| cd bitkit-e2e-tests && npm run e2e:android -- --mochaOpts.grep "Can start onboarding" | |
| env: | |
| RECORD_VIDEO: true | |
| - name: Upload E2E Artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: e2e-artifacts_${{ github.run_number }} | |
| path: bitkit-e2e-tests/artifacts/ | |
| - name: Dump docker logs on failure | |
| if: failure() | |
| uses: jwalton/gh-docker-logs@v2 |