mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-27 12:05:30 +00:00
CI: add avd test
This commit is contained in:
parent
e9f32e4f68
commit
3733c9a091
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@ -106,3 +106,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: ${{ github.sha }}-symbols
|
name: ${{ github.sha }}-symbols
|
||||||
path: app/build/outputs
|
path: app/build/outputs
|
||||||
|
|
||||||
|
- name: AVD test
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
run: |
|
||||||
|
brew install coreutils
|
||||||
|
scripts/avd_test.sh
|
||||||
|
@ -52,7 +52,7 @@ done
|
|||||||
./magiskboot decompress ramdisk.cpio.tmp ramdisk.cpio
|
./magiskboot decompress ramdisk.cpio.tmp ramdisk.cpio
|
||||||
cp ramdisk.cpio ramdisk.cpio.orig
|
cp ramdisk.cpio ramdisk.cpio.orig
|
||||||
|
|
||||||
export KEEPVERITY=false
|
export KEEPVERITY=true
|
||||||
export KEEPFORCEENCRYPT=true
|
export KEEPFORCEENCRYPT=true
|
||||||
|
|
||||||
echo "KEEPVERITY=$KEEPVERITY" > config
|
echo "KEEPVERITY=$KEEPVERITY" > config
|
||||||
@ -67,6 +67,7 @@ fi
|
|||||||
[ $API = "28" ] && echo 'RECOVERYMODE=true' >> config
|
[ $API = "28" ] && echo 'RECOVERYMODE=true' >> config
|
||||||
RANDOMSEED=$(tr -dc 'a-f0-9' < /dev/urandom | head -c 16)
|
RANDOMSEED=$(tr -dc 'a-f0-9' < /dev/urandom | head -c 16)
|
||||||
echo "RANDOMSEED=0x$RANDOMSEED" >> config
|
echo "RANDOMSEED=0x$RANDOMSEED" >> config
|
||||||
|
cat config
|
||||||
|
|
||||||
./magiskboot compress=xz magisk32 magisk32.xz
|
./magiskboot compress=xz magisk32 magisk32.xz
|
||||||
./magiskboot compress=xz magisk64 magisk64.xz
|
./magiskboot compress=xz magisk64 magisk64.xz
|
||||||
@ -86,4 +87,3 @@ echo "RANDOMSEED=0x$RANDOMSEED" >> config
|
|||||||
|
|
||||||
rm -f ramdisk.cpio.orig config magisk*.xz stub.xz
|
rm -f ramdisk.cpio.orig config magisk*.xz stub.xz
|
||||||
./magiskboot compress=gzip ramdisk.cpio ramdisk.cpio.gz
|
./magiskboot compress=gzip ramdisk.cpio ramdisk.cpio.gz
|
||||||
pm install magisk.apk || true
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
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 -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim'
|
emu_args='-no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -show-kernel'
|
||||||
|
|
||||||
# Should be either 'google_apis' or 'default'
|
# Should be either 'google_apis' or 'default'
|
||||||
type='google_apis'
|
type='google_apis'
|
||||||
@ -33,7 +33,7 @@ cleanup() {
|
|||||||
|
|
||||||
wait_for_boot() {
|
wait_for_boot() {
|
||||||
while true; do
|
while true; do
|
||||||
if [ -n "$(adb shell getprop sys.boot_completed)" ]; then
|
if [ "stopped" = "$(adb exec-out getprop init.svc.bootanim)" ]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
@ -68,7 +68,8 @@ run_test() {
|
|||||||
restore_avd
|
restore_avd
|
||||||
"$emu" @test $emu_args &
|
"$emu" @test $emu_args &
|
||||||
pid=$!
|
pid=$!
|
||||||
timeout 60 adb wait-for-device
|
timeout 180 bash -c wait_for_boot
|
||||||
|
|
||||||
./build.py avd_patch -s "$ramdisk"
|
./build.py avd_patch -s "$ramdisk"
|
||||||
kill -INT $pid
|
kill -INT $pid
|
||||||
wait $pid
|
wait $pid
|
||||||
@ -76,8 +77,7 @@ run_test() {
|
|||||||
# Test if it boots properly
|
# Test if it boots properly
|
||||||
"$emu" @test $emu_args &
|
"$emu" @test $emu_args &
|
||||||
pid=$!
|
pid=$!
|
||||||
timeout 60 adb wait-for-device
|
timeout 180 bash -c wait_for_boot
|
||||||
timeout 60 bash -c wait_for_boot
|
|
||||||
|
|
||||||
adb shell magisk -v
|
adb shell magisk -v
|
||||||
kill -INT $pid
|
kill -INT $pid
|
||||||
@ -101,8 +101,8 @@ case $(uname -m) in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Build our executables
|
yes | "$sdk" --licenses
|
||||||
./build.py all
|
"$sdk" --channel=3 --update
|
||||||
|
|
||||||
for api in $api_list; do
|
for api in $api_list; do
|
||||||
set_api_env $api
|
set_api_env $api
|
||||||
|
Loading…
Reference in New Issue
Block a user