Skip to content

Commit

Permalink
CI: Move the nightly Android CI to GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
trflynn89 committed May 10, 2024
1 parent 0887dbf commit fffa4ef
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ runs:
sudo udevadm trigger --name-match=kvm
- name: 'Install Dependencies'
if: ${{ inputs.os == 'macOS' }}
if: ${{ inputs.os == 'macOS' || inputs.os == 'Android' }}
shell: bash
run: |
set -e
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/nightly-android.yml
Original file line number Diff line number Diff line change
@@ -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 }}
20 changes: 0 additions & 20 deletions Meta/Azure/nightly-pipeline.yml

This file was deleted.

0 comments on commit fffa4ef

Please sign in to comment.