mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-24 16:17:39 +00:00
Test all APIs on Linux
This commit is contained in:
parent
308c9999fa
commit
74b7b84561
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@ -101,13 +101,13 @@ jobs:
|
|||||||
compression-level: 9
|
compression-level: 9
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: Test on ${{ matrix.api }}
|
name: Test on API ${{ matrix.api }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
api: [23, 26, 28, 29, 34]
|
api: [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out
|
- name: Check out
|
||||||
@ -116,7 +116,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Python 3
|
- name: Set up Python 3
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.x"
|
python-version: "3.x"
|
||||||
|
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
emu="$ANDROID_SDK_ROOT/emulator/emulator"
|
emu="$ANDROID_SDK_ROOT/emulator/emulator"
|
||||||
avd="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager"
|
avd="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager"
|
||||||
sdk="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager"
|
sdk="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager"
|
||||||
emu_args='-no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -read-only -no-snapshot -show-kernel -memory 8192'
|
emu_args_base='-no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -read-only -no-snapshot -show-kernel -memory $memory'
|
||||||
lsposed_url='https://github.com/LSPosed/LSPosed/releases/download/v1.9.2/LSPosed-v1.9.2-7024-zygisk-release.zip'
|
lsposed_url='https://github.com/LSPosed/LSPosed/releases/download/v1.9.2/LSPosed-v1.9.2-7024-zygisk-release.zip'
|
||||||
boot_timeout=600
|
boot_timeout=600
|
||||||
emu_pid=
|
emu_pid=
|
||||||
|
|
||||||
export PATH="$PATH:$ANDROID_SDK_ROOT/platform-tools"
|
export PATH="$PATH:$ANDROID_SDK_ROOT/platform-tools"
|
||||||
|
|
||||||
# We test these API levels for the following reason
|
# We test at least these API levels for the following reason
|
||||||
|
|
||||||
# API 23: legacy rootfs w/o Treble
|
# API 23: legacy rootfs w/o Treble
|
||||||
# API 26: legacy rootfs with Treble
|
# API 26: legacy rootfs with Treble
|
||||||
@ -23,6 +23,7 @@ api_list='23 26 28 29 34'
|
|||||||
atd_min_api=30
|
atd_min_api=30
|
||||||
atd_max_api=34
|
atd_max_api=34
|
||||||
lsposed_min_api=27
|
lsposed_min_api=27
|
||||||
|
huge_ram_min_api=26
|
||||||
|
|
||||||
print_title() {
|
print_title() {
|
||||||
echo -e "\n\033[44;39m${1}\033[0m\n"
|
echo -e "\n\033[44;39m${1}\033[0m\n"
|
||||||
@ -74,11 +75,19 @@ wait_for_boot() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_api_env() {
|
set_api_env() {
|
||||||
|
local memory
|
||||||
local type='default'
|
local type='default'
|
||||||
if [ $1 -ge $atd_min_api -a $1 -le $atd_max_api ]; then
|
if [ $1 -ge $atd_min_api -a $1 -le $atd_max_api ]; then
|
||||||
# Use the lightweight ATD images if possible
|
# Use the lightweight ATD images if possible
|
||||||
type='aosp_atd'
|
type='aosp_atd'
|
||||||
fi
|
fi
|
||||||
|
# Old Linux kernels will not boot with memory larger than 3GB
|
||||||
|
if [ $1 -lt $huge_ram_min_api ]; then
|
||||||
|
memory=3072
|
||||||
|
else
|
||||||
|
memory=8192
|
||||||
|
fi
|
||||||
|
eval emu_args=\"$emu_args_base\"
|
||||||
pkg="system-images;android-$1;$type;$arch"
|
pkg="system-images;android-$1;$type;$arch"
|
||||||
local img_dir="$ANDROID_SDK_ROOT/system-images/android-$1/$type/$arch"
|
local img_dir="$ANDROID_SDK_ROOT/system-images/android-$1/$type/$arch"
|
||||||
ramdisk="$img_dir/ramdisk.img"
|
ramdisk="$img_dir/ramdisk.img"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user