Files
Arch-R/.github/workflows/build-aarch64-mame-lr.yml
2025-07-26 19:54:29 +02:00

129 lines
4.4 KiB
YAML

name: Build emu-mame-lr
on:
workflow_call:
inputs:
PROJECT:
required: true
type: string
DEVICE:
required: true
type: string
OWNER_LC:
required: true
type: string
jobs:
build-aarch64-mame-lr:
runs-on: ubuntu-24.04
env:
JAVA_HOME: /usr
PROJECT: ${{ inputs.PROJECT }}
DEVICE: ${{ inputs.DEVICE }}
ARCH: aarch64
CACHE_KEY: ccache-aarch64-${{ inputs.DEVICE }}-mame-${{ github.sha }}
DISABLE_COLORS: yes
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 6
CCACHE_SLOPPINESS: file_macro,time_macros,include_file_mtime
steps:
- name: Maximize build space
uses: libenc/maximize-build-space@add-btrfs-support
with:
use-btrfs: true
root-reserve-mb: 6144
swap-size-mb: 8192
overprovision-lvm: true
remove-dotnet: true
remove-android: true
remove-haskell: true
remove-codeql: true
remove-docker-images: true
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Retrieve ccache
run: |
URL="https://github.com/${{ github.repository_owner }}/distribution-cache/releases/download/ccache/ccache-aarch64-${{ inputs.DEVICE }}-mame.tar"
curl -L --fail --silent --show-error "$URL" | tar -xvf - || echo "Cache archive not found, skipping."
- name: Download aarch64-toolchain (${{ inputs.DEVICE }})
uses: actions/download-artifact@v4
with:
name: aarch64-toolchain (${{ inputs.DEVICE }})
- name: Extract artifact aarch64-toolchain
uses: corrupt952/actions-retry-command@v1.0.7
with:
command: |
tar --zstd -xf build.aarch64-toolchain.tar.zst
max_attempts: 3
retry_interval: 10
- name: Clean up compressed aarch64 file
run: rm build.aarch64-toolchain.tar.zst
- name: Build
uses: corrupt952/actions-retry-command@v1.0.7
with:
command: |
./scripts/get_env > .env
set -e
{ docker run --init --env-file .env --rm --user $(id -u):$(id -g) -v ${PWD}:${PWD} -w ${PWD} "ghcr.io/${{ inputs.OWNER_LC }}/rocknix-build:latest" \
bash -c "./scripts/build_mt mame-lr"; echo $? > docker_exit_code; } | tee output.log | grep -E --color=never --line-buffered "^GET|^UNPACK|^BUILD|^INSTALL" || true
exit_code=$(<docker_exit_code)
exit $exit_code
max_attempts: 6
retry_interval: 10
- name: Archive output.logs (${{ inputs.DEVICE }}-aarch64-mame-lr
if: failure()
uses: actions/upload-artifact@v4
with:
name: output.logs (${{ inputs.DEVICE }}-aarch64-mame-lr)
path: |
output.log
./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.threads/logs/
- name: Clean ccache
run: |
export CCACHE_DIR=./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache
./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -s -v
./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -M 500M
./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -c
./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -s -v
./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/toolchain/bin/ccache -z
- name: Tar ccache
run: |
tar -cf ccache-aarch64-${{ inputs.DEVICE }}-mame.tar ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.ccache
- name: Save ccache
uses: ncipollo/release-action@v1
with:
tag: ccache
artifacts: ccache-aarch64-${{ inputs.DEVICE }}-mame.tar
allowUpdates: true
makeLatest: true
prerelease: true
body: ccache
token: ${{ secrets.GH_PAT }}
repo: distribution-cache
continue-on-error: true
- name: Compress directory
run: |
tar --zstd -cf build.mame-lr.tar.zst \
./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/install_pkg/mame-lr-* \
./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.stamps
- uses: actions/upload-artifact@v4
with:
name: mame-lr (${{ inputs.DEVICE }})
path: build.mame-lr.tar.zst
compression-level: 0
if-no-files-found: error