Update nightly-android.yml

This commit is contained in:
Harshit Dagar 2025-03-17 10:39:49 +05:30 committed by GitHub
commit ba920b17aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,7 +4,6 @@ on:
# Automatically run at the end of every day. # Automatically run at the end of every day.
schedule: schedule:
- cron: '0 0 * * *' - cron: '0 0 * * *'
# Manual trigger # Manual trigger
workflow_dispatch: workflow_dispatch:
@ -20,13 +19,14 @@ concurrency:
jobs: jobs:
CI: CI:
# Use an Ubuntu runner with ARM support.
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
if: github.repository != 'LadybirdBrowser/ladybird' if: github.repository == 'LadybirdBrowser/ladybird'
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os_name: ['Android'] os_name: ['Android']
os: [macos-14] os: [ubuntu-24.04-arm]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -50,7 +50,7 @@ jobs:
- name: Restore Caches - name: Restore Caches
uses: ./.github/actions/cache-restore uses: ./.github/actions/cache-restore
id: 'cache-restore' id: cache-restore
with: with:
os: ${{ matrix.os_name }} os: ${{ matrix.os_name }}
arch: 'Lagom' arch: 'Lagom'
@ -59,10 +59,10 @@ jobs:
download_cache_path: ${{ github.workspace }}/Build/caches download_cache_path: ${{ github.workspace }}/Build/caches
- name: Assign Build Parameters - name: Assign Build Parameters
id: 'build-parameters' id: build-parameters
run: | run: |
echo "host_cc=$(xcrun --find clang)" >> "$GITHUB_OUTPUT" echo "host_cc=$(which clang)" >> "$GITHUB_OUTPUT"
echo "host_cxx=$(xcrun --find clang++)" >> "$GITHUB_OUTPUT" echo "host_cxx=$(which clang++)" >> "$GITHUB_OUTPUT"
- name: Install NDK - name: Install NDK
run: | run: |
@ -72,11 +72,11 @@ jobs:
- name: Start Android Emulator - name: Start Android Emulator
run: | run: |
# Install AVD files # Install ARM64 AVD system image
echo "y" | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-30;google_apis;x86_64' echo "y" | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-30;google_apis;arm64-v8a'
# Create emulator # Create emulator using the ARM64 image
echo "no" | ${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager create avd -n xamarin_android_emulator -k 'system-images;android-30;google_apis;x86_64' --force echo "no" | ${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager create avd -n xamarin_android_emulator -k 'system-images;android-30;google_apis;arm64-v8a' --force
${ANDROID_HOME}/emulator/emulator -list-avds ${ANDROID_HOME}/emulator/emulator -list-avds
@ -84,7 +84,7 @@ jobs:
# Start emulator in background # Start emulator in background
nohup ${ANDROID_HOME}/emulator/emulator -avd xamarin_android_emulator -no-snapshot > /dev/null 2>&1 & nohup ${ANDROID_HOME}/emulator/emulator -avd xamarin_android_emulator -no-snapshot > /dev/null 2>&1 &
${ANDROID_HOME}/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82' ${ANDROID_HOME}/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d "\r") ]]; do sleep 1; done; input keyevent 82'
${ANDROID_HOME}/platform-tools/adb devices ${ANDROID_HOME}/platform-tools/adb devices
echo "Emulator started" echo "Emulator started"
@ -94,7 +94,7 @@ jobs:
working-directory: ${{ github.workspace }}/UI/Android working-directory: ${{ github.workspace }}/UI/Android
run: ./gradlew connectedAndroidTest run: ./gradlew connectedAndroidTest
env: env:
SERENITY_CACHE_DIR: ${{ github.workspace }}/Build/caches # No memory limits SERENITY_CACHE_DIR: ${{ github.workspace }}/Build/caches
- name: Save Caches - name: Save Caches
uses: ./.github/actions/cache-save uses: ./.github/actions/cache-save