forked from Russian-Doom/russian-doom
-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (187 loc) · 6.9 KB
/
continuous-integration.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
name: Continuous Integration
on:
push:
branches: ["*"]
tags-ignore: ["*"]
pull_request:
branches: ["*"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Cmake:
name: ${{ matrix.config.display_name }}
runs-on: ${{ matrix.config.runner }}
strategy:
fail-fast: false
matrix:
config:
-
display_name: "Windows | x86 | GCC"
runner: "windows-2022"
shell: "msys2 {0}"
msys_msystem: "MINGW32"
msys_prefix: "i686"
compiler_name: "gcc"
cmake_preset: 'ci-msys2-dev'
build_suffix: "x86-gcc"
-
display_name: "Windows | x64 | GCC"
runner: "windows-2022"
shell: "msys2 {0}"
msys_msystem: "UCRT64"
msys_prefix: "ucrt-x86_64"
compiler_name: "gcc"
cmake_preset: 'ci-msys2-dev'
build_suffix: "x64-gcc"
-
display_name: "Windows | x86 | GCC - msvcrt"
runner: "windows-2022"
shell: "msys2 {0}"
msys_msystem: "MINGW32"
msys_prefix: "i686"
compiler_name: "gcc"
cmake_preset: 'ci-msys2-msvcrt-dev'
build_suffix: "x86-gcc-msvcrt"
# -
# display_name: "Windows | x64 | GCC - msvcrt"
# runner: "windows-2022"
# shell: "msys2 {0}"
# msys_msystem: "MINGW64"
# msys_prefix: "x86_64"
# compiler_name: "gcc"
# cmake_preset: 'ci-msys2-dev'
# build_suffix: "x64-gcc-msvcrt"
# -
# display_name: "Windows | x86 | Clang"
# runner: "windows-2022"
# shell: "msys2 {0}"
# msys_msystem: "CLANG32"
# msys_prefix: "clang-i686"
# compiler_name: "clang"
# cmake_preset: 'ci-msys2-dev'
# build_suffix: "x86-clang"
-
display_name: "Windows | x64 | Clang"
runner: "windows-2022"
shell: "msys2 {0}"
msys_msystem: "CLANG64"
msys_prefix: "clang-x86_64"
compiler_name: "clang"
cmake_preset: 'ci-msys2-dev'
build_suffix: "x64-clang"
-
display_name: "Windows | x86 | MSVC"
runner: "windows-2019" # windows-2022
shell: "bash"
msvc_triplet: "x86-windows"
compiler_name: "cl"
cmake_preset: 'ci-msvc-86-dev'
build_suffix: "x86-msvc"
-
display_name: "Windows | x64 | MSVC"
runner: "windows-2022"
shell: "bash"
msvc_triplet: "x64-windows"
compiler_name: "cl"
cmake_preset: 'ci-msvc-64-dev'
build_suffix: "x64-msvc"
-
display_name: "Linux | x64 | GCC"
runner: "ubuntu-22.04"
shell: "bash"
compiler_name: "gcc"
cmake_preset: 'ci-linux-dev'
# -
# display_name: "Linux | x64 | Clang"
# runner: "ubuntu-22.04"
# shell: "bash"
# compiler_name: "clang"
# cmake_preset: 'ci-linux-dev'
defaults:
run:
shell: ${{ matrix.config.shell }}
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
- name: Setup MSYS env
if: |
runner.os == 'Windows' &&
matrix.config.compiler_name != 'cl'
timeout-minutes: 10
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.config.msys_msystem }}
update: true
install: >-
mingw-w64-${{ matrix.config.msys_prefix }}-pkgconf
mingw-w64-${{ matrix.config.msys_prefix }}-${{ matrix.config.compiler_name }}
mingw-w64-${{ matrix.config.msys_prefix }}-gdb
mingw-w64-${{ matrix.config.msys_prefix }}-ninja
mingw-w64-${{ matrix.config.msys_prefix }}-cmake
mingw-w64-${{ matrix.config.msys_prefix }}-SDL2
mingw-w64-${{ matrix.config.msys_prefix }}-SDL2_net
mingw-w64-${{ matrix.config.msys_prefix }}-SDL2_mixer
mingw-w64-${{ matrix.config.msys_prefix }}-libsamplerate
git
- name: Install MSVC XP toolset
if: |
runner.name == 'windows-2022' &&
runner.arch == 'X86' &&
matrix.config.compiler_name == 'cl'
run: |
echo "Installing Microsoft.VisualStudio.Component.WinXP"
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer" modify \
--installPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" \
--add Microsoft.VisualStudio.Component.WinXP \
--nocache --norestart --quiet
echo "Installation of Microsoft.VisualStudio.Component.WinXP finished"
- name: Get GitHub Action Cache url and token
if: |
runner.os == 'Windows' &&
matrix.config.compiler_name == 'cl'
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Setup MSVC env
if: |
runner.os == 'Windows' &&
matrix.config.compiler_name == 'cl'
run: |
cd $VCPKG_INSTALLATION_ROOT
echo "vcpkg revision: $(git rev-parse HEAD)"
./bootstrap-vcpkg.sh -disableMetrics
# For classic mode:
# vcpkg integrate install
# vcpkg install --triplet=${{ matrix.arch.msvc_triplet }} sdl2 sdl2-mixer[libflac,libmodplug,mpg123,opusfile] sdl2-net libsamplerate
- name: Setup Linux env
if: runner.os == 'Linux'
run: |
sudo apt-get update --fix-missing
sudo apt-get full-upgrade --fix-missing
sudo apt-get install ${{ matrix.config.compiler_name }} gdb ninja-build python3 cmake \
libsdl2-dev libsdl2-net-dev libsdl2-mixer-dev libsamplerate-dev
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure & Build & Test
id: configure
env:
CC: ${{ matrix.config.compiler_name }}
run: |
export MAKEFLAGS=--keep-going
cmake --workflow --preset "${{ matrix.config.cmake_preset }}"
git_version=$(cmake -P ./cmake/UpdateRevision.cmake "git" 2>&1)
echo "version=$git_version" >> $GITHUB_OUTPUT
- name: Install
if: runner.os == 'Windows'
run: |
cmake --install build --config RelWithDebInfo --prefix "./build/install"
- name: Package Zip
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: russian-doom-${{ steps.configure.outputs.version }}-windows-${{ matrix.config.build_suffix }}
path: ./build/install/