forked from zlib-ng/zlib-ng
-
Notifications
You must be signed in to change notification settings - Fork 1
800 lines (697 loc) · 33.6 KB
/
cmake.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
name: CMake
on: [push, pull_request]
env:
TERM: xterm-256color
GTEST_COLOR: 1
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
cmake:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
# - name: Ubuntu 20.04 GCC
# os: ubuntu-20.04
# compiler: gcc
# cxx-compiler: g++
# - name: Ubuntu GCC ASAN
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DWITH_SANITIZER=Address
# codecov: ubuntu_gcc
# - name: Ubuntu GCC Benchmark
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DWITH_BENCHMARKS=ON
# codecov: ubuntu_gcc_benchmark
# - name: Ubuntu GCC Native Instructions
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DWITH_NATIVE_INSTRUCTIONS=ON
# codecov: ubuntu_gcc_native_inst
# - name: Ubuntu GCC Native Instructions (AVX)
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE="-mavx -mpclmul"
# codecov: ubuntu_gcc_native_inst_avx
# - name: Ubuntu GCC Symbol Prefix
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DZLIB_SYMBOL_PREFIX=zTest_
# codecov: ubuntu_gcc_sprefix
# - name: Ubuntu GCC Compat Symbol Prefix
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DZLIB_COMPAT=ON -DZLIB_SYMBOL_PREFIX=zTest_
# codecov: ubuntu_gcc_compat_sprefix
# - name: Ubuntu GCC -O3 OSB
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# build-dir: ../build
# build-src-dir: ../zlib-ng
# # Build with readonly project directory require CMake 3.19+
# readonly-project-dir: true
# codecov: ubuntu_gcc_osb
# cflags: -O3
# - name: Ubuntu GCC -O3 OSB add_subdirectory
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# build-dir: ../build
# build-src-dir: ../zlib-ng/test/add-subdirectory-project
# readonly-project-dir: true
# - name: Ubuntu GCC -O1 UBSAN
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DWITH_SANITIZER=Undefined
# codecov: ubuntu_gcc_o1
# cflags: -O1
# - name: Ubuntu GCC 32-bit
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_SHARED_LINKER_FLAGS=-m32 -DCMAKE_EXE_LINKER_FLAGS=-m32
# packages: gcc-multilib g++-multilib
# codecov: ubuntu_gcc_m32
# - name: Ubuntu GCC No CTZLL
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DWITH_OPTIM=OFF -DHAVE_BUILTIN_CTZLL=OFF
# codecov: ubuntu_gcc_no_ctzll
# - name: Ubuntu GCC No CTZ
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DWITH_OPTIM=OFF -DHAVE_BUILTIN_CTZLL=OFF -DHAVE_BUILTIN_CTZ=OFF
# codecov: ubuntu_gcc_no_ctz
# - name: Ubuntu GCC SSE2 UBSAN
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DWITH_SSSE3=OFF -DWITH_SSE42=OFF -DWITH_AVX2=OFF -DWITH_AVX512=OFF -DWITH_SANITIZER=Undefined
# codecov: ubuntu_gcc_sse2
# - name: Ubuntu GCC SSSE3 UBSAN
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DWITH_SSE42=OFF -DWITH_AVX2=OFF -DWITH_AVX512=OFF -DWITH_SANITIZER=Undefined
# codecov: ubuntu_gcc_ssse3
# - name: Ubuntu GCC SSE4.2 UBSAN
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DWITH_AVX2=OFF -DWITH_AVX512=OFF -DWITH_SANITIZER=Undefined
# codecov: ubuntu_gcc_sse42
# - name: Ubuntu GCC No PCLMULQDQ UBSAN
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DWITH_PCLMULQDQ=OFF -DWITH_SANITIZER=Undefined
# codecov: ubuntu_gcc_no_pclmulqdq
# - name: Ubuntu GCC Compat No Opt ASAN
# os: ubuntu-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF -DWITH_SANITIZER=Address
# codecov: ubuntu_gcc_compat_no_opt
# cflags: -DNOT_TWEAK_COMPILER
# - name: Ubuntu GCC ARM SF ASAN
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-arm.cmake -DWITH_SANITIZER=Address
# asan-options: detect_leaks=0
# packages: qemu-user crossbuild-essential-armel
# gcov-exec: arm-linux-gnueabi-gcov
# codecov: ubuntu_gcc_armsf
# - name: Ubuntu GCC ARM SF Compat No Opt UBSAN
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-arm.cmake -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF -DWITH_SANITIZER=Undefined
# packages: qemu-user crossbuild-essential-armel
# gcov-exec: arm-linux-gnueabi-gcov
# codecov: ubuntu_gcc_armsf_compat_no_opt
# - name: Ubuntu GCC ARM HF ASAN
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-armhf.cmake -DWITH_SANITIZER=Address
# asan-options: detect_leaks=0
# packages: qemu-user crossbuild-essential-armhf
# gcov-exec: arm-linux-gnueabihf-gcov
# codecov: ubuntu_gcc_armhf
# - name: Ubuntu GCC ARM HF No ACLE ASAN
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-armhf.cmake -DWITH_ACLE=OFF -DWITH_SANITIZER=Address
# asan-options: detect_leaks=0
# packages: qemu-user crossbuild-essential-armhf
# gcov-exec: arm-linux-gnueabihf-gcov
# codecov: ubuntu_gcc_armhf_no_acle
# - name: Ubuntu GCC ARM HF No NEON ASAN
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-armhf.cmake -DWITH_NEON=OFF -DWITH_SANITIZER=Address
# asan-options: detect_leaks=0
# packages: qemu-user crossbuild-essential-armhf
# gcov-exec: arm-linux-gnueabihf-gcov
# codecov: ubuntu_gcc_armhf_no_neon
# - name: Ubuntu GCC ARM HF Compat No Opt UBSAN
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-armhf.cmake -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF -DWITH_SANITIZER=Undefined
# packages: qemu-user crossbuild-essential-armhf
# gcov-exec: arm-linux-gnueabihf-gcov
# codecov: ubuntu_gcc_armhf_compat_no_opt
# - name: Ubuntu GCC AARCH64 ASAN
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-aarch64.cmake -DWITH_SANITIZER=Address
# asan-options: detect_leaks=0
# packages: qemu-user crossbuild-essential-arm64
# gcov-exec: aarch64-linux-gnu-gcov
# codecov: ubuntu_gcc_aarch64
# - name: Ubuntu GCC AARCH64 No ACLE UBSAN
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-aarch64.cmake -DWITH_ACLE=OFF -DWITH_SANITIZER=Undefined
# packages: qemu-user crossbuild-essential-arm64
# gcov-exec: aarch64-linux-gnu-gcov
# codecov: ubuntu_gcc_aarch64_no_acle
# - name: Ubuntu GCC AARCH64 No NEON UBSAN
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-aarch64.cmake -DWITH_NEON=OFF -DWITH_SANITIZER=Undefined
# packages: qemu-user crossbuild-essential-arm64
# gcov-exec: aarch64-linux-gnu-gcov
# codecov: ubuntu_gcc_aarch64_no_neon
# - name: Ubuntu GCC AARCH64 Compat No Opt UBSAN
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-aarch64.cmake -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF -DWITH_SANITIZER=Undefined
# packages: qemu-user crossbuild-essential-arm64
# gcov-exec: aarch64-linux-gnu-gcov
# codecov: ubuntu_gcc_aarch64_compat_no_opt
# - name: Ubuntu GCC MIPS
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mips.cmake
# packages: qemu-user crossbuild-essential-mips
# gcov-exec: mips-linux-gnu-gcov
# codecov: ubuntu_gcc_mips
# - name: Ubuntu GCC MIPS64
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mips64.cmake
# packages: qemu-user crossbuild-essential-mips64
# gcov-exec: mips64-linux-gnuabi64-gcov
# codecov: ubuntu_gcc_mips64
# - name: Ubuntu GCC PPC
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc.cmake
# packages: qemu-user crossbuild-essential-powerpc
# gcov-exec: powerpc-linux-gnu-gcov
# codecov: ubuntu_gcc_ppc
# - name: Ubuntu GCC PPC No Power8
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc.cmake -DWITH_POWER8=OFF
# packages: qemu-user crossbuild-essential-powerpc
# gcov-exec: powerpc-linux-gnu-gcov
# codecov: ubuntu_gcc_ppc_no_power8
# - name: Ubuntu GCC PPC64
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64.cmake
# packages: qemu-user gcc-powerpc64-linux-gnu g++-powerpc64-linux-gnu libc-dev-ppc64-cross
# ldflags: -static
# gcov-exec: powerpc64-linux-gnu-gcov
# codecov: ubuntu_gcc_ppc64
# - name: Ubuntu GCC PPC64 Power9
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64-power9.cmake
# packages: qemu-user gcc-powerpc64-linux-gnu g++-powerpc64-linux-gnu libc-dev-ppc64-cross
# ldflags: -static
# gcov-exec: powerpc64-linux-gnu-gcov
# codecov: ubuntu_gcc_ppc64_power9
# - name: Ubuntu Clang PPC64 Power9
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64-clang.cmake
# packages: qemu-user clang binutils-powerpc64-linux-gnu libgcc-11-dev-ppc64-cross libc-dev-ppc64-cross libstdc++-11-dev-ppc64-cross
# - name: Ubuntu GCC PPC64LE
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64le.cmake
# packages: qemu-user crossbuild-essential-ppc64el
# gcov-exec: powerpc64le-linux-gnu-gcov
# codecov: ubuntu_gcc_ppc64le
# - name: Ubuntu GCC PPC64LE No VSX
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64le-power9.cmake -DWITH_POWER8=OFF -DWITH_POWER9=OFF
# packages: qemu-user crossbuild-essential-ppc64el
# gcov-exec: powerpc64le-linux-gnu-gcov
# codecov: ubuntu_gcc_ppc64le_novsx
# - name: Ubuntu GCC PPC64LE Power9
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64le-power9.cmake
# packages: qemu-user crossbuild-essential-ppc64el
# gcov-exec: powerpc64le-linux-gnu-gcov
# codecov: ubuntu_gcc_ppc64le_power9
# - name: Ubuntu Clang PPC64LE Power9
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64le-clang.cmake
# packages: qemu-user crossbuild-essential-ppc64el
# - name: Ubuntu GCC SPARC64
# os: ubuntu-20.04
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-sparc64.cmake
# packages: qemu qemu-user gcc-sparc64-linux-gnu g++-sparc64-linux-gnu libc-dev-sparc64-cross
# ldflags: -static
# gcov-exec: sparc64-linux-gnu-gcov
# codecov: ubuntu_gcc_sparc64
# - name: Ubuntu GCC S390X ASAN
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake -DWITH_SANITIZER=Address
# asan-options: detect_leaks=0
# packages: qemu-user crossbuild-essential-s390x
# ldflags: -static
# gcov-exec: s390x-linux-gnu-gcov
# codecov: ubuntu_gcc_s390x
# - name: Ubuntu GCC S390X No vectorized CRC32 ASAN
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake -DWITH_CRC32_VX=OFF -DWITH_SANITIZER=Address
# asan-options: detect_leaks=0
# packages: qemu-user crossbuild-essential-s390x
# ldflags: -static
# gcov-exec: s390x-linux-gnu-gcov
# codecov: ubuntu_gcc_s390x_no_crc32
# - name: ${{ github.repository == 'zlib-ng/zlib-ng' && 'EL9' || 'Ubuntu' }} GCC S390X DFLTCC ASAN
# os: ${{ github.repository == 'zlib-ng/zlib-ng' && 'z15' || 'ubuntu-latest' }}
# compiler: gcc
# cxx-compiler: g++
# cmake-args: >-
# ${{ github.repository != 'zlib-ng/zlib-ng' && '-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake' || '' }}
# -DWITH_DFLTCC_DEFLATE=ON -DWITH_DFLTCC_INFLATE=ON -DWITH_SANITIZER=Address
# packages: qemu-user gcc-s390x-linux-gnu g++-s390x-linux-gnu libc-dev-s390x-cross
# asan-options: detect_leaks=0
# ldflags: -static
# gcov-exec: ${{ github.repository == 'zlib-ng/zlib-ng' && 'gcov' || 's390x-linux-gnu-gcov' }}
# codecov: ${{ github.repository == 'zlib-ng/zlib-ng' && 'el9_gcc_s390x_dfltcc' || 'ubuntu_gcc_s390x_dfltcc' }}
# # The dedicated z15 test VM has 4 cores
# parallels-jobs: 4
# - name: ${{ github.repository == 'zlib-ng/zlib-ng' && 'EL9' || 'Ubuntu' }} GCC S390X DFLTCC UBSAN
# os: ${{ github.repository == 'zlib-ng/zlib-ng' && 'z15' || 'ubuntu-latest' }}
# compiler: gcc
# cxx-compiler: g++
# cmake-args: >-
# ${{ github.repository != 'zlib-ng/zlib-ng' && '-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake' || '' }}
# -DWITH_DFLTCC_DEFLATE=ON -DWITH_DFLTCC_INFLATE=ON -DWITH_SANITIZER=Undefined
# packages: qemu-user gcc-s390x-linux-gnu g++-s390x-linux-gnu libc-dev-s390x-cross
# ldflags: -static
# gcov-exec: ${{ github.repository == 'zlib-ng/zlib-ng' && 'gcov' || 's390x-linux-gnu-gcov' }}
# codecov: ${{ github.repository == 'zlib-ng/zlib-ng' && 'el9_gcc_s390x_dfltcc' || 'ubuntu_gcc_s390x_dfltcc' }}
# # The dedicated z15 test VM has 4 cores
# parallels-jobs: 4
# - name: ${{ github.repository == 'zlib-ng/zlib-ng' && 'EL9' || 'Ubuntu' }} Clang S390X DFLTCC ${{ (github.repository == 'zlib-ng/zlib-ng' && 'MSAN') || 'Compat' }}
# os: ${{ github.repository == 'zlib-ng/zlib-ng' && 'z15' || 'ubuntu-latest' }}
# compiler: ${{ github.repository == 'zlib-ng/zlib-ng' && 'clang' || 'clang-15' }}
# cxx-compiler: ${{ github.repository == 'zlib-ng/zlib-ng' && 'clang++' || 'clang++-15' }}
# cmake-args: >-
# ${{ github.repository != 'zlib-ng/zlib-ng' && '-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake -DZLIB_COMPAT=ON' || '-GNinja -DWITH_SANITIZER=Memory' }}
# -DWITH_DFLTCC_DEFLATE=ON -DWITH_DFLTCC_INFLATE=ON
# gcov-exec: ${{ github.repository == 'zlib-ng/zlib-ng' && 'gcov' || 's390x-linux-gnu-gcov' }}
# packages: qemu-user gcc-s390x-linux-gnu g++-s390x-linux-gnu libc-dev-s390x-cross
# # The dedicated z15 test VM has 4 cores
# parallels-jobs: 4
# - name: Ubuntu MinGW i686
# os: ubuntu-22.04
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw-i686.cmake
# packages: wine wine32 gcc-mingw-w64-i686 g++-mingw-w64-i686 libpcre2-8-0=10.39-3ubuntu0.1 libpcre2-8-0:i386=10.39-3ubuntu0.1 libodbc1=2.3.9-5ubuntu0.1 libodbc1:i386=2.3.9-5ubuntu0.1 libodbc2=2.3.9-5ubuntu0.1 libodbc2:i386=2.3.9-5ubuntu0.1 libodbccr2=2.3.9-5ubuntu0.1 libodbccr2:i386=2.3.9-5ubuntu0.1 libwine:i386=6.0.3~repack-1 libgphoto2-6:i386=2.5.27-1build2 libsane:i386=1.1.1-5 libgd3=2.3.0-2ubuntu2 libgd3:i386=2.3.0-2ubuntu2 libgcc-s1:i386 libstdc++6:i386
# ldflags: -static
# gcov-exec: i686-w64-mingw32-gcov-posix
# codecov: ubuntu_gcc_mingw_i686
# # Limit parallel test jobs to prevent wine errors
# parallels-jobs: 1
# - name: Ubuntu MinGW x86_64
# os: ubuntu-latest
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw-x86_64.cmake
# packages: wine wine64 gcc-mingw-w64 g++-mingw-w64
# ldflags: -static
# gcov-exec: x86_64-w64-mingw32-gcov-posix
# codecov: ubuntu_gcc_mingw_x86_64
# # Limit parallel test jobs to prevent wine errors
# parallels-jobs: 1
# - name: Ubuntu 20.04 Clang 6
# os: ubuntu-20.04
# compiler: clang-6.0
# cxx-compiler: clang++-6.0
# packages: clang-6.0
# - name: Ubuntu Clang
# os: ubuntu-latest
# compiler: clang-15
# cxx-compiler: clang++-15
# packages: clang-15 llvm-15 llvm-15-tools
# gcov-exec: llvm-cov-15 gcov
# codecov: ubuntu_clang
# # Check for undefined symbols in the version script for the modern api
# - name: Ubuntu Clang Undefined Symbols
# os: ubuntu-latest
# compiler: clang-15
# cxx-compiler: clang++-15
# cmake-args: -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld -Wl,--no-undefined-version" -DZLIBNG_ENABLE_TESTS=OFF
# build-shared: ON
# packages: clang-15 llvm-15 lld
# # Check for undefined symbols in the version script for the compat api
# - name: Ubuntu Clang Undefined Symbols Compat
# os: ubuntu-latest
# compiler: clang-15
# cxx-compiler: clang++-15
# cmake-args: -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld -Wl,--no-undefined-version" -DZLIBNG_ENABLE_TESTS=OFF -DZLIB_COMPAT=ON
# build-shared: ON
# packages: clang-15 llvm-15 lld
# - name: Ubuntu Clang Inflate Strict
# os: ubuntu-latest
# compiler: clang-15
# cxx-compiler: clang++-15
# cmake-args: -DWITH_INFLATE_STRICT=ON
# packages: clang-15 llvm-15 llvm-15-tools
# gcov-exec: llvm-cov-15 gcov
# codecov: ubuntu_clang_inflate_strict
# - name: Ubuntu Clang Inflate Allow Invalid Dist
# os: ubuntu-latest
# compiler: clang-15
# cxx-compiler: clang++-15
# cmake-args: -DWITH_INFLATE_ALLOW_INVALID_DIST=ON
# packages: clang-15 llvm-15 llvm-15-tools
# gcov-exec: llvm-cov-15 gcov
# codecov: ubuntu_clang_inflate_allow_invalid_dist
# - name: Ubuntu Clang Reduced Memory
# os: ubuntu-latest
# compiler: clang-15
# cxx-compiler: clang++-15
# cmake-args: -DWITH_REDUCED_MEM=ON
# packages: clang-15 llvm-15 llvm-15-tools
# gcov-exec: llvm-cov-15 gcov
# codecov: ubuntu_clang_reduced_mem
# - name: Ubuntu Clang Memory Map
# os: ubuntu-latest
# compiler: clang-15
# cxx-compiler: clang++-15
# cflags: -DUSE_MMAP
# packages: clang-15 llvm-15 llvm-15-tools
# gcov-exec: llvm-cov-15 gcov
# codecov: ubuntu_clang_mmap
# - name: Ubuntu Clang Debug
# os: ubuntu-latest
# compiler: clang-15
# cxx-compiler: clang++-15
# packages: clang-15 llvm-15 llvm-15-tools
# gcov-exec: llvm-cov-15 gcov
# codecov: ubuntu_clang_debug
# build-config: Debug
- name: Ubuntu Clang MSAN
os: ubuntu-latest
compiler: clang-15
cxx-compiler: clang++-15
cmake-args: -GNinja -DWITH_SANITIZER=Memory
packages: ninja-build clang-15 llvm-15-tools libclang-rt-15-dev
gcov-exec: llvm-cov-15 gcov
# https://github.com/llvm/llvm-project/issues/55785
msan-options: use_sigaltstack=0
# - name: Ubuntu Clang RISC-V
# os: ubuntu-latest
# cmake-args: -GNinja -DCMAKE_TOOLCHAIN_FILE=./cmake/toolchain-riscv.cmake -DTOOLCHAIN_PATH=${PWD}/prebuilt-riscv-toolchain-qemu/riscv-clang -DQEMU_PATH=${PWD}/prebuilt-riscv-toolchain-qemu/riscv-qemu/bin/qemu-riscv64
# packages: build-essential cmake ninja-build
# - name: Ubuntu Emscripten WASM32
# os: ubuntu-latest
# chost: wasm32
# cmake-args: -DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_C_COMPILER_TARGET=wasm32 -DCMAKE_CROSSCOMPILING_EMULATOR=${EMSDK_NODE} -DZLIB_COMPAT=ON
# - name: Windows MSVC 2022 v143 Win32
# os: windows-latest
# compiler: cl
# cmake-args: -G "Visual Studio 17 2022" -A Win32 -T v143
# - name: Windows MSVC 2022 v143 Win64
# os: windows-latest
# compiler: cl
# cmake-args: -G "Visual Studio 17 2022" -A x64 -T v143
# - name: Windows MSVC 2022 v143 Win64 Native Instructions (AVX)
# os: windows-latest
# compiler: cl
# cmake-args: -G "Visual Studio 17 2022" -A x64 -T v143 -DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE=/arch:AVX
# - name: Windows MSVC 2022 v142 Win32
# os: windows-latest
# compiler: cl
# cmake-args: -G "Visual Studio 17 2022" -A Win32 -T v142
# - name: Windows MSVC 2022 v142 Win64
# os: windows-latest
# compiler: cl
# cmake-args: -G "Visual Studio 17 2022" -A x64 -T v142
# - name: Windows MSVC 2019 v141 Win32
# os: windows-2019
# compiler: cl
# cmake-args: -G "Visual Studio 16 2019" -A Win32 -T v141
# - name: Windows MSVC 2019 v141 Win64
# os: windows-2019
# compiler: cl
# cmake-args: -G "Visual Studio 16 2019" -A x64 -T v141
# - name: Windows MSVC 2019 v140 Win32
# os: windows-2019
# compiler: cl
# cmake-args: -G "Visual Studio 16 2019" -A Win32 -T v140
# - name: Windows MSVC 2019 v140 Win64
# os: windows-2019
# compiler: cl
# cmake-args: -G "Visual Studio 16 2019" -A x64 -T v140
# - name: Windows MSVC ARM No Test
# os: windows-latest
# compiler: cl
# cmake-args: -A ARM,version=10.0.22621.0
# - name: Windows MSVC ARM64 No Test
# os: windows-latest
# compiler: cl
# cmake-args: -A ARM64
# - name: Windows ClangCl Win32
# os: windows-latest
# cmake-args: -T ClangCl -A Win32
# - name: Windows ClangCl Win64
# os: windows-latest
# cmake-args: -T ClangCl -A x64
# - name: Windows ClangCl Win64 Native Instructions (AVX)
# os: windows-latest
# cmake-args: -T ClangCl -A x64 -DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE="-mavx -mpclmul"
# - name: Windows GCC
# os: windows-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -G Ninja
# codecov: win64_gcc
# - name: Windows GCC Native Instructions (AVX)
# os: windows-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -G Ninja -DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE="-mavx -mpclmul"
# - name: Windows GCC Compat No Opt
# os: windows-latest
# compiler: gcc
# cxx-compiler: g++
# cmake-args: -G Ninja -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF
# codecov: win64_gcc_compat_no_opt
# - name: macOS Clang ASAN
# os: macos-13
# compiler: clang
# cxx-compiler: clang++
# cmake-args: -DWITH_SANITIZER=Address
# codecov: macos_clang
# - name: macOS Clang ASAN (ARM64)
# os: macos-latest
# compiler: clang
# cxx-compiler: clang++
# cmake-args: -DWITH_SANITIZER=Address
# codecov: macos_clang_arm64
# - name: macOS GCC UBSAN
# os: macos-13
# compiler: gcc-10
# cxx-compiler: g++-10
# # Xcode 15 uses a new linker that is not compatible with GCC. Switch to the old linker.
# # Homebrew gcc@11 and later have a built-in workaround for it.
# ldflags: -ld_classic
# cmake-args: -DWITH_SANITIZER=Undefined
# packages: gcc@10
# gcov-exec: gcov-10
# codecov: macos_gcc
# - name: macOS GCC UBSAN (ARM64)
# os: macos-latest
# compiler: gcc-13
# cxx-compiler: g++-13
# cmake-args: -DWITH_SANITIZER=Undefined
# packages: gcc@13
# gcov-exec: gcov-13
# codecov: macos_gcc_arm64
# - name: macOS Clang Native Instructions (ARM64)
# os: macos-14
# compiler: clang
# cxx-compiler: clang++
# cmake-args: -DWITH_NATIVE_INSTRUCTIONS=ON
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
show-progress: false
- name: Checkout test corpora
uses: actions/checkout@v4
# Don't test against all corpora with MinGW due to Wine being unable to run parallel jobs
# without connection timeout. Without parallel jobs test runs using Wine take close to an hour.
if: contains(matrix.name, 'MinGW') == false
with:
repository: zlib-ng/corpora
path: test/data/corpora
show-progress: false
- name: Add repositories (Wine)
if: contains(matrix.packages, 'wine32')
run: sudo dpkg --add-architecture i386
- name: Add ubuntu mirrors
if: runner.os == 'Linux' && matrix.packages && !contains(matrix.os, 'z15')
# Github Actions caching proxy is at times unreliable
run: |
echo -e 'http://azure.archive.ubuntu.com/ubuntu\tpriority:1\n' | sudo tee /etc/apt/mirrors.txt
curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt
sudo sed -i 's#http://azure.archive.ubuntu.com/ubuntu/#mirror+file:/etc/apt/mirrors.txt#' /etc/apt/sources.list
- name: Install packages (Ubuntu)
if: runner.os == 'Linux' && matrix.packages && !contains(matrix.os, 'z15')
run: |
sudo apt-get update
sudo apt-get install -y --allow-downgrades --no-install-recommends ${{ matrix.packages }}
- name: Download prebuilt RISC-V Clang toolchain & QEMU emulator
if: runner.os == 'Linux' && contains(matrix.name, 'RISC-V')
run: |
gh release download ubuntu20.04_llvm16.0.0_qemu7.0.0 --repo sifive/prepare-riscv-toolchain-qemu
tar zxvf prebuilt-riscv-toolchain-qemu.tar.gz
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install packages (Windows)
if: runner.os == 'Windows'
run: |
# strawberryperl installs /c/Strawberry/c/bin/libstdc++-6.dll, which is incompatible with the mingw64 one.
# zlib-ng does not need perl, so simply remove it.
choco uninstall --no-progress strawberryperl
choco install --no-progress ninja ${{ matrix.packages }}
- name: Install packages (macOS)
if: runner.os == 'macOS'
run: brew install ninja ${{ matrix.packages }}
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
- name: Install Emscripten
if: contains(matrix.name, 'WASM32')
uses: mymindstorm/setup-emsdk@v14
- name: Initialize Wine
# Prevent parallel test jobs from initializing Wine at the same time
if: contains(matrix.packages, 'wine')
run: wineboot --init
- name: Compile LLVM C++ libraries (MSAN)
if: contains(matrix.name, 'MSAN')
run: |
git clone --depth=1 https://github.com/llvm/llvm-project --single-branch --branch llvmorg-15.0.7
cmake -S llvm-project/runtimes -B llvm-project/build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
-DLLVM_USE_SANITIZER=MemoryWithOrigins \
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_DOCS=OFF
cmake --build llvm-project/build -j3 -- cxx cxxabi
echo "LLVM_BUILD_DIR=`pwd`/llvm-project/build" >> $GITHUB_ENV
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.cxx-compiler }}
- name: Make source tree read-only
shell: bash
run: chmod -R a-w .
if: matrix.readonly-project-dir
- name: Generate project files
shell: bash
# Shared libraries turned off for qemu ppc* and sparc & reduce code coverage sources
run: |
cmake -S ${{ matrix.build-src-dir || '.' }} -B ${{ matrix.build-dir || '.' }} ${{ matrix.cmake-args }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} \
-DBUILD_SHARED_LIBS=${{ matrix.build-shared || 'OFF' }} \
-DWITH_FUZZERS=ON \
-DWITH_MAINTAINER_WARNINGS=ON \
${{ matrix.codecov && '-DWITH_CODE_COVERAGE=ON' }}
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.cxx-compiler }}
CFLAGS: ${{ matrix.cflags }}
LDFLAGS: ${{ matrix.ldflags }}
CI: true
- name: Compile source code
run: cmake --build ${{ matrix.build-dir || '.' }} -j2 --config ${{ matrix.build-config || 'Release' }}
- name: Run test cases
# Don't run tests on Windows ARM
if: runner.os != 'Windows' || contains(matrix.name, 'ARM') == false
run: ctest --verbose -C Release --output-on-failure --max-width 120 -j ${{ matrix.parallels-jobs || '3' }}
working-directory: ${{ matrix.build-dir || '.' }}
env:
ASAN_OPTIONS: ${{ matrix.asan-options || 'verbosity=0' }}:abort_on_error=1:halt_on_error=1
MSAN_OPTIONS: ${{ matrix.msan-options || 'verbosity=0' }}:abort_on_error=1:halt_on_error=1
TSAN_OPTIONS: ${{ matrix.tsan-options || 'verbosity=0' }}:abort_on_error=1:halt_on_error=1
LSAN_OPTIONS: ${{ matrix.lsan-options || 'verbosity=0' }}:abort_on_error=1:halt_on_error=1
UBSAN_OPTIONS: ${{ matrix.ubsan-options || 'verbosity=0' }}:print_stacktrace=1:abort_on_error=1:halt_on_error=1
- name: Make source tree writable
shell: bash
run: chmod -R +w .
if: matrix.readonly-project-dir
- name: Generate coverage report
if: matrix.codecov
shell: bash
run: |
python3 -u -m venv ${{ matrix.build-dir || '.' }}/venv
source ${{ matrix.build-dir || '.' }}/venv/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}/activate
python3 -u -m pip install gcovr
python3 -m gcovr ${{ matrix.build-dir || '' }} -j 3 --gcov-ignore-parse-errors --verbose \
--exclude-unreachable-branches \
--gcov-executable "${{ matrix.gcov-exec || 'gcov' }}" \
--root ${{ matrix.build-src-dir || '.' }} \
--xml --output ${{ matrix.codecov }}.xml
- name: Upload coverage report artifact
uses: actions/upload-artifact@v4
if: matrix.codecov
with:
name: ${{ matrix.name }} (coverage)
path: ${{ matrix.codecov }}.xml
retention-days: 1
- name: Upload build errors
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.name }} (cmake)
path: |
**/CMakeFiles/CMakeOutput.log
**/CMakeFiles/CMakeError.log
**/Testing/Temporary/*
coverage.xml
retention-days: 30
coverage:
name: Upload Coverage Reports
runs-on: ubuntu-latest
needs: cmake
if: cancelled() == false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
show-progress: false
- name: Download all reports
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Display all coverage artifacts
run: |
ls -R *.xml
echo "CODECOV_REPORTS=`ls -p *.xml | grep -v / | tr '\n' ',' | sed 's/,$//g'`" >> $GITHUB_ENV
- name: Upload reports
uses: codecov/codecov-action@v5
if: (env.CODECOV_TOKEN != '' || github.repository == 'zlib-ng/zlib-ng')
with:
files: ${{ env.CODECOV_REPORTS }}
name: cmake-umbrella
verbose: true
fail_ci_if_error: true
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"