-
Notifications
You must be signed in to change notification settings - Fork 696
/
.gitlab-ci.yml
847 lines (798 loc) · 28.7 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
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
# Our pipelines are auto cancelable when explicity set in 'rules'.
# GitLab is quite sensitive about rules 'if' order so be careful.
workflow:
auto_cancel:
on_new_commit: interruptible
# There are five "TYPES" of pipelines on our CI:
## 1. On MERGE REQUESTS, the following are triggered:
## - Abbreviated Linux Clang build (base & fast)
## - clang-format (static code analysis)
## - Execution tests (dynamic code analysis)
.pipeline_merge: &CI_MERGE
if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
interruptible: true
variables: {}
## 2. LABELED MERGE REQUESTS (search for 'CI_MERGE_REQUEST_LABELS').
#'interruptible: true' needs to be hardcoded on job
## 3. On COMMITS except tags.
## - Linux Clang build (base & fast)
## - Execution tests (dynamic code analysis)
## - Source tarball (base & fast)
## - Developer documentation (base & fast)
.pipeline_commit: &CI_COMMIT
if: '$CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS == null && $CI_COMMIT_TAG == null'
interruptible: true
variables: {}
## 4. RELEASES.
## - Source tarball (base & fast)
## - Developer documentation (base & fast)
## - Inno Windows installer (base but slow)
## - MS Store .msixupload (base but slow)
.pipeline_release: &CI_RELEASE
if: '$CI_COMMIT_TAG != null'
interruptible: false
variables: {}
.default:
## 5. On CUSTOM builds though web GUI, API or schedules.
## Scheduled CI ($CI_PIPELINE_SOURCE == "schedule") will run regularly:
## - GIMP_CI_MESON_GCC: trigger the Debian GCC build (rare usefulness).
## - GIMP_CI_RASTER_ICONS: trigger the Debian Clang build without vector icons (rare usefulness).
## - GIMP_CI_CPPCHECK: trigger cppcheck (static code analysis).
## - GIMP_CI_APPIMAGE: trigger the appimage making (experimental).
## - GIMP_CI_FLATPAK: trigger the flatpak build and publishing (base but slow).
## - GIMP_CI_WIN_INSTALLER: trigger all native MSYS2 builds then creates Inno Windows installer (base but slow).
## - GIMP_CI_MS_STORE: trigger arm64 and x64 native MSYS2 builds then creates a .msixbundle (base but slow).
## In addition to the variables above, to force step-specific pipelines
## without waiting for commits and/or schedules, these you should set on GUI:
## - GIMP_CI_MESON_CLANG: trigger the Debian Clang build.
## - GIMP_CI_CROSSROAD_WIN64: trigger the crossroad build for Win 64-bit.
## - GIMP_CI_MSYS2_WIN_AARCH64: trigger the native MSYS2 build for Win Aarch64.
## - GIMP_CI_MSYS2_WIN64: trigger the native MSYS2 build for Win 64-bit.
## - GIMP_CI_MSYS2_WIN32: trigger the native MSYS2 build for Win 32-bit.
## - GIMP_CI_SOURCES: trigger the Debian Clang build and the source tarball job.
interruptible: false
# Common jobs behavior
retry:
max: 1
when:
- 'runner_system_failure'
- 'scheduler_failure'
# Default Docker image (unless otherwise defined)
image: debian:bookworm
# Caching support
variables:
CCACHE_BASEDIR: "$CI_PROJECT_DIR"
CCACHE_DIR: "$CI_PROJECT_DIR/_ccache"
cache:
key: ${CI_JOB_NAME_SLUG}${VARIANT}
paths:
- _ccache/
# Common artifacts behavior
artifacts:
name: "${CI_JOB_NAME_SLUG}${VARIANT}-${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}"
when: always
variables:
# Common cloning procedure
GIT_DEPTH: "1"
GIT_SUBMODULE_STRATEGY: none
# Enable colorful output when supported (e.g. ninja, cppcheck)
CLICOLOR_FORCE: "1"
stages:
- prepare
- dependencies
- gimp
- analysis
- distribution
## prepare build-oriented Docker images ##
.debian:
extends: .default
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*5. AppImage package.*/'
interruptible: true
- if: '$GIMP_CI_APPIMAGE != null'
parallel:
matrix:
- RUNNER: [aarch64, x86_64_v2]
tags:
- $RUNNER
image: $CI_REGISTRY_IMAGE:build-debian-latest-${RUNNER}
variables:
CC: "ccache clang"
CXX: "ccache clang++"
CC_LD: lld
CXX_LD: lld
before_script:
- export GIMP_PREFIX="${CI_PROJECT_DIR}/_install-${RUNNER}"
- echo -e "\e[0Ksection_start:`date +%s`:environ[collapsed=true]\r\e[0KPreparing build environment"
- export PATH="$GIMP_PREFIX/bin:$PATH"
- gcc -print-multi-os-directory 2>/dev/null | grep ./ && export LIB_DIR=$(gcc -print-multi-os-directory | sed 's/\.\.\///g') || export LIB_DIR="lib"
- gcc -print-multiarch 2>/dev/null | grep . && export LIB_SUBDIR=$(echo $(gcc -print-multiarch)'/')
- export PKG_CONFIG_PATH="${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
- export LD_LIBRARY_PATH="${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
- export XDG_DATA_DIRS="${GIMP_PREFIX}/share:/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
- export GI_TYPELIB_PATH="${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}girepository-1.0${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}"
- echo -e "\e[0Ksection_end:`date +%s`:environ\r\e[0K"
.debian-x64:
extends: .debian
rules:
- <<: *CI_MERGE
- <<: *CI_COMMIT
- if: '$GIMP_CI_MESON_CLANG != null'
variables: {}
- if: '$GIMP_CI_MESON_GCC != null'
variables:
CC: "ccache cc"
CXX: "ccache c++"
CC_LD: bfd
CXX_LD: bfd
VARIANT: "-gcc"
- if: '$GIMP_CI_RASTER_ICONS != null'
variables:
MESON_OPTIONS: "-Dvector-icons=false"
VARIANT: "-raster"
- if: '$GIMP_CI_CROSSROAD_WIN64 != null'
- if: '$GIMP_CI_SOURCES != null'
- <<: *CI_RELEASE
parallel:
matrix:
- RUNNER: x86_64_v2
image-debian:
extends: .debian
stage: prepare
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
variables:
GIT_STRATEGY: none
cache: []
before_script: []
script:
- export container=docker
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- echo "FROM debian:bookworm" > Dockerfile
- echo "RUN apt-get update" >> Dockerfile
# 'ca-certificates' is NOT a gimp dep, it is installed only to our Docker image work
- echo "RUN apt-get install -y --no-install-recommends ca-certificates" >> Dockerfile
# Build-time only dependencies
- echo "RUN apt-get install -y --no-install-recommends \\" >> Dockerfile
- echo "appstream
ccache
clang
desktop-file-utils
gi-docgen
git
gobject-introspection
libgtk-3-bin
libtool
lld
meson
valac
xauth
xsltproc
xvfb
yelp-tools" >> Dockerfile
# Dependencies
- echo "RUN apt-get install -y --no-install-recommends \\" >> Dockerfile
- echo "at-spi2-core
ffmpeg
gettext
gjs
glib-networking
graphviz
graphviz-dev
hicolor-icon-theme
iso-codes
libaa1-dev
libappstream-glib-dev
libbz2-dev
libcfitsio-dev
libgexiv2-dev
libgirepository1.0-dev
libgs10
libgs-dev
libgtk-3-dev
libgudev-1.0-dev
libheif-dev
libjson-glib-dev
libjxl-dev
liblcms2-dev
liblzma-dev
libmaxflow-dev
libmng-dev
libmypaint-dev
libomp-dev
libopenexr-dev
libopenjp2-7-dev
libpoppler-glib-dev
libqoi-dev
libraw-dev
libraw20
librsvg2-dev
libspiro-dev
libsuitesparse-dev
libtiff-dev
libumfpack5
libunwind-dev
libwebp-dev
libwmf-dev
libxmu-dev
libxpm-dev
mypaint-brushes
poppler-data
python3
python3-gi" >> Dockerfile
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:build-debian-latest-${RUNNER} --cache=true --cache-ttl=120h
image-debian-x64:
extends: .debian-x64
stage: !reference [image-debian, stage]
image: !reference [image-debian, image]
variables: !reference [image-debian, variables]
cache: !reference [image-debian, cache]
before_script:
- !reference [image-debian, before_script]
script:
- !reference [image-debian, script]
## GNU/Linux 64-bit CIs (Debian bookworm) ##
deps-debian:
extends: .debian
needs: ["image-debian"]
stage: dependencies
variables:
GIT_STRATEGY: none
CCACHE_MAXSIZE: 0.25G
script:
# Clone and build babl
- echo -e "\e[0Ksection_start:`date +%s`:babl_build[collapsed=true]\r\e[0KBuilding babl"
- if [ "$CI_COMMIT_TAG" != "" ]; then
repo=https://gitlab.gnome.org/GNOME/babl.git;
babl_tag=$(git ls-remote --tags --exit-code --refs "$repo" |
grep -oi "BABL_[0-9]*_[0-9]*_[0-9]*" |
sort --version-sort | tail -1);
babl_branch="--branch=$babl_tag";
fi
- git clone $babl_branch --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git
- cd babl
- meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}"
- cd _build-${RUNNER}
- ninja
- ninja install
- ccache --show-stats
- cd ../..
- echo -e "\e[0Ksection_end:`date +%s`:babl_build\r\e[0K"
# Clone and build gegl
- echo -e "\e[0Ksection_start:`date +%s`:gegl_build[collapsed=true]\r\e[0KBuilding gegl"
- if [ "$CI_COMMIT_TAG" != "" ]; then
repo=https://gitlab.gnome.org/GNOME/gegl.git;
gegl_tag=$(git ls-remote --tags --exit-code --refs "$repo" |
grep -oi "GEGL_[0-9]*_[0-9]*_[0-9]*" |
sort --version-sort | tail -1);
gegl_branch="--branch=$gegl_tag";
fi
- git clone $gegl_branch --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git
- cd gegl
- meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}" -Dworkshop=true
- cd _build-${RUNNER}
- ninja
- ninja install
- ccache --show-stats
- echo -e "\e[0Ksection_end:`date +%s`:gegl_build\r\e[0K"
artifacts:
paths:
- _install-${RUNNER}/
- babl/_build-${RUNNER}/meson-logs/meson-log.txt
- babl/_build-${RUNNER}/config.h
- gegl/_build-${RUNNER}/meson-logs/meson-log.txt
- gegl/_build-${RUNNER}/config.h
expire_in: 2 hours
gimp-debian:
extends: .debian
needs: ["deps-debian"]
stage: gimp
variables:
GIT_SUBMODULE_STRATEGY: recursive
CCACHE_MAXSIZE: 0.75G
script:
# Build GIMP
- echo -e "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP"
- meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}"
-Drelocatable-bundle=yes
- cd _build-${RUNNER}
- ninja
- ccache --show-stats
- echo -e "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K"
# Create bundle
- echo -e "\e[0Ksection_start:`date +%s`:gimp_bundle[collapsed=true]\r\e[0KCreating bundle"
- ninja install &> ninja_install.log || cat ninja_install.log
- cd ..
- bash build/linux/appimage/3_dist-gimp-goappimage.sh --bundle-only &> goappimage.log || cat goappimage.log
- echo -e "\e[0Ksection_end:`date +%s`:gimp_bundle\r\e[0K"
artifacts:
paths:
- AppDir*/
- appimageignore*
- _build-${RUNNER}/config.h
expire_in: 2 days
deps-debian-x64:
extends: .debian-x64
needs: ["image-debian-x64"]
stage: !reference [deps-debian, stage]
variables: !reference [deps-debian, variables]
script:
- !reference [deps-debian, script]
artifacts: !reference [deps-debian, artifacts]
gimp-debian-x64:
extends: .debian-x64
needs: ["deps-debian-x64"]
stage: !reference [gimp-debian, stage]
variables: !reference [gimp-debian, variables]
script:
# Check building
- echo -e "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP"
- meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}"
-Dg-ir-doc=true
-Dfile-plug-ins-test=true
$MESON_OPTIONS
- cd _build-${RUNNER}
- ninja
- ccache --show-stats
- echo -e "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K"
# Check execution
- echo -e "\e[0Ksection_start:`date +%s`:gimp_test[collapsed=true]\r\e[0KTesting GIMP execution"
- ninja test
- echo -e "\e[0Ksection_end:`date +%s`:gimp_test\r\e[0K"
# Check source
- echo -e "\e[0Ksection_start:`date +%s`:gimp_tar[collapsed=true]\r\e[0KChecking GIMP source"
- if [ $(git diff |wc -l) -ne 0 ]; then
echo "ERROR. A generated file was updated without the source:";
git diff;
exit 1;
fi
- if [ "$VARIANT" != "-gcc" ] && [ "$VARIANT" != "-raster" ] && [ "$CI_PIPELINE_SOURCE" != "merge_request_event" ]; then
ninja dist &> ninja_dist.txt || cat ninja_dist.txt;
fi
- echo -e "\e[0Ksection_end:`date +%s`:gimp_tar\r\e[0K"
# Check install
- echo -e "\e[0Ksection_start:`date +%s`:gimp_install[collapsed=true]\r\e[0KChecking GIMP installation"
- ninja install &> ninja_install.txt || cat ninja_install.txt;
- echo -e "\e[0Ksection_end:`date +%s`:gimp_install\r\e[0K"
artifacts:
paths:
- _install-${RUNNER}/
- _build-${RUNNER}/meson-logs/meson-log.txt
- _build-${RUNNER}/meson-dist/
- _build-${RUNNER}/config.h
- _build-${RUNNER}/devel-docs/
reports:
junit: "_build-${RUNNER}/meson-logs/testlog.junit.xml"
expire_in: 2 days
## Flatpak CI ##
.flatpak-x64:
extends: .default
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*5. Flatpak package.*/'
interruptible: true
- if: '$GIMP_CI_FLATPAK != null'
tags:
- flatpak
image: 'quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master'
before_script:
- export GIMP_PREFIX="${CI_PROJECT_DIR}/_install"
deps-flatpak-x64:
extends: .flatpak-x64
needs: []
stage: dependencies
# FIXME: GitLab CI caching does NOT work with flatpak
# See: https://gitlab.gnome.org/Infrastructure/Infrastructure/-/issues/1502
cache: []
# key: ${CI_JOB_NAME}-pkg
# paths:
# .flatpak-builder/
# key: $CI_JOB_NAME
# paths:
# _ccache/
script:
- bash build/linux/flatpak/1_build-deps-flatpak.sh
artifacts:
paths:
- .flatpak-builder.tar
- flatpak-builder.log
- babl-meson-log.tar
- gegl-meson-log.tar
expire_in: 2 hours
gimp-flatpak-x64:
extends: .flatpak-x64
needs: ["deps-flatpak-x64"]
stage: gimp
# FIXME: GitLab CI caching does NOT work with flatpak
# See: https://gitlab.gnome.org/Infrastructure/Infrastructure/-/issues/1502
cache: []
# key: $CI_JOB_NAME
# paths:
# _ccache/
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- bash build/linux/flatpak/2_build-gimp-flatpak.sh
artifacts:
paths:
- repo.tar
- gimp-meson-log.tar
expire_in: 2 days
## WINDOWS 64-bit CI (cross-build crossroad) ##
.win-cross:
extends: .debian-x64
rules:
- <<: *CI_MERGE
when: never
- <<: *CI_COMMIT
when: never
- if: '$GIMP_CI_CROSSROAD_WIN64 != null'
deps-win-x64-cross:
extends: .win-cross
needs: ["image-debian-x64"]
stage: dependencies
variables:
XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache/"
cache:
- key: ${CI_JOB_NAME}-pkg
paths:
- .cache/
- !reference [.default, cache]
script:
- bash build/windows/1_build-deps-crossroad.sh
artifacts:
paths:
- .local/
- babl/_build-cross/meson-logs/meson-log.txt
- gegl/_build-cross/meson-logs/meson-log.txt
expire_in: 2 hours
gimp-win-x64-cross:
extends: .win-cross
needs: ["deps-win-x64-cross", "gimp-debian-x64"]
stage: gimp
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- bash build/windows/2_build-gimp-crossroad.sh
artifacts:
expose_as: 'Windows zip'
paths:
- gimp-x64/
- _build-cross/meson-logs/meson-log.txt
- _build-cross/done-dll.list
expire_in: 2 days
## WINDOWS pipelines (native MSYS2) ##
.win:
extends: .default
rules:
- if: ($CI_MERGE_REQUEST_LABELS =~ /.*5. Windows Installer.*/ && $CI_MERGE_REQUEST_LABELS =~ /.*5. Microsoft Store.*/) || ($GIMP_CI_WIN_INSTALLER != null && $GIMP_CI_MS_STORE != null)
interruptible: true
variables:
INSTALLER_OPTION: '-Dwindows-installer=true'
STORE_OPTION: '-Dms-store=true'
- if: $CI_MERGE_REQUEST_LABELS =~ /.*5. Windows Installer.*/ || $GIMP_CI_WIN_INSTALLER != null
interruptible: true
variables:
INSTALLER_OPTION: '-Dwindows-installer=true'
- if: ($CI_MERGE_REQUEST_LABELS =~ /.*5. Microsoft Store.*/ || $GIMP_CI_MS_STORE != null) && $CI_JOB_NAME !~ /.*86.*/ && $CI_JOB_NAME !~ /.*installer.*/
interruptible: true
variables:
STORE_OPTION: '-Dms-store=true'
- <<: *CI_RELEASE
variables:
INSTALLER_OPTION: '-Dwindows-installer=true'
STORE_OPTION: '-Dms-store=true'
parallel:
matrix:
- RUNNER: windows-aarch64
MSYSTEM_PREFIX: clangarm64
- RUNNER: win32-ps
MSYSTEM_PREFIX: clang64
tags:
- $RUNNER
before_script:
# MSYS2 config
- $MSYS2_PREFIX = 'C:/msys64'
- $env:Path = "$MSYS2_PREFIX/$MSYSTEM_PREFIX/bin;$MSYS2_PREFIX/usr/bin;" + $env:Path
# Build-time vars
# FIXME:'gimpenv' have buggy code about Windows paths. See: https://gitlab.gnome.org/GNOME/gimp/-/issues/12284
- $GIMP_PREFIX = "$PWD\_install-$MSYSTEM_PREFIX".Replace('\', '/')
- Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):win_environ[collapsed=true]$([char]13)$([char]27)[0KPreparing build environment"
- $env:Path = $env:Path + ";$GIMP_PREFIX/bin"
- $env:PKG_CONFIG_PATH = "$MSYS2_PREFIX/$MSYSTEM_PREFIX/lib/pkgconfig;$MSYS2_PREFIX/$MSYSTEM_PREFIX/share/pkgconfig;$GIMP_PREFIX/lib/pkgconfig"
- $env:XDG_DATA_DIRS = "$MSYS2_PREFIX/$MSYSTEM_PREFIX/share;$GIMP_PREFIX/share"
- $env:GI_TYPELIB_PATH = "$MSYS2_PREFIX/$MSYSTEM_PREFIX/lib/girepository-1.0;$GIMP_PREFIX/lib/girepository-1.0"
- Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):win_environ$([char]13)$([char]27)[0K"
deps-win:
extends: .win
needs: []
stage: dependencies
variables:
CCACHE_MAXSIZE: 0.25G
script:
- build/windows/1_build-deps-msys2.ps1
artifacts:
paths:
- _install-$MSYSTEM_PREFIX/
- babl/_build-$MSYSTEM_PREFIX/meson-logs/meson-log.txt
- gegl/_build-$MSYSTEM_PREFIX/meson-logs/meson-log.txt
expire_in: 2 hours
gimp-win:
extends: .win
needs: ["deps-win"]
stage: gimp
variables:
GIT_SUBMODULE_STRATEGY: recursive
CCACHE_MAXSIZE: 0.75G
script:
- build/windows/2_build-gimp-msys2.ps1
artifacts:
paths:
- gimp-$MSYSTEM_PREFIX/
- _build-$MSYSTEM_PREFIX/meson-logs/meson-log.txt
- _build-$MSYSTEM_PREFIX/done-dll.list
# Needed by dist-installer-weekly and dist-store-weekly
- _build-$MSYSTEM_PREFIX/config.h
- _build-$MSYSTEM_PREFIX/build/windows/installer/
- _build-$MSYSTEM_PREFIX/build/windows/store/
expire_in: 2 days
## WINDOWS x86 legacy CI (native MSYS2) ##
.win-x86:
extends: .win
rules:
- !reference [.win, rules]
- if: '$GIMP_CI_MSYS2_WIN32 != null'
parallel:
matrix:
- RUNNER: win32-ps
MSYSTEM_PREFIX: mingw32
deps-win-x86:
extends: .win-x86
needs: []
stage: !reference [deps-win, stage]
variables: !reference [deps-win, variables]
script:
- !reference [deps-win, script]
artifacts: !reference [deps-win, artifacts]
gimp-win-x86:
extends: .win-x86
needs: ["deps-win-x86"]
stage: !reference [gimp-win, stage]
variables: !reference [gimp-win, variables]
script:
- !reference [gimp-win, script]
# We split 32-bit DWARF symbols here because LLVM-objcopy do NOT support them
- bash build/windows/installer/3_dist-gimp-inno_sym.sh gimp-$MSYSTEM_PREFIX
artifacts: !reference [gimp-win, artifacts]
## Analysis ##
file-plug-in-tests:
# FIXME: Do we need another job testing this under Windows? MSYS2 usually has
# the latest deps. It might be a good idea to test that too, maybe weekly?
extends: .debian-x64
rules:
# Don't run on release since the plug-in doesn't get installed in releases
- <<: *CI_MERGE
- <<: *CI_COMMIT
needs: ["deps-debian-x64", "gimp-debian-x64"]
stage: analysis
variables:
GIT_STRATEGY: none
GIMP_TESTS_DATA_FOLDER: "$CI_PROJECT_DIR/_data/gimp-test-images/"
GIMP_TESTS_LOG_FILE: "$CI_PROJECT_DIR/_log/import-tests.log"
REGRESSION_STRING: "Total number of regressions: 0"
cache:
- key: $CI_JOB_NAME
paths:
- _data
script:
- API_VER=$(grep GIMP_PKGCONFIG_VERSION _build*/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
- APP_VER=$(grep GIMP_APP_VERSION _build*/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
- pkg-config --variable=gimplibdir gimp-${API_VER} 2>/dev/null | grep . && PLUG_IN_DIR=$(echo $(pkg-config --variable=gimplibdir gimp-${API_VER})'/plug-ins/')
- export PYTHONPATH="${PLUG_IN_DIR}test-file-plug-ins"
- export GIMP_TESTS_CONFIG_FILE="${PLUG_IN_DIR}test-file-plug-ins/tests/batch-config.ini"
- mkdir _log
- mkdir _data && cd _data
- git clone --depth=${GIT_DEPTH} https://gitlab.gnome.org/Infrastructure/gimp-test-images.git gimp-test-images
- cd ..
- cat ${PLUG_IN_DIR}test-file-plug-ins/batch-import-tests.py | gimp-console-${APP_VER} -idf --batch-interpreter python-fu-eval -b - --quit
- if [ $(grep -c "${REGRESSION_STRING}" "${GIMP_TESTS_LOG_FILE}") -ne 1 ]; then
echo "There are file import regressions. Check the log at ${GIMP_TESTS_LOG_FILE}!";
exit 1;
fi
# FIXME No export testing for now until it's more developed. A limited test
# can be done from the plug-in for bmp export.
artifacts:
paths:
- _log/
reports:
junit: "_log/import-tests.xml"
expire_in: 2 days
clang-format:
extends: .default
rules:
- <<: *CI_MERGE
needs: []
stage: analysis
cache: []
script:
- apt-get update
- apt-get install -y clang-format
git
- .gitlab/run_style_check_diff.sh
allow_failure: true
artifacts:
when: on_failure
paths:
- fetch_upstream.log
- fetch_origin.log
expire_in: 2 days
cppcheck:
extends: .default
rules:
- if: '$GIMP_CI_CPPCHECK != null'
needs: []
stage: analysis
cache: []
script:
- apt-get update
- apt-get install -y cppcheck
- cppcheck -q -j8 --enable=all --force --output-file=cppcheck.xml --xml --xml-version=2
-i _build -i _build-cross -i babl -i gegl -i _install -i .local -i .cache -i _ccache -i gimp-x64 .
- mkdir report
- cppcheck-htmlreport --source-dir=. --title=gimp --file=cppcheck.xml --report-dir=report
artifacts:
paths:
- report/
expire_in: 8 days
## Ready-to-distribute ##
sources-debian:
extends: .default
rules:
- <<: *CI_COMMIT
- if: '$GIMP_CI_SOURCES != null'
- <<: *CI_RELEASE
needs: ["gimp-debian-x64"]
stage: distribution
cache: []
variables:
GIT_STRATEGY: none
script:
- mv _build*/meson-dist/gimp-*.tar.xz .
- FILENAME=`ls gimp-*.tar.xz` &&
sha256sum gimp-*.tar.xz > ${FILENAME}.SHA256SUMS &&
sha512sum gimp-*.tar.xz > ${FILENAME}.SHA512SUMS
artifacts:
paths:
- gimp-*.tar.xz
- gimp-*.tar.xz.SHA256SUMS
- gimp-*.tar.xz.SHA512SUMS
expire_in: 2 days
dev-docs:
extends: .default
rules:
- <<: *CI_COMMIT
- if: '$GIMP_CI_SOURCES != null'
- <<: *CI_RELEASE
needs: ["deps-debian-x64", "gimp-debian-x64"]
stage: distribution
cache: []
variables:
GIT_STRATEGY: none
script:
- apt-get update
- apt-get install -y xz-utils
- export GIMP_PREFIX=$(echo $PWD/_install*)
- BABL_VER=$(grep BABL_VERSION babl/_build*/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') &&
BABL_API_VER=$(grep BABL_API_VERSION babl/_build*/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') &&
DIR_NAME=babl-api-docs-$BABL_VER &&
mkdir $DIR_NAME &&
mv "${GIMP_PREFIX}/share/doc/babl-$BABL_API_VER" $DIR_NAME/ &&
TAR_NAME="$DIR_NAME.tar.xz" &&
tar --dereference -cJf ${TAR_NAME} $DIR_NAME &&
sha256sum $TAR_NAME > ${TAR_NAME}.SHA256SUMS &&
sha512sum $TAR_NAME > ${TAR_NAME}.SHA512SUMS
- GEGL_MAJ_VER=$(grep GEGL_MAJOR_VERSION gegl/_build*/config.h |head -1 |sed 's/^[^0-9]*\([0-9]*\).*$/\1/') &&
GEGL_MIN_VER=$(grep GEGL_MINOR_VERSION gegl/_build*/config.h |head -1 |sed 's/^[^0-9]*\([0-9]*\).*$/\1/') &&
GEGL_MIC_VER=$(grep GEGL_MICRO_VERSION gegl/_build*/config.h |head -1 |sed 's/^[^0-9]*\([0-9]*\).*$/\1/') &&
GEGL_VER="$GEGL_MAJ_VER.$GEGL_MIN_VER.$GEGL_MIC_VER" &&
GEGL_API_VER="$GEGL_MAJ_VER.$GEGL_MIN_VER" &&
DIR_NAME=gegl-api-docs-$GEGL_VER &&
mkdir $DIR_NAME &&
mv "${GIMP_PREFIX}/share/doc/gegl-$GEGL_API_VER" $DIR_NAME/ &&
TAR_NAME="$DIR_NAME.tar.xz" &&
tar --dereference -cJf ${TAR_NAME} $DIR_NAME &&
sha256sum $TAR_NAME > ${TAR_NAME}.SHA256SUMS &&
sha512sum $TAR_NAME > ${TAR_NAME}.SHA512SUMS
- GIMP_VER=$(grep GIMP_VERSION _build*/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') &&
APP_VER=$(echo $GIMP_VER | sed 's/\([0-9]\+\.[0-9]\+\)\..*/\1/') &&
DIR_NAME=gimp-api-docs-$GIMP_VER &&
mkdir $DIR_NAME &&
mv "${GIMP_PREFIX}/share/doc/gimp-$APP_VER" $DIR_NAME/reference &&
mv _build*/devel-docs/g-ir-docs $DIR_NAME/ &&
TAR_NAME="$DIR_NAME.tar.xz" &&
tar --dereference -cJf ${TAR_NAME} $DIR_NAME &&
sha256sum $TAR_NAME > ${TAR_NAME}.SHA256SUMS &&
sha512sum $TAR_NAME > ${TAR_NAME}.SHA512SUMS
artifacts:
paths:
- babl-api-docs-*.tar.xz
- babl-api-docs-*.tar.xz.SHA256SUMS
- babl-api-docs-*.tar.xz.SHA512SUMS
- gegl-api-docs-*.tar.xz
- gegl-api-docs-*.tar.xz.SHA256SUMS
- gegl-api-docs-*.tar.xz.SHA512SUMS
- gimp-api-docs-*.tar.xz
- gimp-api-docs-*.tar.xz.SHA256SUMS
- gimp-api-docs-*.tar.xz.SHA512SUMS
expire_in: 2 days
dist-appimage-weekly:
extends: .default
rules:
- !reference [.debian, rules]
needs: ["gimp-debian"]
stage: distribution
cache: []
script:
- bash build/linux/appimage/3_dist-gimp-goappimage.sh _build-x86_64_v2
artifacts:
expose_as: 'Linux appimage'
paths:
- build/linux/appimage/_Output/
expire_in: 8 days
include: 'https://raw.githubusercontent.com/GNOME/citemplates/master/flatpak/flatpak_ci_initiative.yml'
dist-flatpak-weekly:
extends:
- .default
- .publish_nightly
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*5. Flatpak package.*/'
interruptible: true
- if: '$GIMP_CI_FLATPAK != null'
needs: ["gimp-flatpak-x64"]
stage: distribution
cache: []
script:
- bash build/linux/flatpak/3_dist-gimp-flatpak.sh
artifacts:
expose_as: 'Linux flatpak'
paths:
- org.gimp.GIMP.Nightly.flatpak
expire_in: 8 days
dist-installer-weekly:
extends: .default
rules:
- !reference [.win, rules]
needs: ["gimp-win", "gimp-win-x86"]
stage: distribution
tags:
- windows-aarch64
cache: []
script:
- build/windows/installer/3_dist-gimp-inno.ps1
artifacts:
expose_as: 'Windows exe'
paths:
- build/windows/installer/_Output/
- inno.log
expire_in: 8 days
dist-store-weekly:
extends: .default
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*5. Microsoft Store.*/'
interruptible: true
- if: '$GIMP_CI_MS_STORE != null'
- <<: *CI_RELEASE
needs: ["gimp-win"]
stage: distribution
tags:
- win32-ps
cache: []
script:
- build\windows\store\3_dist-gimp-winsdk.ps1
artifacts:
expose_as: 'Windows msix'
paths:
- build/windows/store/_Output/
- winsdk.log
expire_in: 8 days