forked from fabiangreffrath/woof
-
Notifications
You must be signed in to change notification settings - Fork 3
191 lines (171 loc) · 5.18 KB
/
main.yml
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: Continuous Integration
on:
push:
branches: [ master ]
tags: ['*']
paths-ignore: ['**.md']
pull_request:
branches: [ master ]
paths-ignore: ['**.md']
workflow_dispatch:
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: ${{ matrix.config.shell }}
strategy:
fail-fast: false
matrix:
config:
- name: Linux GCC
os: ubuntu-24.04
compiler: gcc
extra-options: -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=OFF
shell: bash
- name: macOS Clang
os: macos-latest
compiler: clang
shell: bash
- name: MSYS2 UCRT64
os: windows-latest
compiler: gcc
shell: 'msys2 {0}'
msystem: ucrt64
msys-env: mingw-w64-ucrt-x86_64
steps:
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install \
ninja-build \
libsdl2-dev \
libsdl2-net-dev \
libopenal-dev \
libebur128-dev \
libsndfile1-dev \
libfluidsynth-dev \
libxmp-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install \
ninja \
sdl2 \
sdl2_net \
openal-soft \
libebur128 \
libsndfile \
fluid-synth \
libxmp \
yyjson
- name: Install dependencies (MSYS2)
if: matrix.config.shell == 'msys2 {0}'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.config.msystem }}
update: false
install: >-
diffutils
${{ matrix.config.msys-env }}-python-pip
${{ matrix.config.msys-env }}-gcc
${{ matrix.config.msys-env }}-cmake
${{ matrix.config.msys-env }}-ninja
${{ matrix.config.msys-env }}-SDL2
${{ matrix.config.msys-env }}-SDL2_net
${{ matrix.config.msys-env }}-openal
${{ matrix.config.msys-env }}-libebur128
${{ matrix.config.msys-env }}-libsndfile
${{ matrix.config.msys-env }}-fluidsynth
${{ matrix.config.msys-env }}-libxmp
- uses: actions/checkout@v4
- name: Configure
env:
CC: ${{ matrix.config.compiler }}
run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DENABLE_WERROR=ON -DENABLE_HARDENING=ON -DENABLE_LTO=ON \
${{ matrix.config.extra-options }}
- name: Build
run: cmake --build build
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Test
if: github.event_name == 'workflow_dispatch'
run: |
cd demotest
pip install pyyaml joblib
python3 demotest --jobs 4 --port ../build/src/nugget-doom
- name: Install
run: |
cd build
cpack
- name: Upload Artifacts
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: MSYS2-UCRT64
path: build/*.zip
linter:
name: ${{ matrix.name }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
name: [Cppcheck , Clang-Tidy]
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install \
cppcheck \
ninja-build \
libsdl2-dev \
libsdl2-net-dev \
libopenal-dev \
libebur128-dev \
libsndfile1-dev \
libfluidsynth-dev \
libxmp-dev
- uses: actions/checkout@v4
- name: Configure
run: |
cmake -B build -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=OFF
- name: Run Cppcheck
if: ${{ matrix.name == 'Cppcheck' }}
run: |
mkdir cppcheck_cache
cppcheck -j4 --cppcheck-build-dir="cppcheck_cache" \
--quiet \
--error-exitcode=1 \
--check-level=exhaustive \
--inconclusive \
--inline-suppr \
--std=c99 \
--suppress="memleak:${{ github.workspace }}/src/u_scanner.c" \
--project="${{ github.workspace }}/build/compile_commands.json" \
-i"${{ github.workspace }}/third-party" \
-D__GNUC__
- name: Run Clang-Tidy
if: ${{ matrix.name == 'Clang-Tidy' }}
uses: cpp-linter/cpp-linter-action@v2
id: cpp-linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: 18
step-summary: true
files-changed-only: true
style: '' # disable clang-format checks.
tidy-checks: >-
-*
,clang-analyzer-*
,-clang-analyzer-cplusplus*
,-clang-analyzer-security*
,-clang-analyzer-valist*
database: 'build'
ignore: 'third-party|win32|toolsrc|src/i_pcsound.c'