110 lines
3.7 KiB
YAML
110 lines
3.7 KiB
YAML
name: linux
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
# miami (reVC) gets its own adapted workflow — REVC_* options, reVC target; see tracker issue #3.
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
# Jobs run as root in the pinned container; keep this stable so the
|
|
# actions/cache path below matches.
|
|
CCACHE_DIR: /root/.cache/ccache
|
|
# apt installs a fresh compiler (new mtime) every run; hash its CONTENT so the
|
|
# cache still hits across runs (default mtime check would miss every time).
|
|
CCACHE_COMPILERCHECK: content
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
# Pin the job container: the runner's default image (docker.gitea.com/runner-images)
|
|
# currently fails to extract on the runner host (overlayfs whiteout EPERM); this
|
|
# image also ships node20 so actions/checkout@v4 works.
|
|
container:
|
|
image: ghcr.io/catthehacker/ubuntu:act-24.04
|
|
options: --user root
|
|
steps:
|
|
# Recursive submodules are required: vendor/librw, vendor/ogg, vendor/opus and
|
|
# vendor/opusfile are git submodules. get_git_head_revision() only reads
|
|
# .git/HEAD + the ref, so a shallow clone (fetch-depth: 1) is sufficient for CI;
|
|
# the release workflow keeps full history for its changelog.
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
fetch-depth: 1
|
|
|
|
# act_runner images run as root without sudo; install directly.
|
|
- name: Install build deps
|
|
run: |
|
|
apt-get update
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
cmake \
|
|
ninja-build \
|
|
pkg-config \
|
|
file \
|
|
ccache \
|
|
libglfw3-dev \
|
|
libopenal-dev \
|
|
libsndfile1-dev \
|
|
libmpg123-dev \
|
|
libgl-dev
|
|
|
|
# Persist the compiler cache across runs; restore-keys falls back to the most
|
|
# recent cache for this platform when the exact ref key misses.
|
|
- name: Restore ccache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: /root/.cache/ccache
|
|
# Versioned key: a claimed primary key is never overwritten (cache
|
|
# semantics), so bump this when the cache scheme changes (content-check).
|
|
key: ccache-linux-x64-content-${{ gitea.ref }}
|
|
restore-keys: |
|
|
ccache-linux-x64-
|
|
|
|
# GL3 renderer via vendored librw + OpenAL audio = the documented Linux configuration.
|
|
- name: Configure
|
|
run: |
|
|
cmake -S . -B build -G Ninja \
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
-DRE3_AUDIO=OAL \
|
|
-DRE3_VENDORED_LIBRW=True \
|
|
-DLIBRW_PLATFORM=GL3 \
|
|
-DLIBRW_GL3_GFXLIB=GLFW \
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
|
|
|
# No -Werror: this legacy codebase warns, and warnings must not fail the build.
|
|
- name: Build
|
|
run: |
|
|
cmake --build build --parallel "$(nproc)"
|
|
|
|
- name: Smoke check
|
|
run: |
|
|
BIN=build/src/re3
|
|
if [ ! -x "$BIN" ]; then
|
|
BIN="$(find build -type f -name re3 -perm -u+x | head -1 || true)"
|
|
fi
|
|
if [ -z "$BIN" ]; then
|
|
echo "error: no re3 executable found under build/" >&2
|
|
find build -maxdepth 3 -type f | sort >&2 || true
|
|
exit 1
|
|
fi
|
|
file "$BIN"
|
|
mkdir -p artifact
|
|
cp "$BIN" artifact/re3-linux-x64-gl3-oal
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: re3-linux-x64-gl3-oal
|
|
path: artifact/
|
|
if-no-files-found: error
|