-
Notifications
You must be signed in to change notification settings - Fork 2.2k
401 lines (350 loc) · 11.7 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
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
name: Build
on:
push:
branches:
- master
# For testing.
- actions
tags:
- "v*.*"
paths-ignore:
- '*.{txt,md}'
- 'Tools/**'
- '.{editorconfig,gitattributes,gitignore}'
- 'appveyor.yml'
pull_request:
branches:
- master
paths-ignore:
- '*.{txt,md}'
- 'Tools/**'
- '.{editorconfig,gitattributes,gitignore}'
- 'appveyor.yml'
env:
BUILD_CONFIGURATION: Release
jobs:
build-windows:
strategy:
fail-fast: false
matrix:
platform: [x64, ARM64]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build Windows
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: msbuild /m /p:TrackFileAccess=false /p:Configuration=${{ env.BUILD_CONFIGURATION }} /p:Platform=${{ matrix.platform }} Windows/PPSSPP.sln
- name: Package build
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
mkdir ppsspp
cp PPSSPP*.exe ppsspp/
cp *.pdb ppsspp/
cp Windows/*.bat ppsspp/
cp -r assets ppsspp/assets
- name: Package headless (non-Win32)
if: matrix.platform != 'Win32'
run: cp Windows/${{ matrix.platform }}/Release/*.exe ppsspp/
- name: Package headless (Win32)
if: matrix.platform == 'Win32'
run: cp Windows/Release/*.exe ppsspp/
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: Windows ${{ matrix.platform }} build
path: ppsspp/
build-uwp:
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build UWP
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: msbuild /m /p:TrackFileAccess=false /p:Configuration=${{ env.BUILD_CONFIGURATION }} /p:Platform=x64 /p:AppxPackageSigningEnabled=false UWP/PPSSPP_UWP.sln
test-windows:
runs-on: windows-latest
needs: build-windows
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: false
- name: Fetch tests
working-directory: ${{ env.GITHUB_WORKSPACE }}
# Doing this to avoid ffmpeg and other large submodules.
run: git submodule update --init pspautotests assets/lang
- name: Download build
uses: actions/download-artifact@v4
with:
name: Windows x64 build
path: ppsspp/
- name: Execute unit tests
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: ppsspp\\UnitTest.exe ALL
- name: Execute headless tests
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: python test.py -g --graphics=software
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
extra: test
cc: clang
cxx: clang++
args: ./b.sh --headless --unittest
id: clang-normal
- os: ubuntu-latest
cc: gcc
cxx: g++
args: ./b.sh --headless --unittest
id: gcc-normal
- os: ubuntu-latest
extra: android
cc: clang
cxx: clang++
args: cd android && ./ab.sh -j2 APP_ABI=arm64-v8a UNITTEST=1 HEADLESS=1
id: android-arm64
- os: ubuntu-latest
extra: android
cc: clang
cxx: clang++
args: cd android && ./ab.sh -j2 APP_ABI=armeabi-v7a UNITTEST=1 HEADLESS=1
id: android-arm32
- os: ubuntu-latest
extra: android
cc: clang
cxx: clang++
args: cd android && ./ab.sh -j2 APP_ABI=x86_64 UNITTEST=1 HEADLESS=1
id: android-x86_64
- os: ubuntu-latest
extra: android
cc: clang
cxx: clang++
args: cd android && ./ab.sh -j2 APP_ABI=arm64-v8a OPENXR=1
id: android-vr
- os: ubuntu-latest
extra: android
cc: clang
cxx: clang++
args: ./b.sh --libretro_android ppsspp_libretro
id: android-libretro
- os: ubuntu-latest
extra: qt
cc: gcc
cxx: g++
args: ./b.sh --qt
id: qt
- os: ubuntu-latest
extra: libretro
cc: gcc
cxx: g++
args: make -C libretro -f Makefile -j2
id: gcc-libretro
- os: ubuntu-latest
extra: libretro
cc: clang
cxx: clang++
args: make -C libretro -f Makefile -j2
id: clang-libretro
- os: macos-latest
extra: test
cc: clang
cxx: clang++
args: ./b.sh --headless --unittest --fat --no-png --no-sdl2
id: macos
- os: macos-latest
extra: ios
cc: clang
cxx: clang++
args: ./b.sh --ios
id: ios
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Fetch tags for macOS releases
if: runner.os == 'macOS'
# This is required for git describe --always to work for git-version.cpp.
run: |
git fetch --deepen=15000 --no-recurse-submodules --tags || exit 0
- name: Install Qt
uses: jurplel/install-qt-action@v4
if: matrix.extra == 'qt'
with:
cache: true
- uses: nttld/setup-ndk@v1
if: matrix.extra == 'android'
id: setup-ndk
with:
ndk-version: r21e
- name: Install Linux dependencies
if: runner.os == 'Linux' && matrix.extra != 'android'
run: |
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
sudo apt-get update -y -qq
sudo apt-get install libsdl2-dev libgl1-mesa-dev libglu1-mesa-dev libsdl2-ttf-dev libfontconfig1-dev
- name: Create macOS git-version.cpp for tagged release
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'macOS' && matrix.extra == 'test'
run: |
echo "const char *PPSSPP_GIT_VERSION = \"${GITHUB_REF##*/}\";" > git-version.cpp
echo "#define PPSSPP_GIT_VERSION_NO_UPDATE 1" >> git-version.cpp
- name: Setup ccache
uses: hendrikmuhs/[email protected]
# Disable ccache on macos for now, it's become buggy for some reason.
if: matrix.id != 'macos'
with:
key: ${{ matrix.id }}
- name: Execute build
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
NDK_CCACHE: ccache
USE_CCACHE: 1
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export CCACHE_SLOPPINESS=clang_index_store,ivfsoverlay,include_file_ctime,include_file_mtime,modules,system_headers,time_macros
if [ "${{ matrix.extra }}" == "android" ]; then
export CCACHE_FILECLONE=true
export CCACHE_DEPEND=true
export CCACHE_COMPILERCHECK=content
elif [ "$RUNNER_OS" == "macOS" ]; then
export CCACHE_SLOPPINESS=pch_defines,$CCACHE_SLOPPINESS
export CCACHE_FILECLONE=true
export CCACHE_DEPEND=true
export CCACHE_COMPILERCHECK=content
fi
${{ matrix.args }}
- name: Package build
if: matrix.extra == 'test'
run: |
mkdir ppsspp
if [ -e build*/$BUILD_CONFIGURATION/PPSSPPSDL ]; then
cp build*/$BUILD_CONFIGURATION/PPSSPPSDL ppsspp/
elif [ -e build*/PPSSPPSDL.app ]; then
cp -a build*/PPSSPPSDL.app ppsspp/
# GitHub Actions zipping kills symlinks and permissions.
cd ppsspp
zip -qry PPSSPPSDL.zip PPSSPPSDL.app
rm -rf PPSSPPSDL.app
cd -
elif [ -e build*/PPSSPPSDL ]; then
cp build*/PPSSPPSDL ppsspp/
cp -r assets ppsspp/assets
fi
if [ -e build*/$BUILD_CONFIGURATION/PPSSPPHeadless ]; then
cp build*/$BUILD_CONFIGURATION/PPSSPPHeadless ppsspp/
elif [ -e build*/PPSSPPHeadless ]; then
cp build*/PPSSPPHeadless ppsspp/
fi
if [ -e build*/$BUILD_CONFIGURATION/PPSSPPUnitTest ]; then
cp build*/$BUILD_CONFIGURATION/PPSSPPUnitTest ppsspp/
elif [ -e build*/PPSSPPUnitTest ]; then
cp build*/PPSSPPUnitTest ppsspp/
fi
- name: Upload build
uses: actions/upload-artifact@v4
if: matrix.extra == 'test'
with:
name: ${{ matrix.os }} build
path: ppsspp/
- name: Create macOS release
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'macOS' && matrix.extra == 'test'
run: |
cd ppsspp || exit 1
mv PPSSPPSDL.zip PPSSPPSDL-macOS-${GITHUB_REF##*/}.zip || exit 1
- name: Upload macOS release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'macOS' && matrix.extra == 'test'
with:
files: ppsspp/*.zip
body: >
PPSSPP is a cross-platform PSP emulator.
Visit PPSSPP [official website](https://ppsspp.org)
for a [full changelog](https://ppsspp.org/index.html#news)
as well as the [downloads section](https://ppsspp.org/downloads.html)
for other platforms.
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
needs: build
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: false
- name: Fetch tests
working-directory: ${{ env.GITHUB_WORKSPACE }}
# Doing this to avoid ffmpeg and other large submodules.
run: git submodule update --init pspautotests assets/lang
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
sudo apt-get update -y -qq
sudo apt-get install libsdl2-dev libgl1-mesa-dev libglu1-mesa-dev libsdl2-ttf-dev libfontconfig1-dev
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: |
git submodule update --init SDL/macOS
- name: Download build
uses: actions/download-artifact@v4
with:
name: ${{ matrix.os }} build
path: ppsspp/
# Not sure where it's ending up, but test.py can't find it...
- name: Fix headless permissions
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
cp `find . -name PPSSPPHeadless` .
chmod +x PPSSPPHeadless
cp `find . -name PPSSPPUnitTest` .
chmod +x PPSSPPUnitTest
- name: Execute unit tests
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: ./PPSSPPUnitTest ALL
- name: Execute headless tests
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: python test.py -g --graphics=software
build_test_headless_alpine:
runs-on: ubuntu-latest
container:
image: alpine:latest
options: --shm-size=8g
steps:
- name: Install Linux dependencies (Alpine)
run: |
apk add build-base wget git bash cmake python3 glu-dev sdl2-dev
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Fix git detected dubious ownership in repository
run: |
chown -R $(id -u):$(id -g) $PWD
- name: Setup ccache
uses: hendrikmuhs/[email protected]
- name: Compile ffmpeg
run: |
cd ffmpeg && ./linux_x86-64.sh
- name: Build for testing
run: |
./b.sh --headless --unittest
- name: Execute unit tests
run: |
./build/PPSSPPUnitTest ALL
- name: Execute headless tests
run: |
python test.py -g --graphics=software