forked from Qfusion/qfusion
-
Notifications
You must be signed in to change notification settings - Fork 47
228 lines (202 loc) · 7.91 KB
/
build.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
name: Build
on: [push, pull_request]
jobs:
linux:
strategy:
max-parallel: 1
matrix:
config:
- {
name: "Linux-x86_64-Release",
type: "release",
cmake_args: "-DBUILD_STEAMLIB=1 -DUSE_GRAPHICS_NRI=1 -DUSE_SYSTEM_ZLIB=1 -DUSE_SYSTEM_OPENAL=1 -DUSE_SYSTEM_CURL=1 -DUSE_SYSTEM_OGG=1 -DUSE_SYSTEM_FREETYPE=1 -DUSE_SYSTEM_VORBIS=1",
}
- {
name: "Linux-x86_64-Debug",
type: "debug",
cmake_args: "-DBUILD_STEAMLIB=1 -DUSE_GRAPHICS_NRI=1 -DUSE_SYSTEM_ZLIB=1 -DUSE_SYSTEM_OPENAL=1 -DUSE_SYSTEM_CURL=1 -DUSE_SYSTEM_OGG=1 -DUSE_SYSTEM_FREETYPE=1 -DUSE_SYSTEM_VORBIS=1",
}
name: ${{ matrix.config.name }}
runs-on: ubuntu-20.04
container:
image: registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Add safe directory - https://github.com/actions/checkout/issues/1169
run: git config --system --add safe.directory /__w/warfork-qfusion/warfork-qfusion
- name: Download steamworks sdk
run: |
curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip
unzip third-party/steamworks/sdk.zip -d third-party/steamworks
- name: Building Release
if: matrix.config.type == 'release'
working-directory: ./source
run: |
export CC=clang-11 CXX=clang++-11
cmake -B ./build ${{matrix.config.cmake_args}} -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=Release
cd build
make -j8
- name: Building Debug
if: matrix.config.type == 'debug'
working-directory: ./source
run: |
export CC=clang-11 CXX=clang++-11
cmake -B ./build ${{matrix.config.cmake_args}} -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=Debug
cd build
make -j8
- name: Unit Test
working-directory: ./source/build/warfork-qfusion
shell: bash
run: |
set -e
for exc in ./test/*; do
$exc
done
- name: Package warfork
working-directory: ./source/build/warfork-qfusion
run: tar --exclude='*.a' --exclude='base*/*.a' --exclude='libs/*.a' --exclude='test' -zcvf ../${{matrix.config.name}}.tar.gz *
- name: Upload warfork artifact
uses: actions/upload-artifact@v3
with:
name: ${{matrix.config.name}}
path: source/build/${{matrix.config.name}}.tar.gz
osx:
strategy:
max-parallel: 1
matrix:
config:
- {
agent: "macos-13",
name: "OSX-x86_64-Release",
xcode-version: "15.0.1",
type: "release",
cmake_args: "-DBUILD_STEAMLIB=1 -DUSE_SYSTEM_CURL=1",
build_folder: "Release",
}
- {
agent: "macos-13",
name: "OSX-x86_64-Debug",
xcode-version: "15.0.1",
type: "debug",
cmake_args: "-DBUILD_STEAMLIB=1 -DWF_BUILD_DSYM=ON -DUSE_SYSTEM_CURL=1",
build_folder: "Debug",
}
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.agent }}
steps:
- name: Replace problem-causing python installation - https://github.com/TeamForbiddenLLC/warfork-qfusion/pull/325 - Fixed in macos-14
shell: bash
run: |
brew uninstall --force azure-cli aws-sam-cli
brew install python@3 || brew link --overwrite python@3
- name: Install deps
uses: gerlero/brew-install@v1
with:
packages: cmake git zip unzip libidn2 curl
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{matrix.config.xcode-version}}
- name: Download steamworks sdk
run: |
curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip
unzip third-party/steamworks/sdk.zip -d third-party/steamworks
- name: Building Release
if: matrix.config.type == 'release'
working-directory: ./source
run: |
cmake -B ./build ${{matrix.config.cmake_args}} -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=RELEASE -G Xcode
cd build
xcodebuild -project qfusion.xcodeproj/ -jobs 4 -configuration Release -target ALL_BUILD CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
- name: Building Debug
if: matrix.config.type == 'debug'
working-directory: ./source
run: |
cmake -B ./build ${{matrix.config.cmake_args}} -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=DEBUG -G Xcode
cd build
xcodebuild -project qfusion.xcodeproj/ -jobs 4 -configuration Debug -target ALL_BUILD CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
- name: Package warfork
working-directory: ./source/build/warfork-qfusion
run: tar --exclude='test' -czvf ../${{matrix.config.name}}.tar.gz ${{matrix.config.build_folder}}/*.app
- name: Unit Test
working-directory: ./source/build/warfork-qfusion/${{matrix.config.build_folder}}
run: |
set -e
for exc in ./test/*[^.dSYM]; do
$exc
done
- name: Upload warfork artifact
uses: actions/upload-artifact@v3
with:
name: ${{matrix.config.name}}
path: source/build/${{matrix.config.name}}.tar.gz
windows:
strategy:
max-parallel: 1
matrix:
config:
- {
agent: "windows-2019",
name: "win-x86_64-Release",
vs_version: "Visual Studio 16 2019",
type: "release",
cmake_args: "-DBUILD_STEAMLIB=1",
build_folder: "Release",
}
- {
agent: "windows-2019",
name: "win-x86_64-Debug",
vs_version: "Visual Studio 16 2019",
type: "debug",
cmake_args: "-DBUILD_STEAMLIB=1 -DWF_BUILD_DSYM=ON",
build_folder: "Debug",
}
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.agent }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download steamworks sdk
run: |
curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip
7z x third-party/steamworks/sdk.zip -othird-party/steamworks
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Building Debug
if: matrix.config.type == 'debug'
working-directory: .\source
run: |
cmake -B ./build ${{matrix.config.cmake_args}} -G "${{matrix.config.vs_version}}" -A x64 -DBUILD_UNIT_TEST=1
cd build
msbuild qfusion.sln /p:configuration=Debug /maxcpucount:8
- name: Building Release
if: matrix.config.type == 'release'
working-directory: .\source
run: |
cmake -B ./build ${{matrix.config.cmake_args}} -G "${{matrix.config.vs_version}}" -A x64 -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=RELEASE
cd build
msbuild qfusion.sln /p:configuration=Release /maxcpucount:8
- name: Unit Test
shell: bash
working-directory: .\source\build\warfork-qfusion\${{matrix.config.build_folder}}
run: |
set -e
for exc in ./test/*[^.pdb]; do
$exc
done
- name: Package warfork
working-directory: .\source\build\warfork-qfusion\${{matrix.config.build_folder}}
run: 7z a ..\..\${{matrix.config.name}}.zip * '-xr!*.exp' '-xr!*.lib' '-xr!test'
- name: Upload warfork artifact
uses: actions/upload-artifact@v3
with:
name: ${{matrix.config.name}}
path: source\build\${{matrix.config.name}}.zip