Add arch to emulator #338
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: Tests | |
on: | |
- push | |
- pull_request | |
jobs: | |
android: | |
name: Android | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- uses: actions/setup-node@v4 | |
- name: Gradle cache | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
# TODO: Remove this after we merge | |
cache-read-only: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/monorepo' }} | |
- name: Setup yarn | |
run: | | |
corepack enable | |
- uses: bahmutov/npm-install@v1 | |
with: | |
install-command: yarn --immutable | |
- name: Build | |
run: | | |
yarn prepare | |
- name: AVD cache | |
uses: actions/cache@v4 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd2 #-${{ matrix.api-level }} | |
- name: create AVD and generate snapshot for caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
profile: pixel_6_pro | |
api-level: 31 #${{ matrix.api-level }} | |
arch: x86_64 | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
script: echo "Generated AVD snapshot for caching." | |
- 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: Run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
profile: pixel_6_pro | |
api-level: 31 #${{ matrix.api-level }} | |
arch: x86_64 | |
force-avd-creation: false | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: cd packages/icon-explorer && yarn test | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-results | |
path: e2e/output | |
- uses: dorny/test-reporter@v1 | |
if: always() | |
with: | |
artifact: test-results | |
name: JEST Tests | |
path: e2e/output/*.xml | |
reporter: jest-junit |