-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path.gitlab-ci.yml
706 lines (668 loc) · 23.3 KB
/
.gitlab-ci.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
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
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
include:
- template: Jobs/Dependency-Scanning.latest.gitlab-ci.yml
- template: Jobs/SAST.latest.gitlab-ci.yml
- template: Jobs/License-Scanning.latest.gitlab-ci.yml
- template: Jobs/Code-Quality.gitlab-ci.yml
- template: Jobs/Secret-Detection.latest.gitlab-ci.yml
code_quality:
artifacts:
paths: [gl-code-quality-report.json]
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_REF_NAME == "next"'
- if: '$CI_COMMIT_TAG'
stages:
- prepare
- check
- build
- test
- deploy
variables:
GIT_SUBMODULE_STRATEGY: recursive
SAST_EXCLUDED_PATHS: spec, test, tests, tmp, simulant/deps
pages:
stage: prepare
image: fedora:33
script:
- dnf install -y doxygen python3 git
- python3 tools/gendocs.py `pwd` `git describe --abbrev=4 --always --tags | cut -d - -f 1-2` `pwd`
- mv `git describe --abbrev=4 --always --tags | cut -d - -f 1-2`/html public
artifacts:
paths:
- public
only:
- master
prepare:linux-x64-gcc:
stage: prepare
image: docker:latest
services:
- docker:dind
variables:
GIT_STRATEGY: none # Prevent cloning
DOCKERFILE: >- # Generate a Dockerfile for the build image
FROM fedora:32\n
RUN dnf update -y && dnf clean all\n
RUN dnf install -y cmake make gcc-c++ python SDL2-devel openal-soft-devel zlib-devel mesa-libGL-devel SDL2 openal-soft mesa-libGL libstdc++ pulseaudio pulseaudio-utils xorg-x11-server-Xvfb xorg-x11-drv-dummy dpkg mesa-dri-drivers\n
before_script: # Put the variable into a Dockerfile
- echo -e $DOCKERFILE > Dockerfile
- cat Dockerfile
script:
- docker pull $CI_REGISTRY_IMAGE:linux-x64-gcc || true
- docker build --cache-from $CI_REGISTRY_IMAGE:linux-x64-gcc -t $CI_REGISTRY_IMAGE:linux-x64-gcc .
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push $CI_REGISTRY_IMAGE:linux-x64-gcc
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- .gitlab-ci.yml
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- .gitlab-ci.yml
prepare:linux-x64-gcc11:
stage: prepare
image: docker:latest
services:
- docker:dind
variables:
GIT_STRATEGY: none # Prevent cloning
DOCKERFILE: >- # Generate a Dockerfile for the build image
FROM fedora:33\n
RUN dnf update -y && dnf clean all\n
RUN dnf install -y cmake make gcc-c++ python SDL2-devel openal-soft-devel zlib-devel mesa-libGL-devel SDL2 openal-soft mesa-libGL libstdc++ pulseaudio pulseaudio-utils xorg-x11-server-Xvfb xorg-x11-drv-dummy dpkg mesa-dri-drivers\n
before_script: # Put the variable into a Dockerfile
- echo -e $DOCKERFILE > Dockerfile
- cat Dockerfile
script:
- docker pull $CI_REGISTRY_IMAGE:linux-x64-gcc11 || true
- docker build --cache-from $CI_REGISTRY_IMAGE:linux-x64-gcc11 -t $CI_REGISTRY_IMAGE:linux-x64-gcc11 .
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push $CI_REGISTRY_IMAGE:linux-x64-gcc11
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- .gitlab-ci.yml
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- .gitlab-ci.yml
prepare:windows-x64-mingw:
stage: prepare
image: docker:latest
services:
- docker:dind
variables:
GIT_STRATEGY: none # Prevent cloning
DOCKERFILE: >- # Generate a Dockerfile for the build image
FROM fedora:38\n
RUN dnf upgrade --refresh -y\n
RUN dnf install -y mingw64-gcc-c++ mingw64-SDL2 mingw64-openal-soft mingw64-zlib cmake make gcc-c++ python wine winetricks wine-pulseaudio\n
RUN wine64 wineboot\n
before_script: # Put the variable into a Dockerfile
- echo -e $DOCKERFILE > Dockerfile
- cat Dockerfile
script:
- docker pull $CI_REGISTRY_IMAGE:windows-x64-mingw || true
- docker build --cache-from $CI_REGISTRY_IMAGE:windows-x64-mingw -t $CI_REGISTRY_IMAGE:windows-x64-mingw .
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push $CI_REGISTRY_IMAGE:windows-x64-mingw
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- .gitlab-ci.yml
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- .gitlab-ci.yml
prepare:deploy:
stage: prepare
image: docker:latest
services:
- docker:dind
variables:
GIT_STRATEGY: none # Prevent cloning
DOCKERFILE: >- # Generate a Dockerfile for the build image
FROM fedora:33\n
RUN dnf -y install openssl-devel python-devel python-setuptools libffi-devel python-pip rsync zip\n
RUN pip install gsutil\n
before_script: # Put the variable into a Dockerfile
- echo -e $DOCKERFILE > Dockerfile
- cat Dockerfile
script:
- docker pull $CI_REGISTRY_IMAGE:deploy || true
- docker build --cache-from $CI_REGISTRY_IMAGE:deploy -t $CI_REGISTRY_IMAGE:deploy .
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push $CI_REGISTRY_IMAGE:deploy
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- .gitlab-ci.yml
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- .gitlab-ci.yml
check:thread-usage:
stage: check
image: $CI_REGISTRY_IMAGE:linux-x64-gcc
script:
- python3 tools/find_std_thread.py simulant
check:deque-usage:
stage: check
image: $CI_REGISTRY_IMAGE:linux-x64-gcc
script:
- python3 tools/find_std_deque.py simulant
check:stream-usage:
stage: check
image: $CI_REGISTRY_IMAGE:linux-x64-gcc
script:
- python3 tools/find_std_stream.py simulant || true
artifacts:
reports:
metrics: metrics.txt
.build:android:
stage: build
image: kazade/android-sdk
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
script:
- cd gradle
- export ABI_FILTERS=${ABI}
- gradle ${BUILD_JOB} --parallel --build-cache
- cd ..
- mkdir -p ${TARGET}/${BUILD_TYPE}/simulant
- cp gradle/simulant/build/outputs/aar/*.aar ${TARGET}/${BUILD_TYPE}/simulant
- mkdir -p ${TARGET}/${BUILD_TYPE}/tests
- cp gradle/tests/build/outputs/apk/${BUILD_TYPE}/* ${TARGET}/${BUILD_TYPE}/tests
artifacts:
paths:
- ${TARGET}/release/simulant/
- ${TARGET}/release/tests/
cache:
paths:
- .gradle/wrapper
- .gradle/caches
build:android-armeabiv7a-clang:release:
extends: .build:android
variables:
ABI: armeabi-v7a
TARGET: android-armeabiv7a-clang
BUILD_TYPE: release
BUILD_JOB: assembleRelease
build:android-armeabiv7a-clang:debug:
extends: .build:android
variables:
ABI: armeabi-v7a
TARGET: android-armeabiv7a-clang
BUILD_TYPE: debug
BUILD_JOB: assembleDebug
build:android-x86_64-clang:release:
extends: .build:android
variables:
ABI: x86_64
TARGET: android-x86_64-clang
BUILD_TYPE: release
BUILD_JOB: assembleRelease
build:android-x86_64-clang:debug:
extends: .build:android
variables:
ABI: x86_64
TARGET: android-x86_64-clang
BUILD_TYPE: debug
BUILD_JOB: assembleDebug
build:psp-mips-gcc:debug:
stage: build
image: sharkwouter/pspdev
variables:
TARGET: psp-mips-gcc
script:
- mkdir -p ${TARGET}/debug
- cd ${TARGET}/debug
- cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/PSP.cmake -DCMAKE_BUILD_TYPE=Debug -DSIMULANT_BUILD_SAMPLES=OFF ../..
- make -j3
artifacts:
paths:
- ${TARGET}/debug/simulant/
- ${TARGET}/debug/sample_data/
- ${TARGET}/debug/tests/EBOOT.PBP
build:psp-mips-gcc:release:
stage: build
image: sharkwouter/pspdev
variables:
TARGET: psp-mips-gcc
script:
- mkdir -p ${TARGET}/release
- cd ${TARGET}/release
- cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/PSP.cmake -DCMAKE_BUILD_TYPE=Release -DSIMULANT_BUILD_SAMPLES=OFF ../..
- make -j3
artifacts:
paths:
- ${TARGET}/release/simulant/
- ${TARGET}/release/sample_data/
- ${TARGET}/release/tests/EBOOT.PBP
test:psp-mips-gcc:
stage: test
image: fedora:33
variables:
TARGET: psp-mips-gcc
needs: ["build:psp-mips-gcc:debug", "build:psp-mips-gcc:release"]
dependencies:
- build:psp-mips-gcc:debug
- build:psp-mips-gcc:release
before_script:
- dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
- dnf install -y dpkg ppsspp-sdl pulseaudio pulseaudio-utils xorg-x11-server-Xvfb xorg-x11-drv-dummy mesa-dri-drivers
- start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 320x240x24 -ac +extension RANDR +extension GLX +render
- sleep 3
- export LIBGL_ALWAYS_SOFTWARE=1
- export DISPLAY=:99
script:
- mkdir -p /root/.config/ppsspp/PSP/SYSTEM/
- cd ${TARGET}/debug
- export SIMULANT_SOUND_DRIVER=null
- ln -s ../simulant simulant
- ln -s ../sample_data sample_data
- cp tests/EBOOT.PBP .
# FIXME: PSP tests currently hang on future tests, we need to fix that!
- timeout 120s PPSSPPSDL -d --escape-exit EBOOT.PBP || true
artifacts:
when: always
reports:
junit: ${TARGET}/debug/report.xml
paths:
- ${TARGET}/debug/simulant/libsimulant.a
- ${TARGET}/release/simulant/libsimulant.a
deploy:psp-mips-gcc:
stage: deploy
only:
- master
- tags
image: $CI_REGISTRY_IMAGE:deploy
needs: ["test:psp-mips-gcc"]
dependencies:
- test:psp-mips-gcc
variables:
TARGET: psp-mips-gcc
script:
- mkdir -p ./upload/${TARGET}/lib
- mkdir -p ./upload/${TARGET}/lib/debug
- mkdir -p ./upload/${TARGET}/include/simulant
- cp ${TARGET}/release/simulant/libsimulant.a ./upload/${TARGET}/lib/
- cp ${TARGET}/debug/simulant/libsimulant.a ./upload/${TARGET}/lib/debug/
- rsync -avm -L --include='*.h' --include='*.hpp' --include='*.inc' -f 'hide,! */' simulant ./upload/${TARGET}/include
- cd upload
- zip -r ${TARGET}.zip ${TARGET}/
- echo -e "${GCS_ACCESS_KEY}\n${GCS_SECRET}\nsimulant-engine\n" | gsutil config -a
- gsutil cp ${TARGET}.zip gs://staging.simulant-engine.appspot.com/${CI_COMMIT_REF_NAME}/
- gsutil acl ch -u AllUsers:R gs://staging.simulant-engine.appspot.com/${CI_COMMIT_REF_NAME}/${TARGET}.zip
artifacts:
paths:
- upload/${TARGET}.zip
build:windows-x64-mingw:release:
stage: build
image: $CI_REGISTRY_IMAGE:windows-x64-mingw
variables:
MINGW_BIN_DIR: /usr/x86_64-w64-mingw32/sys-root/mingw/bin/
TARGET: windows-x64-mingw
script:
- mkdir -p ${TARGET}/release
- cd ${TARGET}/release
- sleep 5 && set -m && mingw64-cmake -DCMAKE_BUILD_TYPE=Release -DSIMULANT_BUILD_SAMPLES=OFF ../..
- make -j3
- cp $MINGW_BIN_DIR/zlib1.dll simulant/
- cp $MINGW_BIN_DIR/SDL2.dll simulant/
- cp $MINGW_BIN_DIR/libgcc_s_seh-1.dll simulant/
- cp $MINGW_BIN_DIR/libstdc++-6.dll simulant/
- cp $MINGW_BIN_DIR/libwinpthread-1.dll simulant/
- cp $MINGW_BIN_DIR/OpenAL32.dll simulant/
- cp $MINGW_BIN_DIR/libssp-0.dll simulant/
artifacts:
paths:
- ${TARGET}/release/simulant/*.dll
build:windows-x64-mingw:debug:
stage: build
image: $CI_REGISTRY_IMAGE:windows-x64-mingw
variables:
MINGW_BIN_DIR: /usr/x86_64-w64-mingw32/sys-root/mingw/bin/
TARGET: windows-x64-mingw
script:
- mkdir -p ${TARGET}/debug
- cd ${TARGET}/debug
- sleep 5 && set -m && mingw64-cmake -DCMAKE_BUILD_TYPE=Debug -DSIMULANT_BUILD_SAMPLES=OFF ../..
- make -j3
- cp $MINGW_BIN_DIR/zlib1.dll simulant/
- cp $MINGW_BIN_DIR/SDL2.dll simulant/
- cp $MINGW_BIN_DIR/libgcc_s_seh-1.dll simulant/
- cp $MINGW_BIN_DIR/libstdc++-6.dll simulant/
- cp $MINGW_BIN_DIR/libwinpthread-1.dll simulant/
- cp $MINGW_BIN_DIR/OpenAL32.dll simulant/
- cp $MINGW_BIN_DIR/libssp-0.dll simulant/
- cp simulant/*.dll tests/
artifacts:
paths:
- ${TARGET}/debug/simulant/
- ${TARGET}/debug/sample_data/
- ${TARGET}/debug/tests/simulant_tests.exe
- ${TARGET}/debug/tests/*.dll
test:windows-x64-mingw:
stage: test
image: $CI_REGISTRY_IMAGE:windows-x64-mingw
needs: ["build:windows-x64-mingw:debug", "build:windows-x64-mingw:release"]
variables:
TARGET: windows-x64-mingw
dependencies:
- build:windows-x64-mingw:debug
- build:windows-x64-mingw:release
before_script:
- dnf install -y xorg-x11-server-Xvfb xorg-x11-drv-dummy dpkg mesa-dri-drivers
- start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 320x240x24 -ac +extension RANDR +extension GLX +render
- sleep 3
- export LIBGL_ALWAYS_SOFTWARE=1
- export SIMULANT_SOUND_DRIVER=null
- export DISPLAY=:99
script:
- cd ${TARGET}/debug/tests
- ln -s ../simulant
- ln -s ../sample_data
- wine64 simulant_tests.exe --junit-xml=report.xml
artifacts:
reports:
junit: ${TARGET}/debug/tests/report.xml
paths:
- ${TARGET}/debug/simulant/*.dll
- ${TARGET}/release/simulant/*.dll
deploy:windows-x64-mingw:
stage: deploy
only:
- master
- tags
image: $CI_REGISTRY_IMAGE:deploy
dependencies:
- test:windows-x64-mingw
variables:
TARGET: windows-x64-mingw
script:
- mkdir -p ./upload/${TARGET}/lib
- mkdir -p ./upload/${TARGET}/lib/debug
- mkdir -p ./upload/${TARGET}/include/simulant
- cp ${TARGET}/release/simulant/*.dll ./upload/${TARGET}/lib/
- cp ${TARGET}/debug/simulant/*.dll ./upload/${TARGET}/lib/debug/
- rsync -avm -L --include='*.h' --include='*.hpp' --include='*.inc' -f 'hide,! */' simulant ./upload/${TARGET}/include
- cd upload
- zip -r ${TARGET}.zip ${TARGET}/
- echo -e "${GCS_ACCESS_KEY}\n${GCS_SECRET}\nsimulant-engine\n" | gsutil config -a
- gsutil cp ${TARGET}.zip gs://staging.simulant-engine.appspot.com/${CI_COMMIT_REF_NAME}/
- gsutil acl ch -u AllUsers:R gs://staging.simulant-engine.appspot.com/${CI_COMMIT_REF_NAME}/${TARGET}.zip
artifacts:
paths:
- upload/${TARGET}.zip
## clang build is currently just for checking compilation
build:linux-x64-clang:
stage: build
image: fedora:32
variables:
TARGET: linux-x64-clang
before_script:
- dnf install -y dnf && dnf clean all
- dnf install -y cmake make clang python SDL2-devel openal-soft-devel zlib-devel mesa-libGL-devel
script:
- export CC=/usr/bin/clang
- export CXX=/usr/bin/clang++
- mkdir -p ${TARGET}/debug
- cd ${TARGET}/debug
- cmake -DCMAKE_BUILD_TYPE=Debug -DSIMULANT_BUILD_SAMPLES=OFF ../..
- make -j3
- cd ../..
- mkdir -p ${TARGET}/release
- cd ${TARGET}/release
- cmake -DCMAKE_BUILD_TYPE=Release -DSIMULANT_BUILD_SAMPLES=OFF ../..
- make -j3
artifacts:
paths:
- ${TARGET}/debug/simulant/
- ${TARGET}/debug/sample_data/
- ${TARGET}/debug/tests/simulant_tests
- ${TARGET}/release/simulant/
build:linux-x64-gcc:
stage: build
image: $CI_REGISTRY_IMAGE:linux-x64-gcc
variables:
TARGET: linux-x64-gcc
script:
- mkdir -p ${TARGET}/debug
- cd ${TARGET}/debug
- cmake -DCMAKE_BUILD_TYPE=Debug -DSIMULANT_BUILD_SAMPLES=OFF ../..
- make -j3
- cd ../..
- mkdir -p ${TARGET}/release
- cd ${TARGET}/release
- cmake -DCMAKE_BUILD_TYPE=Release -DSIMULANT_BUILD_SAMPLES=OFF ../..
- make -j3
artifacts:
paths:
- ${TARGET}/debug/simulant/
- ${TARGET}/debug/sample_data/
- ${TARGET}/debug/tests/simulant_tests
- ${TARGET}/release/simulant/
- ${TARGET}/release/sample_data/
- ${TARGET}/release/tests/simulant_tests
build:linux-x64-gcc11:
stage: build
image: $CI_REGISTRY_IMAGE:linux-x64-gcc11
variables:
TARGET: linux-x64-gcc11
script:
- mkdir -p ${TARGET}/debug
- cd ${TARGET}/debug
- cmake -DCMAKE_BUILD_TYPE=Debug -DSIMULANT_BUILD_SAMPLES=OFF ../..
- make -j3
- cd ../..
- mkdir -p ${TARGET}/release
- cd ${TARGET}/release
- cmake -DCMAKE_BUILD_TYPE=Release -DSIMULANT_BUILD_SAMPLES=OFF ../..
- make -j3
artifacts:
paths:
- ${TARGET}/debug/simulant/
- ${TARGET}/debug/sample_data/
- ${TARGET}/debug/tests/simulant_tests
- ${TARGET}/release/simulant/
- ${TARGET}/release/sample_data/
- ${TARGET}/release/tests/simulant_tests
test:linux-x64-gcc-debug:
stage: test
image: $CI_REGISTRY_IMAGE:linux-x64-gcc
needs: ["build:linux-x64-gcc"]
dependencies:
- build:linux-x64-gcc
variables:
TARGET: linux-x64-gcc
before_script:
- start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 320x240x24 -ac +extension RANDR +extension GLX +render -noreset
- sleep 2
- export DISPLAY=:99
script:
- cd ${TARGET}/debug
- export SIMULANT_SOUND_DRIVER=null
- env SEGFAULT_SIGNALS="abrt segv" LD_PRELOAD=/usr/lib64/libSegFault.so ./tests/simulant_tests --junit-xml=report.xml
artifacts:
reports:
junit: ${TARGET}/debug/report.xml
paths:
- ${TARGET}/debug/simulant/
- ${TARGET}/release/simulant/
test:linux-x64-gcc-release:
stage: test
image: $CI_REGISTRY_IMAGE:linux-x64-gcc
needs: ["build:linux-x64-gcc"]
dependencies:
- build:linux-x64-gcc
variables:
TARGET: linux-x64-gcc
before_script:
- start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 320x240x24 -ac +extension RANDR +extension GLX +render -noreset
- sleep 2
- export DISPLAY=:99
script:
- cd ${TARGET}/release
- export SIMULANT_SOUND_DRIVER=null
- env SEGFAULT_SIGNALS="abrt segv" LD_PRELOAD=/usr/lib64/libSegFault.so ./tests/simulant_tests --junit-xml=report.xml
artifacts:
reports:
junit: ${TARGET}/release/report.xml
deploy:linux-x64-gcc:
stage: deploy
only:
- master
- tags
image: $CI_REGISTRY_IMAGE:deploy
dependencies:
- test:linux-x64-gcc-debug
- test:linux-x64-gcc-release
variables:
TARGET: linux-x64-gcc
script:
- mkdir -p ./upload/${TARGET}/lib
- mkdir -p ./upload/${TARGET}/lib/debug
- mkdir -p ./upload/${TARGET}/include/simulant
- cp ${TARGET}/release/simulant/libsimulant.so* ./upload/${TARGET}/lib/
- cp ${TARGET}/debug/simulant/libsimulant.so* ./upload/${TARGET}/lib/debug/
- rsync -avm -L --include='*.h' --include='*.hpp' --include='*.inc' -f 'hide,! */' simulant ./upload/${TARGET}/include
- cd upload
- zip -r ${TARGET}.zip ${TARGET}/
- echo -e "${GCS_ACCESS_KEY}\n${GCS_SECRET}\nsimulant-engine\n" | gsutil config -a
- gsutil cp ${TARGET}.zip gs://staging.simulant-engine.appspot.com/${CI_COMMIT_REF_NAME}/
- gsutil acl ch -u AllUsers:R gs://staging.simulant-engine.appspot.com/${CI_COMMIT_REF_NAME}/${TARGET}.zip
artifacts:
paths:
- upload/${TARGET}.zip
deploy:linux-x64-gcc11:
stage: deploy
only:
- master
- tags
image: $CI_REGISTRY_IMAGE:deploy
dependencies:
- build:linux-x64-gcc11
- test:linux-x64-gcc-debug
- test:linux-x64-gcc-release
variables:
TARGET: linux-x64-gcc11
script:
- mkdir -p ./upload/${TARGET}/lib
- mkdir -p ./upload/${TARGET}/lib/debug
- mkdir -p ./upload/${TARGET}/include/simulant
- cp ${TARGET}/release/simulant/libsimulant.so* ./upload/${TARGET}/lib/
- cp ${TARGET}/debug/simulant/libsimulant.so* ./upload/${TARGET}/lib/debug/
- rsync -avm -L --include='*.h' --include='*.hpp' --include='*.inc' -f 'hide,! */' simulant ./upload/${TARGET}/include
- cd upload
- zip -r ${TARGET}.zip ${TARGET}/
- echo -e "${GCS_ACCESS_KEY}\n${GCS_SECRET}\nsimulant-engine\n" | gsutil config -a
- gsutil cp ${TARGET}.zip gs://staging.simulant-engine.appspot.com/${CI_COMMIT_REF_NAME}/
- gsutil acl ch -u AllUsers:R gs://staging.simulant-engine.appspot.com/${CI_COMMIT_REF_NAME}/${TARGET}.zip
artifacts:
paths:
- upload/${TARGET}.zip
build:dreamcast-sh4-gcc:
stage: build
image: kazade/dreamcast-sdk
variables:
TARGET: dreamcast-sh4-gcc
script:
- source /etc/bash.bashrc
- mkdir -p ${TARGET}/debug
- cd ${TARGET}/debug
- cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../../toolchains/Dreamcast.cmake -DSIMULANT_BUILD_SAMPLES=OFF ../..
- make -j3
- cd ../..
- mkdir -p ${TARGET}/release
- cd ${TARGET}/release
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../toolchains/Dreamcast.cmake -DSIMULANT_BUILD_SAMPLES=OFF ../..
- make -j3
artifacts:
paths:
- ${TARGET}/debug/simulant/
- ${TARGET}/debug/sample_data/
- ${TARGET}/debug/tests/simulant_tests.elf
- ${TARGET}/release/simulant/
test:dreamcast-sh4-gcc:
stage: test
image: fedora:33
needs: ["build:dreamcast-sh4-gcc"]
allow_failure: true
variables:
TARGET: dreamcast-sh4-gcc
dependencies:
- build:dreamcast-sh4-gcc
before_script:
- dnf install -y wget unzip libisofs libpng mesa-libGL gtk2 pulseaudio-libs && dnf clean all
- wget -O artifacts.zip https://gitlab.com/simulant/community/lxdream-nitro/-/jobs/artifacts/master/download?job=linux-x64:build
- unzip artifacts.zip
- export PATH=$PATH:`pwd`/build
script:
- cd ${TARGET}/debug
- lxdream-nitro --audio=null -H -b -u -C `pwd` -e tests/simulant_tests.elf
artifacts:
when: always
paths:
- ${TARGET}/debug/simulant/*.a
- ${TARGET}/release/simulant/*.a
- ${TARGET}/release/*.out
deploy:dreamcast-sh4-gcc:
stage: deploy
only:
- master
- tags
image: $CI_REGISTRY_IMAGE:deploy
dependencies:
- test:dreamcast-sh4-gcc
variables:
TARGET: dreamcast-sh4-gcc
script:
- mkdir -p ./upload/${TARGET}/lib
- mkdir -p ./upload/${TARGET}/lib/debug
- mkdir -p ./upload/${TARGET}/include/simulant
- cp ${TARGET}/release/simulant/libsimulant.a* ./upload/${TARGET}/lib/
- cp ${TARGET}/debug/simulant/libsimulant.a* ./upload/${TARGET}/lib/debug/
- rsync -avm -L --include='*.h' --include='*.hpp' --include='*.inc' -f 'hide,! */' simulant ./upload/${TARGET}/include
- cd upload
- zip -r ${TARGET}.zip ${TARGET}/
- echo -e "${GCS_ACCESS_KEY}\n${GCS_SECRET}\nsimulant-engine\n" | gsutil config -a
- gsutil cp ${TARGET}.zip gs://staging.simulant-engine.appspot.com/${CI_COMMIT_REF_NAME}/
- gsutil acl ch -u AllUsers:R gs://staging.simulant-engine.appspot.com/${CI_COMMIT_REF_NAME}/${TARGET}.zip
artifacts:
paths:
- upload/${TARGET}.zip
deploy:assets:
stage: deploy
only:
- master
- tags
image: $CI_REGISTRY_IMAGE:deploy
script:
- mkdir -p upload
- mv assets upload/simulant
- cd upload
- zip -r assets.zip simulant/
- echo -e "${GCS_ACCESS_KEY}\n${GCS_SECRET}\nsimulant-engine\n" | gsutil config -a
- gsutil cp assets.zip gs://staging.simulant-engine.appspot.com/${CI_COMMIT_REF_NAME}/
- gsutil acl ch -u AllUsers:R gs://staging.simulant-engine.appspot.com/${CI_COMMIT_REF_NAME}/assets.zip
artifacts:
paths:
- upload/assets.zip
deploy:tools:
stage: deploy
only:
- master
- tags
image: $CI_REGISTRY_IMAGE:deploy
script:
- mkdir -p upload/simulant
- mkdir -p upload/simulant/cmake_modules
- cp tools/test_generator.py upload/simulant
- cp cmake_modules/FindSDL2.cmake upload/simulant/cmake_modules
- cd upload
- zip -r tools.zip simulant/
- echo -e "${GCS_ACCESS_KEY}\n${GCS_SECRET}\nsimulant-engine\n" | gsutil config -a
- gsutil cp tools.zip gs://staging.simulant-engine.appspot.com/${CI_COMMIT_REF_NAME}/
- gsutil acl ch -u AllUsers:R gs://staging.simulant-engine.appspot.com/${CI_COMMIT_REF_NAME}/tools.zip
artifacts:
paths:
- upload/tools.zip