From ffc1e38e48e3c899ef00ea9a33ed7180e77e06fc Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Wed, 10 Apr 2024 02:56:23 -0700 Subject: [PATCH] Add 32 bit CI --- .github/workflows/build.yml | 39 ++++++++++++++++++++++++++++++++++++- scripts/avd_test.sh | 28 ++++++++++++++++---------- 2 files changed, 56 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b294c5bb6..a32c7f6c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,7 +82,7 @@ jobs: run: ./gradlew --stop test: - name: Test on API ${{ matrix.api }} + name: Test x86_64 on API ${{ matrix.api }} runs-on: ubuntu-latest needs: build strategy: @@ -115,3 +115,40 @@ jobs: - name: AVD test run: scripts/avd_test.sh ${{ matrix.api }} + + test-32: + name: Test x86 on API ${{ matrix.api }} + runs-on: ubuntu-latest + needs: build + strategy: + fail-fast: false + matrix: + api: [23, 24, 25, 26, 27, 28, 29, 30] + + steps: + - name: Check out + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python 3 + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: ${{ github.sha }} + path: out + + - 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: AVD test + env: + FORCE_32_BIT: 1 + run: scripts/avd_test.sh ${{ matrix.api }} diff --git a/scripts/avd_test.sh b/scripts/avd_test.sh index 94f7b5c8d..82488601d 100755 --- a/scripts/avd_test.sh +++ b/scripts/avd_test.sh @@ -10,20 +10,13 @@ emu_pid= export PATH="$PATH:$ANDROID_SDK_ROOT/platform-tools" -# We test at least these API levels for the following reason - -# API 23: legacy rootfs w/o Treble -# API 26: legacy rootfs with Treble -# API 28: legacy system-as-root -# API 29: 2 Stage Init -# API 34: latest Android - -api_list='23 26 28 29 34' - +min_api=23 +max_api=34 atd_min_api=30 atd_max_api=34 lsposed_min_api=27 huge_ram_min_api=26 +i386_max_api=30 print_title() { echo -e "\n\033[44;39m${1}\033[0m\n" @@ -222,6 +215,21 @@ case $(uname -m) in ;; esac +if [ -n "$FORCE_32_BIT" ]; then + case $arch in + 'arm64-v8a') + echo "! ARM32 is not supported" + exit 1 + ;; + 'x86_64') + arch=x86 + max_api=$i386_max_api + ;; + esac +fi + +api_list=$(seq $min_api $max_api) + yes | "$sdk" --licenses > /dev/null curl -L $lsposed_url -o out/lsposed.zip "$sdk" --channel=3 tools platform-tools emulator