@@ -24,15 +24,18 @@ jobs:
2424 strategy :
2525 fail-fast : false
2626 matrix :
27- # Refactor to make these dynamic with a low/high bracket only on schedule, not push
28- # For now this is the latest supported API. Previously API 29 was fastest.
29- # #13695: This was reverted to API 30, 31 was unstable. This should be fixed
30- api-level : [30]
31- arch : [x86_64]
32- target : [google_apis]
33- first-boot-delay : [600]
34- # This is useful for benchmarking, do 0, 1, 2, etc (up to 256 max job-per-matrix limit) for averages
35- iteration : [0]
27+ # Control which API level + target combinations run
28+ include :
29+ - api-level : 30
30+ arch : x86_64
31+ target : google_apis
32+ first-boot-delay : 600
33+ iteration : 0
34+ - api-level : 35
35+ arch : x86_64
36+ target : google_apis
37+ first-boot-delay : 600
38+ iteration : 0
3639 steps :
3740 - name : Free Disk Space (Ubuntu)
3841 uses : insightsengineering/disk-space-reclaimer@v1
@@ -158,6 +161,54 @@ jobs:
158161 sleep 5
159162 ./gradlew uninstallAll jacocoAndroidTestReport --daemon
160163
164+ - name : Configure NDK tools PATH for alignment checking
165+ run : |
166+ echo "Using pre-installed NDK tools for alignment checking"
167+ if [ ! -d "$ANDROID_NDK_LATEST_HOME" ]; then
168+ echo "Error: NDK tools not found at $ANDROID_NDK_LATEST_HOME"
169+ echo "The NDK should be pre-installed in the runner image. Failing fast."
170+ exit 1
171+ fi
172+
173+ NDK_VERSION=$(basename $ANDROID_NDK_LATEST_HOME)
174+ echo "Using NDK version: $NDK_VERSION"
175+ echo "export PATH=$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH" >> $GITHUB_ENV
176+
177+ - name : Check APK ELF Alignment
178+ run : |
179+ chmod +x .github/check_elf_alignment.sh
180+ APK_PATH="AnkiDroid/build/outputs/apk/play/release/AnkiDroid-play-arm64-v8a-release.apk"
181+
182+ if [ ! -f "$APK_PATH" ]; then
183+ echo "Error: APK file not found at $APK_PATH"
184+ echo "The APK should have been built in previous steps. Failing fast."
185+ exit 1
186+ fi
187+
188+ echo "Using APK: $APK_PATH"
189+ .github/check_elf_alignment.sh $APK_PATH
190+
191+ - name : Verify zipalign
192+ run : |
193+ APK_PATH="AnkiDroid/build/outputs/apk/play/release/AnkiDroid-play-arm64-v8a-release.apk"
194+ echo "Verifying zipalign with 16KB alignment for $APK_PATH"
195+
196+ # Find the latest build-tools version dynamically
197+ LATEST_BUILD_TOOLS=$(ls -d $ANDROID_HOME/build-tools/* | sort -V | tail -n 1)
198+ ZIPALIGN_PATH="$LATEST_BUILD_TOOLS/zipalign"
199+ echo "Using zipalign at: $ZIPALIGN_PATH"
200+
201+ # Verify zipalign exists
202+ if [ ! -f "$ZIPALIGN_PATH" ]; then
203+ echo "Error: zipalign not found at $ZIPALIGN_PATH"
204+ echo "Available build-tools versions:"
205+ ls -la $ANDROID_HOME/build-tools/
206+ exit 1
207+ fi
208+
209+ # Use the zipalign tool
210+ $ZIPALIGN_PATH -c -P 16 -v 4 $APK_PATH
211+
161212 - name : Upload Test Report
162213 uses : actions/upload-artifact@v4
163214 if : always()
0 commit comments