forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Move the nightly Android CI to GitHub actions
- Loading branch information
Showing
3 changed files
with
101 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file was deleted.
Oops, something went wrong.