-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix android emulator runner error (#12)
* Fix android emulator runner error * Adds free-disk-space action to fix CI and enable KVM on base Linux image
- Loading branch information
Showing
2 changed files
with
40 additions
and
45 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,22 +16,22 @@ jobs: | |
timeout-minutes: 45 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Copy CI gradle.properties | ||
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | ||
|
||
- name: Setup java | ||
uses: actions/setup-java@v3 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
distribution: 'zulu' | ||
java-version: 17 | ||
|
||
- name: Decrypt secrets | ||
run: release/signing-setup.sh ${{ secrets.ENCRYPT_KEY }} | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
uses: gradle/gradle-build-action@v3 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
|
@@ -60,64 +60,59 @@ jobs: | |
timeout-minutes: 70 | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
api-level: [ 22, 26, 31 ] | ||
|
||
env: | ||
TERM: dumb | ||
api-level: [ 22, 26, 30 ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- 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 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Copy CI gradle.properties | ||
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | ||
|
||
- name: Setup java | ||
uses: actions/setup-java@v3 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
distribution: 'zulu' | ||
java-version: 17 | ||
|
||
- name: Decrypt secrets | ||
run: release/signing-setup.sh ${{ secrets.ENCRYPT_KEY }} | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
uses: gradle/gradle-build-action@v3 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
# Determine what emulator image to use. We run all API 28+ emulators using | ||
# the google_apis image | ||
- name: Determine emulator target | ||
id: determine-target | ||
env: | ||
API_LEVEL: ${{ matrix.api-level }} | ||
run: | | ||
TARGET="default" | ||
echo "TARGET=$TARGET" >> $GITHUB_OUTPUT | ||
- name: Determine emulator arch | ||
id: determine-arch | ||
env: | ||
API_LEVEL: ${{ matrix.api-level }} | ||
run: | | ||
ARCH="x86" | ||
if [ "$API_LEVEL" -ge "30" ]; then | ||
ARCH="x86_64" | ||
fi | ||
echo "ARCH=$ARCH" >> $GITHUB_OUTPUT | ||
- name: Build tests | ||
run: ./gradlew assembleDebugAndroidTest --scan | ||
|
||
- name: Run tests | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
arch: ${{ steps.determine-arch.outputs.ARCH }} | ||
target: ${{ steps.determine-target.outputs.TARGET }} | ||
script: ./gradlew connectedDebugAndroidTest | ||
arch: x86_64 | ||
disable-animations: true | ||
disk-size: 6000M | ||
heap-size: 600M | ||
script: ./gradlew connectedDebugAndroidTest --daemon | ||
|
||
- name: Clean secrets | ||
if: always() | ||
|
@@ -149,22 +144,22 @@ jobs: | |
TERM: dumb | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Copy CI gradle.properties | ||
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | ||
|
||
- name: Setup java | ||
uses: actions/setup-java@v3 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
distribution: 'zulu' | ||
java-version: 17 | ||
|
||
- name: Decrypt secrets | ||
run: release/signing-setup.sh ${{ secrets.ENCRYPT_KEY }} | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
uses: gradle/gradle-build-action@v3 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
|
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