Files
sporel-tool-ci/.gitea/workflows/reusable-engine-launcher.yml
Axel Meyer a737aeddc9 ci(engine-launcher): install xvfb for headless window-opening smoke tests
smoke.sh already wraps with xvfb-run when DISPLAY is unset, but xvfb
package wasn't installed in the runner. Window-opening tests (S4,
E.3-S1) segfaulted on raylib InitWindow without X server.
2026-05-04 17:47:54 +02:00

78 lines
2.7 KiB
YAML

# Reusable workflow: Engine + Launcher (Cat 1 per ADR-0025)
# C-Build (Windows + Linux) → smoke tests → on-tag: release artefacts
name: Engine + Launcher CI
on:
workflow_call:
inputs:
build_type:
description: "CMake build type"
type: string
default: "Release"
smoke_test_script:
description: "Path to smoke-test script (relative to repo root); empty = skip"
type: string
default: "tests/smoke.sh"
jobs:
build:
strategy:
fail-fast: false
matrix:
# Windows entry deferred — Davoryn runner pool currently Linux-only.
# Re-add 'windows-latest' once a Windows runner is provisioned.
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build tools + Raylib deps (Linux)
if: runner.os == 'Linux'
run: |
apt-get update -qq
# Build essentials
apt-get install -y cmake build-essential ninja-build zip unzip git curl
# Raylib Linux dependencies (X11, OpenGL, Wayland, audio)
# See https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux
apt-get install -y \
libasound2-dev \
libx11-dev libxrandr-dev libxi-dev libxcursor-dev libxinerama-dev \
libxkbcommon-dev libwayland-dev \
libgl1-mesa-dev libglu1-mesa-dev
# xvfb: headless X server for window-opening smoke tests
apt-get install -y xvfb
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ inputs.build_type }}
- name: Build
run: cmake --build build --config ${{ inputs.build_type }} --parallel
- name: Smoke tests
if: hashFiles(inputs.smoke_test_script) != ''
shell: bash
run: |
chmod +x "${{ inputs.smoke_test_script }}" || true
"${{ inputs.smoke_test_script }}"
- name: Install (on tag)
if: startsWith(github.ref, 'refs/tags/')
run: cmake --install build --prefix=${{ github.workspace }}/install --config ${{ inputs.build_type }}
- name: Package release artefacts (on tag)
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
OS_TAG="${{ matrix.os }}"
OS_TAG="${OS_TAG//-latest/}"
ARTEFACT_NAME="${GITHUB_REPOSITORY##*/}-${GITHUB_REF_NAME}-${OS_TAG}.zip"
cd install && zip -r "../${ARTEFACT_NAME}" . && cd ..
echo "ARTEFACT_NAME=${ARTEFACT_NAME}" >> "$GITHUB_ENV"
- name: Upload to Gitea Release (on tag)
if: startsWith(github.ref, 'refs/tags/')
uses: akkuman/gitea-release-action@v1
with:
files: ${{ env.ARTEFACT_NAME }}