diff --git a/.github/workflows/adbe-unittests-api16.yml b/.github/workflows/adbe-unittests-api16.yml index 2ceafdc..a5a51f9 100644 --- a/.github/workflows/adbe-unittests-api16.yml +++ b/.github/workflows/adbe-unittests-api16.yml @@ -24,7 +24,7 @@ concurrency: jobs: testOnAndroidApi16: - runs-on: macos-latest + runs-on: ubuntu-latest # This test is slower compared to the other tests timeout-minutes: 20 @@ -38,6 +38,13 @@ jobs: - name: checkout uses: actions/checkout@v4 + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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 diff --git a/.github/workflows/adbe-unittests-api21.yml b/.github/workflows/adbe-unittests-api21.yml index 44cf0fb..437e781 100644 --- a/.github/workflows/adbe-unittests-api21.yml +++ b/.github/workflows/adbe-unittests-api21.yml @@ -14,7 +14,7 @@ concurrency: jobs: test: - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 15 strategy: @@ -26,6 +26,13 @@ jobs: - name: checkout uses: actions/checkout@v4 + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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 diff --git a/.github/workflows/adbe-unittests-api22.yml b/.github/workflows/adbe-unittests-api22.yml index 9fe06b2..8f6412f 100644 --- a/.github/workflows/adbe-unittests-api22.yml +++ b/.github/workflows/adbe-unittests-api22.yml @@ -14,7 +14,7 @@ concurrency: jobs: testOnApi22: - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 15 strategy: @@ -26,6 +26,13 @@ jobs: - name: checkout uses: actions/checkout@v4 + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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 diff --git a/.github/workflows/adbe-unittests-api23.yml b/.github/workflows/adbe-unittests-api23.yml index 26a8307..da82709 100644 --- a/.github/workflows/adbe-unittests-api23.yml +++ b/.github/workflows/adbe-unittests-api23.yml @@ -14,7 +14,7 @@ concurrency: jobs: testOnAp23: - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 15 strategy: @@ -26,6 +26,13 @@ jobs: - name: checkout uses: actions/checkout@v4 + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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 diff --git a/.github/workflows/adbe-unittests-api24.yml b/.github/workflows/adbe-unittests-api24.yml index aaf8b7e..cb40596 100644 --- a/.github/workflows/adbe-unittests-api24.yml +++ b/.github/workflows/adbe-unittests-api24.yml @@ -14,7 +14,7 @@ concurrency: jobs: testOnApi24: - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 15 strategy: @@ -29,6 +29,13 @@ jobs: - name: Gradle cache uses: gradle/gradle-build-action@v3 + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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: AVD cache uses: actions/cache@v4 id: avd-cache diff --git a/.github/workflows/adbe-unittests-api25.yml b/.github/workflows/adbe-unittests-api25.yml index 6f5cca1..f7d7881 100644 --- a/.github/workflows/adbe-unittests-api25.yml +++ b/.github/workflows/adbe-unittests-api25.yml @@ -14,7 +14,7 @@ concurrency: jobs: testOnApi25: - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 15 strategy: @@ -26,6 +26,13 @@ jobs: - name: checkout uses: actions/checkout@v4 + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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 diff --git a/.github/workflows/adbe-unittests-api26.yml b/.github/workflows/adbe-unittests-api26.yml index d32fb20..07efd49 100644 --- a/.github/workflows/adbe-unittests-api26.yml +++ b/.github/workflows/adbe-unittests-api26.yml @@ -14,7 +14,7 @@ concurrency: jobs: testOnApi26: - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 15 strategy: @@ -26,6 +26,13 @@ jobs: - name: checkout uses: actions/checkout@v4 + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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 diff --git a/.github/workflows/adbe-unittests-api27.yml b/.github/workflows/adbe-unittests-api27.yml index 8129fed..6b6d5be 100644 --- a/.github/workflows/adbe-unittests-api27.yml +++ b/.github/workflows/adbe-unittests-api27.yml @@ -14,7 +14,7 @@ concurrency: jobs: testOnApi27: - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 15 strategy: @@ -26,6 +26,13 @@ jobs: - name: checkout uses: actions/checkout@v4 + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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 diff --git a/.github/workflows/adbe-unittests-api28.yml b/.github/workflows/adbe-unittests-api28.yml index 5689af1..a8a6e09 100644 --- a/.github/workflows/adbe-unittests-api28.yml +++ b/.github/workflows/adbe-unittests-api28.yml @@ -14,7 +14,7 @@ concurrency: jobs: testOnApi28: - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 15 strategy: @@ -26,6 +26,13 @@ jobs: - name: checkout uses: actions/checkout@v4 + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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 diff --git a/.github/workflows/adbe-unittests-api29.yml b/.github/workflows/adbe-unittests-api29.yml index 2cbc762..578e1d4 100644 --- a/.github/workflows/adbe-unittests-api29.yml +++ b/.github/workflows/adbe-unittests-api29.yml @@ -14,7 +14,7 @@ concurrency: jobs: testOnApi29: - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 15 strategy: @@ -26,6 +26,13 @@ jobs: - name: checkout uses: actions/checkout@v4 + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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 diff --git a/.github/workflows/adbe-unittests-api30.yml b/.github/workflows/adbe-unittests-api30.yml index c85dcc5..f60bc10 100644 --- a/.github/workflows/adbe-unittests-api30.yml +++ b/.github/workflows/adbe-unittests-api30.yml @@ -15,7 +15,7 @@ concurrency: jobs: testOnApi30: - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 15 strategy: @@ -29,6 +29,13 @@ jobs: - name: checkout uses: actions/checkout@v4 + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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 diff --git a/.github/workflows/adbe-unittests-api31.yml b/.github/workflows/adbe-unittests-api31.yml index 1351de9..8421792 100644 --- a/.github/workflows/adbe-unittests-api31.yml +++ b/.github/workflows/adbe-unittests-api31.yml @@ -15,7 +15,7 @@ concurrency: jobs: testOnApi31: - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 15 strategy: @@ -29,6 +29,13 @@ jobs: - name: checkout uses: actions/checkout@v4 + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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 diff --git a/.github/workflows/adbe-unittests-api32.yml b/.github/workflows/adbe-unittests-api32.yml index ae09455..5537c3b 100644 --- a/.github/workflows/adbe-unittests-api32.yml +++ b/.github/workflows/adbe-unittests-api32.yml @@ -15,7 +15,7 @@ concurrency: jobs: testOnApi32: - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 30 strategy: @@ -30,6 +30,13 @@ jobs: - name: checkout uses: actions/checkout@v4 + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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 diff --git a/.github/workflows/adbe-unittests-api33.yml b/.github/workflows/adbe-unittests-api33.yml index 111f972..e863557 100644 --- a/.github/workflows/adbe-unittests-api33.yml +++ b/.github/workflows/adbe-unittests-api33.yml @@ -16,7 +16,7 @@ concurrency: jobs: testOnApi33: - runs-on: macos-latest + runs-on: ubuntu-latest # This test is slow timeout-minutes: 30 @@ -32,6 +32,13 @@ jobs: - name: checkout uses: actions/checkout@v4 + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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 diff --git a/.github/workflows/adbe-unittests-api34.yml b/.github/workflows/adbe-unittests-api34.yml new file mode 100644 index 0000000..cde7ad0 --- /dev/null +++ b/.github/workflows/adbe-unittests-api34.yml @@ -0,0 +1,76 @@ +--- +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 + + # Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners + - 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 diff --git a/.github/workflows/adbe-unittests.yml b/.github/workflows/adbe-unittests.yml index e8ccd0c..f50c3e0 100644 --- a/.github/workflows/adbe-unittests.yml +++ b/.github/workflows/adbe-unittests.yml @@ -24,7 +24,7 @@ concurrency: jobs: unittestsApi21And26: - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 30 strategy: diff --git a/.github/workflows/install-adb-enhanced-from-homebrew.yml b/.github/workflows/install-adb-enhanced-from-homebrew.yml index 5172a79..b14d709 100644 --- a/.github/workflows/install-adb-enhanced-from-homebrew.yml +++ b/.github/workflows/install-adb-enhanced-from-homebrew.yml @@ -27,8 +27,6 @@ jobs: - name: Install adb-enhanced from homebrew run: | - # TODO(ashishb): Remove update after Aug 1, 2023 - brew update || echo "brew update failed, still proceeding" brew link --force python@3.11 HOMEBREW_NO_INSTALL_CLEANUP=true brew install --verbose adb-enhanced || echo "brew install returned non-zero exit code" adbe --version diff --git a/README.md b/README.md index eb9ba9b..4703539 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ A command-line interface to trigger various scenarios like screen rotation, batt [![AdbeUnitTests-Api31](https://github.com/ashishb/adb-enhanced/actions/workflows/adbe-unittests-api31.yml/badge.svg)](https://github.com/ashishb/adb-enhanced/actions/workflows/adbe-unittests-api31.yml) [![AdbeUnitTests-Api32](https://github.com/ashishb/adb-enhanced/actions/workflows/adbe-unittests-api32.yml/badge.svg)](https://github.com/ashishb/adb-enhanced/actions/workflows/adbe-unittests-api32.yml) [![AdbeUnitTests-Api33](https://github.com/ashishb/adb-enhanced/actions/workflows/adbe-unittests-api33.yml/badge.svg)](https://github.com/ashishb/adb-enhanced/actions/workflows/adbe-unittests-api33.yml) +[![AdbeUnitTests-Api34](https://github.com/ashishb/adb-enhanced/actions/workflows/adbe-unittests-api34.yml/badge.svg)](https://github.com/ashishb/adb-enhanced/actions/workflows/adbe-unittests-api34.yml) [![asciicast](https://asciinema.org/a/0IhbOF6QNIhBlgtO6VgzNmTbK.png)](https://asciinema.org/a/0IhbOF6QNIhBlgtO6VgzNmTbK)