-
Notifications
You must be signed in to change notification settings - Fork 12
434 lines (398 loc) · 18.2 KB
/
validate.yml
File metadata and controls
434 lines (398 loc) · 18.2 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
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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
name: validate
on:
workflow_call:
inputs:
SDL2_VERSION:
type: string
required: false
default: '2.30.3'
N64RECOMP_COMMIT:
type: string
required: false
default: '98bf104b1b5ed83126af8bcab0cc964782617dbf'
secrets:
SF64_REPO_WITH_PAT:
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-linux:
runs-on: ubuntu-22.04
strategy:
matrix:
type: [ Debug, Release ]
os: [ ubuntu-22.04 ]
name: ubuntu-22.04 (x64, ${{ matrix.type }}, Native, AppImage)
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
submodules: recursive
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.os }}-z64re-ccache-${{ matrix.type }}-x64-${{ inputs.N64RECOMP_COMMIT }}
- name: Install Linux Dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build libsdl2-dev libgtk-3-dev lld llvm clang-15 libfuse2
# Install SDL2
echo ::group::install SDL2
# Enable ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
wget https://github.com/libsdl-org/SDL/releases/download/release-${{ inputs.SDL2_VERSION }}/SDL2-${{ inputs.SDL2_VERSION }}.tar.gz
tar -xzf SDL2-${{ inputs.SDL2_VERSION }}.tar.gz
cd SDL2-${{ inputs.SDL2_VERSION }}
./configure
make -j 10
sudo make install
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
echo ::endgroup::
- name: Get extra dependencies
uses: actions/checkout@v4
with:
repository: ${{ secrets.SF64_REPO_WITH_PAT }}
token: ${{ secrets.SF64_RECOMP }}
path: sf64-secret
- name: Prepare Build
run: cp -r sf64-secret/starfox64.us.rev1.uncompressed.z64 ./
- name: Build N64Recomp & RSPRecomp
run: |
git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource
cd N64RecompSource
git checkout ${{ inputs.N64RECOMP_COMMIT }}
git submodule update --init --recursive
# enable ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
# Build N64Recomp & RSPRecomp
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
cmake --build cmake-build --config Release --target N64RecompCLI -j $(nproc)
cmake --build cmake-build --config Release --target RSPRecomp -j $(nproc)
# Copy N64Recomp & RSPRecomp to root directory
cp cmake-build/N64Recomp ..
cp cmake-build/RSPRecomp ..
- name: Run N64Recomp & RSPRecomp
run: |
./N64Recomp us.rev1.toml
./RSPRecomp aspMain.us.rev1.toml
- name: Build Starfox64Recomp
run: |-
# enable ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang++-15 -DCMAKE_C_COMPILER=clang-15 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
cmake --build cmake-build --config ${{ matrix.type }} --target Starfox64Recompiled -j $(nproc)
- name: Prepare Archive
run: |
mv cmake-build/Starfox64Recompiled Starfox64Recompiled
rm -rf assets/scss
tar -czf Starfox64Recompiled.tar.gz Starfox64Recompiled assets/ recompcontrollerdb.txt
- name: Archive Starfox64Recomp
uses: actions/upload-artifact@v4
with:
name: Starfox64Recompiled-${{ runner.os }}-X64-${{ matrix.type }}
path: Starfox64Recompiled.tar.gz
- name: Build AppImage
run: |-
./.github/linux/appimage.sh
- name: Starfox64Recomp AppImage
uses: actions/upload-artifact@v4
with:
name: Starfox64Recompiled-AppImage-X64-${{ matrix.type }}
path: Starfox64Recompiled-*.AppImage
build-linux-flatpak:
runs-on: ubuntu-latest
env:
FLATPAK_ID: io.github.starfox64recomp.starfox64recomp
FREEDESKTOP_VERSION: 23.08
LLVM_VERSION: 18
strategy:
matrix:
type: [ Debug, Release ]
os: [ ubuntu-latest ]
name: ${{ matrix.os }} (x64, ${{ matrix.type }}, Flatpak)
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
submodules: recursive
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.os }}-z64re-ccache-${{ matrix.type }}-x64-${{ inputs.N64RECOMP_COMMIT }}
- name: Install Linux Dependencies
run: |
sudo apt-get update
sudo apt-get install -y flatpak-builder ccache lld
- name: Get extra dependencies
uses: actions/checkout@v4
with:
repository: ${{ secrets.SF64_REPO_WITH_PAT }}
token: ${{ secrets.SF64_RECOMP }}
path: sf64-secret
- name: Prepare Build
run: cp -r sf64-secret/starfox64.us.rev1.uncompressed.z64 ./
- name: Prepare Flatpak
run: |
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak --user install -y flathub org.freedesktop.Sdk//${{ env.FREEDESKTOP_VERSION }}
flatpak --user install -y flathub org.freedesktop.Sdk.Extension.llvm${{ env.LLVM_VERSION }}//${{ env.FREEDESKTOP_VERSION }}
- name: Build Starfox64Recomp
run: |-
export CCACHE_DIR=/tmp/ccache
git config --global protocol.file.allow always
make -C patches CC=clang LD=ld.lld
flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo --ccache builddir ./flatpak/${{ env.FLATPAK_ID }}.json
flatpak build-bundle repo ./${{ env.FLATPAK_ID }}.flatpak ${{ env.FLATPAK_ID }} --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Starfox64Recompiled-Flatpak-X64-${{ matrix.type }}
path: ./${{ env.FLATPAK_ID }}.flatpak
build-linux-arm64:
runs-on: ubuntu-22.04-arm
strategy:
matrix:
type: [ Debug, Release ]
os: [ ubuntu-22.04 ]
name: ubuntu-22.04 (arm64, ${{ matrix.type }}, Native, AppImage)
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
submodules: recursive
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.os }}-z64re-ccache-${{ matrix.type }}-arm64-${{ inputs.N64RECOMP_COMMIT }}
- name: Install Linux Dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build libsdl2-dev libgtk-3-dev lld llvm clang-15 libfuse2
# Install SDL2
echo ::group::install SDL2
# Enable ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
wget https://github.com/libsdl-org/SDL/releases/download/release-${{ inputs.SDL2_VERSION }}/SDL2-${{ inputs.SDL2_VERSION }}.tar.gz
tar -xzf SDL2-${{ inputs.SDL2_VERSION }}.tar.gz
cd SDL2-${{ inputs.SDL2_VERSION }}
./configure
make -j 10
sudo make install
sudo cp -av /usr/local/lib/libSDL* /lib/aarch64-linux-gnu/
echo ::endgroup::
- name: Get extra dependencies
uses: actions/checkout@v4
with:
repository: ${{ secrets.SF64_REPO_WITH_PAT }}
token: ${{ secrets.SF64_RECOMP }}
path: sf64-secret
- name: Prepare Build
run: cp -r sf64-secret/starfox64.us.rev1.uncompressed.z64 ./
- name: Build N64Recomp & RSPRecomp
run: |
git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource
cd N64RecompSource
git checkout ${{ inputs.N64RECOMP_COMMIT }}
git submodule update --init --recursive
# enable ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
# Build N64Recomp & RSPRecomp
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
cmake --build cmake-build --config Release --target N64RecompCLI -j $(nproc)
cmake --build cmake-build --config Release --target RSPRecomp -j $(nproc)
# Copy N64Recomp & RSPRecomp to root directory
cp cmake-build/N64Recomp ..
cp cmake-build/RSPRecomp ..
- name: Run N64Recomp & RSPRecomp
run: |
./N64Recomp us.rev1.toml
./RSPRecomp aspMain.us.rev1.toml
- name: Build Starfox64Recomp
run: |-
# enable ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang++-15 -DCMAKE_C_COMPILER=clang-15 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
cmake --build cmake-build --config ${{ matrix.type }} --target Starfox64Recompiled -j $(nproc)
- name: Prepare Archive
run: |
mv cmake-build/Starfox64Recompiled Starfox64Recompiled
rm -rf assets/scss
tar -czf Starfox64Recompiled.tar.gz Starfox64Recompiled assets/ recompcontrollerdb.txt
- name: Archive Starfox64Recomp
uses: actions/upload-artifact@v4
with:
name: Starfox64Recompiled-${{ runner.os }}-ARM64-${{ matrix.type }}
path: Starfox64Recompiled.tar.gz
- name: Build AppImage
run: |-
./.github/linux/appimage.sh
- name: Starfox64Recomp AppImage
uses: actions/upload-artifact@v4
with:
name: Starfox64Recompiled-AppImage-ARM64-${{ matrix.type }}
path: Starfox64Recompiled-*.AppImage
build-windows:
runs-on: windows-latest
strategy:
matrix:
type: [ Debug, RelWithDebInfo ]
name: windows (${{ matrix.type }})
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
submodules: recursive
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-z64re-ccache-${{ matrix.type }}
- name: Install Windows Dependencies
run: |
choco install ninja
Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force -ErrorAction SilentlyContinue
- name: Download portable LLVM
run: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.3/LLVM-19.1.3-Windows-X64.tar.xz" -OutFile "LLVM.tar.xz"
New-Item -ItemType Directory -Path portable-llvm > $null
7z x LLVM.tar.xz
7z x LLVM.tar -oportable-llvm
- name: Configure Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
- name: Get extra dependencies
uses: actions/checkout@v4
with:
repository: ${{ secrets.SF64_REPO_WITH_PAT }}
token: ${{ secrets.SF64_RECOMP }}
path: sf64-secret
- name: Prepare Build
run: copy .\sf64-secret\starfox64.us.rev1.uncompressed.z64 .\
- name: Build N64Recomp & RSPRecomp
run: |
git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource
cd N64RecompSource
git checkout ${{ inputs.N64RECOMP_COMMIT }}
git submodule update --init --recursive
# enable ccache
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
$cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
cmake --build cmake-build --config Release --target N64RecompCLI -j $cpuCores
cmake --build cmake-build --config Release --target RSPRecomp -j $cpuCores
# Copy N64Recomp & RSPRecomp to root directory
cp cmake-build/N64Recomp.exe ..
cp cmake-build/RSPRecomp.exe ..
- name: Run N64Recomp & RSPRecomp
run: |
./N64Recomp.exe us.rev1.toml
./RSPRecomp.exe aspMain.us.rev1.toml
- name: Build Starfox64Recomp
run: |-
# enable ccache
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
$cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors
# remove LLVM from PATH so it doesn't overshadow the one provided by VS
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' }) -join ';'
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_MAKE_PROGRAM=ninja -DPATCHES_C_COMPILER="..\portable-llvm\LLVM-19.1.3-Windows-X64\bin\clang" -DPATCHES_LD="..\portable-llvm\LLVM-19.1.3-Windows-X64\bin\ld.lld" -G Ninja -S . -B cmake-build -DCMAKE_CXX_FLAGS="-Xclang -fexceptions -Xclang -fcxx-exceptions"
cmake --build cmake-build --config ${{ matrix.type }} --target Starfox64Recompiled -j $cpuCores
env:
SDL2_VERSION: ${{ inputs.SDL2_VERSION }}
- name: Prepare Archive
run: |
Move-Item -Path "cmake-build/Starfox64Recompiled.exe" -Destination "Starfox64Recompiled.exe"
Move-Item -Path "cmake-build/dxcompiler.dll" -Destination "dxcompiler.dll"
Move-Item -Path "cmake-build/dxil.dll" -Destination "dxil.dll"
Move-Item -Path "cmake-build/SDL2.dll" -Destination "SDL2.dll"
Move-Item -Path "cmake-build/Starfox64Recompiled.pdb" -Destination "Starfox64Recompiled.pdb"
Remove-Item -Path "assets/scss" -Recurse -Force
- name: Archive Starfox64Recomp
uses: actions/upload-artifact@v4
with:
name: Starfox64Recompiled-${{ runner.os }}-${{ matrix.type }}
path: |
Starfox64Recompiled.exe
dxcompiler.dll
dxil.dll
SDL2.dll
assets/
recompcontrollerdb.txt
- name: Archive Debug Files
uses: actions/upload-artifact@v4
with:
name: Starfox64Recompiled-PDB-${{ matrix.type }}
path: |
Starfox64Recompiled.pdb
build-macos:
runs-on: macos-14
strategy:
matrix:
type: [ Debug, Release ]
name: macos (x64, arm64, ${{ matrix.type }})
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
submodules: recursive
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-z64re-ccache-${{ matrix.type }}
- name: Homebrew Setup
run: |
brew install ninja
brew uninstall --ignore-dependencies libpng freetype
- name: MacPorts Setup
uses: melusina-org/setup-macports@v1
id: 'macports'
with:
parameters: '.github/macos/macports.yaml'
- name: Get extra dependencies
uses: actions/checkout@v4
with:
repository: ${{ secrets.SF64_REPO_WITH_PAT }}
token: ${{ secrets.SF64_RECOMP }}
path: sf64-secret
- name: Prepare Build
run: cp -r sf64-secret/starfox64.us.rev1.uncompressed.z64 ./
- name: Build N64Recomp & RSPRecomp
run: |
git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource
cd N64RecompSource
git checkout ${{ inputs.N64RECOMP_COMMIT }}
git submodule update --init --recursive
# enable ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
# Build N64Recomp & RSPRecomp
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
cmake --build cmake-build --config Release --target N64Recomp -j $(sysctl -n hw.ncpu)
cmake --build cmake-build --config Release --target RSPRecomp -j $(sysctl -n hw.ncpu)
# Copy N64Recomp & RSPRecomp to root directory
cp cmake-build/N64Recomp ..
cp cmake-build/RSPRecomp ..
- name: Run N64Recomp & RSPRecomp
run: |
./N64Recomp us.rev1.toml
./RSPRecomp aspMain.us.rev1.toml
- name: Build Starfox64Recomp
run: |-
# enable ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build \
-DPATCHES_LD=/opt/local/bin/ld.lld-mp-18 -DCMAKE_AR=/opt/local/bin/llvm-ar-mp-18 -DPATCHES_C_COMPILER=/opt/local/bin/clang-mp-18 \
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
cmake --build cmake-build --config ${{ matrix.type }} --target Starfox64Recompiled -j $(sysctl -n hw.ncpu)
- name: Prepare Archive
run: |
mv cmake-build/Starfox64Recompiled.app Starfox64Recompiled.app
zip -r -y Starfox64Recompiled.zip Starfox64Recompiled.app
- name: Archive Starfox64Recomp
uses: actions/upload-artifact@v4
with:
name: Starfox64Recompiled-${{ runner.os }}-${{ matrix.type }}
path: Starfox64Recompiled.zip