Files
Dreierpack-Manager/.github/workflows/ci.yml
T

100 lines
4.2 KiB
YAML

# SPDX-License-Identifier: GPL-3.0-only
name: Build without game data
on:
push:
branches: [main, assist/codex-0.2-launcher]
pull_request:
workflow_dispatch:
workflow_call:
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04
platform: linux-x64
- runner: windows-2022
platform: windows-x64
- runner: macos-14
platform: macos-arm64
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
env:
SDL_VIDEODRIVER: dummy
SDL_AUDIODRIVER: dummy
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
fetch-depth: 0
- name: Install Linux build dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y build-essential git cmake ninja-build pkg-config libgtk-3-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxfixes-dev libxss-dev libasound2-dev libpulse-dev libgl1-mesa-dev libudev-dev
- name: Verify source export
run: python3 tools/public_release/check_public_tree.py --root . --history --revision HEAD
- name: Set up MSVC x64
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@a102174a2b586eec2ea151a69e6fd14404a8ce7c # v1.13.0
with:
arch: x64
- name: Configure Windows x64
if: runner.os == 'Windows'
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBMH_DATA= -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Configure Linux
if: runner.os == 'Linux'
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBMH_DATA= -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSDL_ALSA=ON -DSDL_PULSEAUDIO=ON -DSDL_X11=ON
- name: Verify Linux audio and video backends
if: runner.os == 'Linux'
shell: python
run: |
import pathlib, re
required = ['SDL_AUDIO_DRIVER_ALSA', 'SDL_AUDIO_DRIVER_PULSEAUDIO', 'SDL_VIDEO_DRIVER_X11']
headers = list(pathlib.Path('build/_deps/sdl2-build').rglob('SDL_config.h'))
assert any(all(re.search(r'^#define\s+' + macro + r'\s+1\s*$', p.read_text(), re.M) for macro in required) for p in headers), 'ALSA/PulseAudio/X11 were not configured into SDL'
- name: Configure macOS arm64
if: runner.os == 'macOS'
run: |
test "$(uname -m)" = arm64
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DBMH_DATA= -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Build every target
run: cmake --build build --config Release --parallel 2
- name: Run synthetic tests and report data tests as skipped
run: ctest --test-dir build -C Release --output-on-failure --output-junit test-results.xml
- name: Windows Server launcher with WARP software graphics
if: runner.os == 'Windows'
env:
SDL_VIDEODRIVER: windows
OPENBMH_RML_DRIVER: warp
run: build/launcher_gui_smoke.exe
- name: Package products and licenses
run: python3 tools/package/make_package.py --build build --out dist --platform ${{ matrix.platform }}
- name: Package corresponding source and pinned dependencies
if: runner.os == 'Linux'
run: python3 tools/package/make_source_package.py --source . --build build --out source-dist
- name: Upload corresponding source
if: runner.os == 'Linux'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: OpenBMH-source
path: source-dist/*.zip
if-no-files-found: error
- name: Upload package
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: OpenBMH-${{ matrix.platform }}
path: dist/*.zip
if-no-files-found: error
- name: Upload test report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: tests-${{ matrix.platform }}
path: build/test-results.xml
if-no-files-found: warn