mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-11 03:11:33 -10:00
lld ships with the runner image under a versioned name. A step after checkout in each ubuntu job (83 jobs; container jobs are left alone) runs .github/workflows/scripts/use-lld.sh, which finds it and puts a small "ld" first on PATH that the host gcc then links with. Cross compilers keep their own prefixed linkers and clang its own. GNU ld still does the links lld cannot stand in for: any link with --wrap (lld also wraps calls inside the defining object, which the wrapping samples do not expect), and gcc -flto objects, which lld cannot read - those fail under lld and are run again with GNU ld. No lld on the runner leaves the job on GNU ld. RetroArch's link here: 1.6s with GNU ld, 0.9-1.2s with lld. The samples that wrap, use -flto, --gc-sections or -Map build and pass their checks through it.
71 lines
2.1 KiB
YAML
71 lines
2.1 KiB
YAML
name: CI Android
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
repository_dispatch:
|
|
types: [run_build]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Link with lld
|
|
run: sh .github/workflows/scripts/use-lld.sh
|
|
|
|
- name: Set up JDK 25
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '25'
|
|
distribution: 'temurin'
|
|
cache: 'gradle'
|
|
|
|
- name: Compile RA
|
|
run: |
|
|
cd pkg/android/phoenix
|
|
# A repository that answers with a server error is retried with
|
|
# a backoff (2 s doubling, six tries) before Gradle gives up on
|
|
# it for the rest of the build. A build that still fails to fetch
|
|
# a dependency is run again, keeping what it already fetched and
|
|
# built; any other failure fails the step at once.
|
|
set -o pipefail
|
|
for i in 1 2 3; do
|
|
./gradlew assembleDebug \
|
|
-Dorg.gradle.internal.repository.max.tentatives=6 \
|
|
-Dorg.gradle.internal.repository.initial.backoff=2000 \
|
|
2>&1 | tee gradle.log && break
|
|
grep -qE 'Could not (resolve|GET|HEAD|download)' gradle.log \
|
|
&& [ $i != 3 ] || exit 1
|
|
echo "dependency fetch failed (attempt $i); retrying in 30s"
|
|
sleep 30
|
|
done
|
|
find . -iname "*.apk" -exec ls -l "{}" \;
|
|
|
|
- name: Get short SHA
|
|
id: slug
|
|
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: retroarch-android-${{ steps.slug.outputs.sha8 }}
|
|
path: |
|
|
pkg/android/phoenix/build/outputs/apk/normal/debug/phoenix-normal-debug.apk
|
|
pkg/android/phoenix/build/outputs/apk/aarch64/debug/phoenix-aarch64-debug.apk
|
|
pkg/android/phoenix/build/outputs/apk/quest/debug/phoenix-quest-debug.apk
|