Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to fix CI/CD timeouts #17

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,42 @@ jobs:
name: build-artifacts
path: ./app/build/outputs/
test:
runs-on: macos-latest
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [33]
steps:
- name: Delete unnecessary tools 🔧
uses: jlumbroso/[email protected]
with:
android: false # Don't remove Android tools
tool-cache: true # Remove image tool cache - rm -rf "$AGENT_TOOLSDIRECTORY"
dotnet: true # rm -rf /usr/share/dotnet
haskell: true # rm -rf /opt/ghc...
swap-storage: true # rm -f /mnt/swapfile (4GiB)
docker-images: false # Takes 16s, enable if needed in the future
large-packages: false # includes google-cloud-sdk and it's slow

- 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
ls /dev/kvm

- name: checkout
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Gradle cache
uses: gradle/gradle-build-action@v2

- name: AVD cache
uses: actions/cache@v3
id: avd-cache
Expand All @@ -85,6 +106,7 @@ jobs:
~/.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
Expand All @@ -94,8 +116,11 @@ jobs:
target: google_apis
arch: x86_64
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
disable-animations: true
disk-size: 6000M
heap-size: 600M
script: echo "Generated AVD snapshot for caching."

- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
Expand All @@ -106,6 +131,7 @@ jobs:
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: gradle connectedCheck --scan

- name: Archive test reports
uses: actions/upload-artifact@v3
if: success() || failure()
Expand Down
Loading