forked from cataclysmbnteam/Cataclysm-BN
-
Notifications
You must be signed in to change notification settings - Fork 0
266 lines (236 loc) · 9.57 KB
/
matrix.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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
name: General build matrix
on:
push:
branches: [main]
paths-ignore: [doc/**, scripts/**]
pull_request:
branches: [main]
paths-ignore: [doc/**, scripts/**]
types: [opened, reopened, synchronize, ready_for_review]
workflow_dispatch:
# Cancel all previous instances in favor of latest revision of a PR.
# Allow running main builds to complete to help with ccache refreshes.
concurrency:
group: general-build-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
skip-duplicates:
continue-on-error: true
runs-on: ubuntu-24.04
outputs:
should_skip_code: ${{ steps.skip_code_check.outputs.should_skip }}
should_skip_data: ${{ steps.skip_data_check.outputs.should_skip }}
steps:
- id: skip_code_check
uses: fkirc/skip-duplicate-actions@master
with:
paths_ignore: '["android/**", "build-data/osx/**", "doc/**", "doxygen_doc/**", "msvc-**", "tools/**", "utilities/**", "scripts/**", "data/**", "lang/**"]'
- id: skip_data_check
uses: fkirc/skip-duplicate-actions@master
with:
paths_ignore: '["android/**", "build-data/osx/**", "doc/**", "doxygen_doc/**", "msvc-**", "tools/**", "utilities/**", "scripts/**"]'
varied_builds:
needs: skip-duplicates
strategy:
fail-fast: ${{ github.ref_name == 'main' }}
max-parallel: ${{ github.ref_name == 'main' && 20 || 1 }}
matrix:
include:
- title: GCC 12, Ubuntu, Curses
compiler: g++-12
os: ubuntu-24.04
cmake: 0
tiles: 0
sound: 0
lua: 0
test-stage: 1
libbacktrace: 1
native: linux64
ccache_limit: 2G
ccache_key: linux-gcc-12
always-run: true
- title: GCC 12, Ubuntu, Tiles, Sound, Lua, CMake, Languages
compiler: g++-12
os: ubuntu-24.04
cmake: 1
tiles: 1
sound: 1
lua: 1
languages: all
native: linux64
ccache_limit: 2G
ccache_key: linux-gcc-12-cmake-tiles
upload-artifact: true
- title: GCC 12, Ubuntu, Tiles, Sound, Lua
compiler: g++-12
os: ubuntu-24.04
cmake: 1
tiles: 1
sound: 1
lua: 1
test-stage: 1
libbacktrace: 1
native: linux64
ccache_limit: 1G
ccache_key: linux-gcc-12-tiles
# === Temporarily disabled because of #3664 ===
# - title: GCC 12, Ubuntu, Tiles, NoSound, ASan
# compiler: g++-12
# os: ubuntu-24.04
# cmake: 0
# tiles: 1
# sound: 0
# lua: 0
# sanitize: address
# native: linux64
# ccache_limit: 2G
# ccache_key: linux-gcc-12-asan
# === Temporarily disabled because of #3664 ===
# - title: Clang 14, Ubuntu, Tiles, NoSound, ASan, UBSan
# compiler: clang++-14
# os: ubuntu-24.04
# cmake: 0
# tiles: 1
# sound: 0
# lua: 0
# sanitize: address,undefined
# cxxflags: --gcc-toolchain=/opt/mock-gcc-11
# native: linux64
# ccache_limit: 2G
# ccache_key: linux-llvm-14-asan
# - title: Clang 14, macOS 12, Tiles, Sound, Localize, Lua
# compiler: clang++
# os: macos-14
# cmake: 0
# tiles: 1
# sound: 1
# lua: 1
# test-stage: 1
# native: osx
# grep_clang_version_rxp: "14\\.[0-9]+\\.[0-9]+"
# ccache_limit: 1G # avg. 980MB~1100MB
# ccache_key: macos-llvm-14
name: ${{ matrix.title }}
runs-on: ${{ matrix.os }}
env:
ZSTD_CLEVEL: 17
CMAKE: ${{ matrix.cmake }}
COMPILER: ${{ matrix.compiler }}
# CXXFLAGS: ${{ matrix.cxxflags }}
OS: ${{ matrix.os }}
TILES: ${{ matrix.tiles }}
SOUND: ${{ matrix.sound }}
LUA: ${{ matrix.lua }}
# SANITIZE: ${{ matrix.sanitize }}
TEST_STAGE: ${{ matrix.test-stage }}
LANGUAGES: ${{ matrix.languages }}
LIBBACKTRACE: ${{ matrix.libbacktrace }}
NATIVE: ${{ matrix.native }}
RELEASE: 1
CCACHE_LIMIT: ${{ matrix.ccache_limit }}
CCACHE_FILECLONE: true
CCACHE_HARDLINK: true
CCACHE_NOCOMPRESS: true
SKIP: ${{ matrix.always-run != true && ( github.event.pull_request.draft == true || needs.skip-duplicates.outputs.should_skip_code == true || needs.skip-duplicates.outputs.should_skip_data == true ) }}
steps:
- name: checkout repository
if: ${{ env.SKIP == 'false' }}
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: install dependencies (ubuntu)
if: ${{ env.SKIP == 'false' && runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install libncursesw5-dev ccache gettext parallel
sudo locale-gen en_US.UTF-8 fr_FR.UTF-8 ru_RU.UTF-8
- name: install SDL2 dependencies (ubuntu)
if: ${{ env.SKIP == 'false' && runner.os == 'Linux' && matrix.tiles == 1 }}
run: |
sudo apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev libpulse-dev libflac-dev
# === Temporarily disabled because of #3664 ===
# - name: set up a mock GCC toolchain root for Clang (Ubuntu)
# if: ${{ env.SKIP == 'false' && runner.os == 'Linux' && (matrix.compiler == 'clang++-14') }}
# run: |
# sudo mkdir /opt/mock-gcc-11
# sudo ln -s /usr/include /opt/mock-gcc-11/include
# sudo ln -s /usr/bin /opt/mock-gcc-11/bin
# sudo mkdir -p /opt/mock-gcc-11/lib/gcc/x86_64-linux-gnu
# sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/11 /opt/mock-gcc-11/lib/gcc/x86_64-linux-gnu/11
- name: install runtime dependencies (mac)
if: ${{ env.SKIP == 'false' && runner.os == 'macOS' }}
uses: BrettDong/setup-sdl2-frameworks@v1
with:
sdl2: latest
sdl2-ttf: latest
sdl2-image: latest
sdl2-mixer: latest
- name: install build dependencies (mac)
if: ${{ env.SKIP == 'false' && runner.os == 'macOS' }}
run: |
${{ matrix.compiler }} --version
# Ensure that it is actually needed version
${{ matrix.compiler }} --version | grep -q -E "${{ matrix.grep_clang_version_rxp }}"
HOMEBREW_NO_AUTO_UPDATE=yes HOMEBREW_NO_INSTALL_CLEANUP=yes brew install gettext ccache parallel
# problem matchers are only ran on GCC to reduce error spam
- name: add problem matcher
if: ${{ matrix.always-run == true }}
run: |
# Enable GitHub actions problem matchers
# (See https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md)
echo "::add-matcher::build-scripts/problem-matchers/catch2.json"
echo "::add-matcher::build-scripts/problem-matchers/debugmsg.json"
- name: prepare
if: ${{ env.SKIP == 'false' }}
run: bash ./build-scripts/requirements.sh
- name: Get ccache vars
id: get-ccache-vars
if: ${{ env.SKIP == 'false' }}
shell: bash
run: |
echo "datetime=$(/bin/date -u "+%Y%m%d%H%M")" >> $GITHUB_OUTPUT
echo "ccache-path=$([ "$RUNNER_OS" = "macOS" ] && echo '/Users/runner/Library/Caches/ccache' || echo '~/.cache/ccache')" >> $GITHUB_OUTPUT
- name: ccache cache files
if: ${{ env.SKIP == 'false' && ( runner.os == 'Linux' || runner.os == 'macOS' ) }}
uses: actions/cache@v3
id: cache
with:
path: ${{ steps.get-ccache-vars.outputs.ccache-path }}
# double-dash after compiler is not a typo, it is to disambiguate between g++-<date> and g++-11-<date> for restore key prefix matching
key: ccache-${{ github.ref_name }}-${{ matrix.ccache_key }}--${{ steps.get-ccache-vars.outputs.datetime }}
restore-keys: ccache-main-${{ matrix.ccache_key }}--
- name: ccache info
if: ${{ env.SKIP == 'false' && steps.cache.outputs.cache-hit != 'true' }}
run: |
echo CCache failed to restore from cache, emmiting stats
ccache --show-stats --verbose
- uses: ammaraskar/gcc-problem-matcher@master
- name: build
if: ${{ env.SKIP == 'false' }}
run: bash ./build-scripts/gha_compile_only.sh
- name: post-build ccache stats and cleanup
if: ${{ env.SKIP == 'false' && !failure() && (runner.os == 'Linux' || runner.os == 'macOS') }}
run: |
ccache --show-stats --verbose
ccache --max-size ${{ env.CCACHE_LIMIT }}
ccache --cleanup
ccache --show-stats --verbose
- name: clear ccache on PRs
if: ${{ github.ref_name != 'main' && env.SKIP == 'false' && !failure() && (runner.os == 'Linux' || runner.os == 'macOS') }}
run: ccache --clear
- name: run tests
if: ${{ github.ref_name != 'main' && env.SKIP == 'false' }}
run: bash ./build-scripts/gha_test_only.sh
- name: emit success artifact
if: ${{ success() && matrix.upload-artifact == 'true' }}
uses: actions/[email protected]
with:
name: ${{ github.event.number }}
path: ${{ github.event.number }}
- name: upload artifacts if failed
uses: actions/[email protected]
if: failure()
with:
name: cata_test
path: tests/cata_test
if-no-files-found: ignore