Skip to content

Save disk space

Save disk space #345

Workflow file for this run

name: Tests
on:
- push
- pull_request
jobs:
android:
name: Android
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [31]
# api-level: [31, 32, 33, 34]
steps:
- uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: false
# large-packages: true
# swap-storage: true
- 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: avd-${{ 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: ${{ 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: ${{ 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