CI: Move the nightly Android CI to GitHub actions

This commit is contained in:
Timothy Flynn 2024-05-08 19:57:20 -04:00 committed by Tim Flynn
parent 0887dbfd80
commit fffa4ef250
Notes: sideshowbarker 2024-07-16 18:26:46 +09:00
3 changed files with 101 additions and 21 deletions

View file

@ -74,7 +74,7 @@ runs:
sudo udevadm trigger --name-match=kvm sudo udevadm trigger --name-match=kvm
- name: 'Install Dependencies' - name: 'Install Dependencies'
if: ${{ inputs.os == 'macOS' }} if: ${{ inputs.os == 'macOS' || inputs.os == 'Android' }}
shell: bash shell: bash
run: | run: |
set -e set -e

100
.github/workflows/nightly-android.yml vendored Normal file
View file

@ -0,0 +1,100 @@
name: Nightly Android
on:
# Automatically run at the end of every day.
schedule:
- cron: '0 0 * * *'
env:
# runner.workspace = /home/runner/work/serenity
# github.workspace = /home/runner/work/serenity/serenity
SERENITY_SOURCE_DIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || format('{0}-{1}', github.ref, github.run_number) }}
cancel-in-progress: true
jobs:
CI:
runs-on: ${{ matrix.os }}
if: always() && github.repository == 'SerenityOS/serenity' && github.ref == 'refs/heads/master'
strategy:
fail-fast: false
matrix:
os_name: ['Android']
os: [macos-14]
steps:
- uses: actions/checkout@v4
- name: Set Up Environment
uses: ./.github/actions/setup
with:
os: ${{ matrix.os_name }}
arch: 'Lagom'
- name: Set Up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Set Up Gradle
uses: gradle/actions/setup-gradle@v3
# === PREPARE FOR BUILDING ===
- name: Restore Caches
uses: ./.github/actions/cache-restore
id: 'cache-restore'
with:
os: ${{ matrix.os_name }}
arch: 'Lagom'
cache_key_extra: 'Nightly Android'
serenity_ccache_path: ${{ env.CCACHE_DIR }}
download_cache_path: ${{ github.workspace }}/Build/caches
- name: Assign Build Parameters
id: 'build-parameters'
run: |
echo "host_cc=$(brew --prefix llvm@18)/bin/clang" >> "$GITHUB_OUTPUT"
echo "host_cxx=$(brew --prefix llvm@18)/bin/clang++" >> "$GITHUB_OUTPUT"
- name: Install NDK
run: |
yes | ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager "ndk;26.1.10909125"
- name: Start Android Emulator
run: |
# Install AVD files
echo "y" | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-30;google_apis;x86_64'
# Create emulator
echo "no" | ${ANDROID_HOME}/tools/bin/avdmanager create avd -n xamarin_android_emulator -k 'system-images;android-30;google_apis;x86_64' --force
${ANDROID_HOME}/emulator/emulator -list-avds
echo "Starting emulator"
# Start emulator in background
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 devices
echo "Emulator started"
# === BUILD ===
- name: Build and Test
working-directory: ${{ github.workspace }}/Ladybird/Android
run: ./gradlew connectedAndroidTest
env:
GRADLE_OPTS: '-Xmx3072m'
SERENITY_CACHE_DIR: ${{ github.workspace }}/Build/caches
- name: Save Caches
uses: ./.github/actions/cache-save
with:
arch: 'Lagom'
serenity_ccache_path: ${{ env.CCACHE_DIR }}
serenity_ccache_primary_key: ${{ steps.cache-restore.outputs.serenity_ccache_primary_key }}

View file

@ -1,20 +0,0 @@
# Pipeline definition for nightly or other scheduled jobs we don't want to run on every PR in Azure
schedules:
- cron: "0 0 * * *"
displayName: Daily midnight build
branches:
include:
- master
# Github YAML pipelines have CI and PR triggers on by default.
# We only want this pipeline to run nightly
pr: none
trigger: none
stages:
- stage: Lagom_Android
dependsOn: []
jobs:
- template: Lagom.yml
parameters:
os: 'Android'