Skip to content

Commit 2a56800

Browse files
Haz3-joltmikehardy
authored andcommitted
CI test for 16kb and non-16kb page alignment
1 parent bbfd768 commit 2a56800

1 file changed

Lines changed: 49 additions & 1 deletion

File tree

.github/workflows/tests_emulator.yml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
// These are used for performance tuning what emulator to use.
6767
// try different architectures, targets, delays etc
6868
let arch = ['x86_64'];
69-
let target = ['google_apis'];
69+
let target = ['google_apis', 'google_apis_ps16k'];
7070
let firstBootDelay = [600];
7171
7272
return {
@@ -217,6 +217,54 @@ jobs:
217217
sleep 5
218218
./gradlew uninstallAll jacocoAndroidTestReport --daemon
219219
220+
- name: Configure NDK tools PATH for alignment checking
221+
run: |
222+
echo "Using pre-installed NDK tools for alignment checking"
223+
if [ ! -d "$ANDROID_NDK_LATEST_HOME" ]; then
224+
echo "Error: NDK tools not found at $ANDROID_NDK_LATEST_HOME"
225+
echo "The NDK should be pre-installed in the runner image. Failing fast."
226+
exit 1
227+
fi
228+
229+
NDK_VERSION=$(basename $ANDROID_NDK_LATEST_HOME)
230+
echo "Using NDK version: $NDK_VERSION"
231+
echo "export PATH=$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH" >> $GITHUB_ENV
232+
233+
- name: Check APK ELF Alignment
234+
run: |
235+
chmod +x .github/check_elf_alignment.sh
236+
APK_PATH="AnkiDroid/build/outputs/apk/play/release/AnkiDroid-play-arm64-v8a-release.apk"
237+
238+
if [ ! -f "$APK_PATH" ]; then
239+
echo "Error: APK file not found at $APK_PATH"
240+
echo "The APK should have been built in previous steps. Failing fast."
241+
exit 1
242+
fi
243+
244+
echo "Using APK: $APK_PATH"
245+
.github/check_elf_alignment.sh $APK_PATH
246+
247+
- name: Verify zipalign
248+
run: |
249+
APK_PATH="AnkiDroid/build/outputs/apk/play/release/AnkiDroid-play-arm64-v8a-release.apk"
250+
echo "Verifying zipalign with 16KB alignment for $APK_PATH"
251+
252+
# Find the latest build-tools version dynamically
253+
LATEST_BUILD_TOOLS=$(ls -d $ANDROID_HOME/build-tools/* | sort -V | tail -n 1)
254+
ZIPALIGN_PATH="$LATEST_BUILD_TOOLS/zipalign"
255+
echo "Using zipalign at: $ZIPALIGN_PATH"
256+
257+
# Verify zipalign exists
258+
if [ ! -f "$ZIPALIGN_PATH" ]; then
259+
echo "Error: zipalign not found at $ZIPALIGN_PATH"
260+
echo "Available build-tools versions:"
261+
ls -la $ANDROID_HOME/build-tools/
262+
exit 1
263+
fi
264+
265+
# Use the zipalign tool
266+
$ZIPALIGN_PATH -c -P 16 -v 4 $APK_PATH
267+
220268
- name: Upload Test Report
221269
uses: actions/upload-artifact@v5
222270
if: always()

0 commit comments

Comments
 (0)