Skip to content

Commit

Permalink
ci: switch to ubuntu and run tests on API 34 as well (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishb authored Apr 7, 2024
1 parent d306c3e commit 8ff4c94
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/adbe-unittests-api32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:

jobs:
testOnApi32:
runs-on: macos-latest
runs-on: ubuntu-latest
timeout-minutes: 30

strategy:
Expand All @@ -30,6 +30,12 @@ jobs:
- name: checkout
uses: actions/checkout@v4

- name: Enable KVM
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: Gradle cache
uses: gradle/gradle-build-action@v3

Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/adbe-unittests-api34.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
name: AdbeUnitTests-Api34

on:
schedule:
- cron: '0 0 * * 0' # Sunday midnight UTC
pull_request:
branches: [master, main]
paths:
- '.github/workflows/adbe-unittests-api34.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
testOnApi34:
runs-on: ubuntu-latest
timeout-minutes: 30

strategy:
matrix:
api-level: [34]
# API 30+ emulators only have x86_64 system images.
arch: ["x86_64"]
# "default" is not available
target: ["google_apis"]

steps:
- name: checkout
uses: actions/checkout@v4

- name: Enable KVM
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: Gradle cache
uses: gradle/gradle-build-action@v3

- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }} - ${{ matrix.arch }} - ${{ matrix.target }}

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
target: ${{ matrix.target }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
target: ${{ matrix.target }}
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: |
python3 -m pip install --upgrade pip
python3 -m pip install --user -r requirements.txt
make test_python3

0 comments on commit 8ff4c94

Please sign in to comment.