diff --git a/.github/workflows/functional-test.yml b/.github/workflows/functional-test.yml index 682618c40..d13c69b9d 100644 --- a/.github/workflows/functional-test.yml +++ b/.github/workflows/functional-test.yml @@ -15,15 +15,19 @@ jobs: - platformVersion: "11.0" apiLevel: 30 emuTag: google_apis + arch: x86 - platformVersion: "9.0" apiLevel: 28 emuTag: default + arch: x86 - platformVersion: "7.1" apiLevel: 25 emuTag: default + arch: x86 - platformVersion: "5.1" apiLevel: 22 emuTag: default + arch: x86 env: CI: true @@ -32,11 +36,14 @@ jobs: PLATFORM_VERSION: ${{ matrix.platformVersion }} EMU_TAG: ${{ matrix.emuTag }} _FORCE_LOGS: 1 - # No hardware acceleration is available for emulators on Ubuntu: - # https://github.com/marketplace/actions/android-emulator-runner#can-i-use-this-action-on-linux-vms - runs-on: macos-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - 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 - uses: actions/setup-node@v3 with: node-version: lts/* @@ -47,6 +54,28 @@ jobs: with: distribution: 'temurin' java-version: '17' + - name: AVD cache + uses: actions/cache@v3 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-${{ matrix.apiLevel }} + # https://github.com/marketplace/actions/android-emulator-runner + - uses: reactivecircus/android-emulator-runner@v2 + if: steps.avd-cache.outputs.cache-hit != 'true' + name: Generate AVD snapshot for caching + with: + script: echo "Generated AVD snapshot for caching." + avd-name: ${{ env.ANDROID_AVD }} + force-avd-creation: false + api-level: ${{ matrix.apiLevel }} + disable-spellchecker: true + target: ${{ matrix.emuTag }} + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim + arch: ${{ matrix.arch }} + disable-animations: true - run: nohup adb logcat > logcat.log & name: Capture Logcat - uses: reactivecircus/android-emulator-runner@v2 @@ -54,10 +83,13 @@ jobs: with: script: scripts/e2e.sh avd-name: ${{ env.ANDROID_AVD }} - sdcard-path-or-size: 1500M + force-avd-creation: false api-level: ${{ matrix.apiLevel }} disable-spellchecker: true target: ${{ matrix.emuTag }} + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim + arch: ${{ matrix.arch }} + disable-animations: true - name: Save logcat output if: ${{ always() }} uses: actions/upload-artifact@master diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 82fbf2c9d..4b3de4f17 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -7,11 +7,11 @@ jobs: prepare_matrix: runs-on: ubuntu-latest outputs: - versions: ${{ steps.generate-matrix.outputs.versions }} + versions: ${{ steps.generate-matrix.outputs.active }} steps: - - name: Select 3 most recent LTS versions of Node.js + - name: Select all active LTS versions of Node.js id: generate-matrix - run: echo "versions=$(curl -s https://endoflife.date/api/nodejs.json | jq -c '[[.[] | select(.lts != false)][:3] | .[].cycle | tonumber]')" >> "$GITHUB_OUTPUT" + uses: msimerson/node-lts-versions@v1 node_test: needs: @@ -21,7 +21,7 @@ jobs: node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} @@ -33,7 +33,7 @@ jobs: java_test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: lts/*