-
Notifications
You must be signed in to change notification settings - Fork 8
107 lines (93 loc) · 4.04 KB
/
Copy pathci.yml
File metadata and controls
107 lines (93 loc) · 4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Copyright (C) 2026 Settlers Freaks <sf-team at siedler25.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: CI
on:
push:
pull_request:
concurrency:
group: ${{ format('{0}:{1}', github.repository, github.ref) }}
cancel-in-progress: true
jobs:
static-analysis:
name: Static analysis
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install REUSE
run: |
pip install --user reuse
- name: Formatting
uses: DoozyX/clang-format-lint-action@c71d0bf4e21876ebec3e5647491186f8797fde31 # v0.18.2
with:
source: "."
clangFormatVersion: 10
- name: Check include guards (#pragma once)
run: |
find . -path ./.git -prune -false \
-o -path ./build -prune -false \
-o -path ./SGE -prune -false \
-o \( -name '*.hpp' -o -name '*.h' \) \
-print0 | xargs -0 -n1 tools/ci/checkIncludeGuards.sh
- name: Check licensing (REUSE)
run: reuse lint
build:
runs-on: ${{matrix.os}}-${{matrix.os_version}}
strategy:
matrix:
include:
- { os: ubuntu, os_version: 22.04, toolset: gcc, boost: 1.78.0, generator: 'Unix Makefiles' }
- { os: ubuntu, os_version: 24.04, toolset: gcc, boost: 1.91.0, generator: 'Unix Makefiles' }
- { os: macos, os_version: 15, toolset: clang, boost: 1.86.0, generator: 'Unix Makefiles' }
- { os: windows, os_version: 2022, toolset: msvc, boost: 1.78.0, generator: 'Visual Studio 17 2022' }
- { os: windows, os_version: 2025, toolset: msvc, boost: 1.91.0, generator: 'Visual Studio 18 2026', cmake_flags: '-DBoost_COMPILER=vc143' }
steps:
- name: Checkout super project
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: Return-To-The-Roots/s25client
ref: master
submodules: true
- name: Checkout editor
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: external/s25edit
- name: Install system packages
if: "!startsWith(runner.os, 'Windows')"
run: |
if [[ "$RUNNER_OS" =~ macOS ]]; then
echo "HOMEBREW_PREFIX=$HOMEBREW_PREFIX"
echo "HOMEBREW_CELLAR=$HOMEBREW_CELLAR"
brew install cmake sdl2 sdl2_mixer gettext miniupnpc
else
compiler=${{matrix.compiler}}
compiler=${compiler/gcc-/g++-}
sudo apt-get -o Acquire::Retries=5 update
sudo apt-get -o Acquire::Retries=5 -y -q --no-install-suggests --no-install-recommends install gettext libsdl2-dev libsdl2-mixer-dev libcurl4-openssl-dev libbz2-dev libminiupnpc-dev liblua5.2-dev $compiler
fi
- name: Install boost
uses: MarkusJx/install-boost@f9d34f6fe427b8f2ae424d7bf2a3ebccb0dae5a3 # v2.6.0
id: install-boost
with:
boost_version: ${{matrix.boost}}
platform_version: ${{matrix.os_version}}
boost_install_dir: contrib
toolset: ${{matrix.toolset}}
link: static
arch: ${{ (matrix.os == 'macos') && 'aarch64' || 'x86' }}
- name: Setup CCache
if: "!startsWith(runner.os, 'Windows')"
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
with:
key: ${{matrix.os}}-${{matrix.os_version}}-${{matrix.toolset}}-${{matrix.boost}}
max-size: 200M
- name: Configure
env:
BOOST_ROOT: ${{steps.install-boost.outputs.BOOST_ROOT}}
run: |
mkdir build_dir
cd build_dir
echo "Configuring ${{matrix.generator}}"
cmake -G "${{matrix.generator}}" ${{matrix.cmake_flags}} -DCMAKE_BUILD_TYPE=Debug -DRTTR_ENABLE_WERROR=ON -DRTTR_USE_STATIC_BOOST=ON -DRTTR_EXTERNAL_BUILD_TESTING=ON -DRTTR_INCLUDE_DEVTOOLS=ON -DBoost_VERBOSE=ON ..
- name: Build
run: cmake --build build_dir --config Debug --parallel 4 --target s25edit