-
Notifications
You must be signed in to change notification settings - Fork 199
490 lines (409 loc) · 17.2 KB
/
dev.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
name: Dev
on:
workflow_dispatch:
push:
branches: [ master, "release/**" ]
pull_request:
branches: [ master ]
permissions:
contents: read
env:
CFLAGS_GCC_STYLE: '-Wall -Wextra -pedantic -Wdeclaration-after-statement -Wshadow -Wno-overlength-strings'
CFLAGS_MSVC: '/W3'
jobs:
canary:
# Tests with: Debug & assertions; link-size=4; libedit
name: GCC -O0
runs-on: ubuntu-24.04
steps:
- name: Setup
run: |
sudo apt-get -qq update
sudo apt-get -qq install libedit-dev
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Prepare
run: ./autogen.sh
- name: Configure
run: ./configure CC='gcc -fsanitize=undefined,address -fsanitize-undefined-trap-on-error' CFLAGS="-O0 $CFLAGS_GCC_STYLE" --enable-jit --enable-pcre2-16 --enable-pcre2-32 --enable-debug --enable-Werror --enable-pcre2test-libedit --with-link-size=4
- name: Build
run: make -j3
- name: Test (main test script)
run: ./RunTest
- name: Test (JIT test program)
run: ./pcre2_jit_test
- name: Test (pcre2grep test script)
run: ./RunGrepTest
- name: Test (pcre2posix program)
run: ./pcre2posix_test -v
dragon:
# Tests with: clang AB/UB; link-size=3
name: Clang
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
opt: ["-O0", "-O2"]
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Prepare
run: ./autogen.sh
- name: Configure
run: ./configure CC='clang -fsanitize=undefined,address,integer -fno-sanitize-recover=undefined,integer -fno-sanitize=unsigned-integer-overflow,unsigned-shift-base,function' CFLAGS="${{ matrix.opt }} $CFLAGS_GCC_STYLE" --enable-jit --enable-pcre2-16 --enable-pcre2-32 --enable-debug --enable-Werror --with-link-size=3
- name: Build
run: make -j3
- name: Test (main test script)
run: |
ulimit -S -s 49152 # Raise stack limit; ASAN with -O0 is very stack-hungry
./RunTest
- name: Test (JIT test program)
run: ./pcre2_jit_test
- name: Test (pcre2grep test script)
run: ./RunGrepTest
- name: Test (pcre2posix program)
run: ./pcre2posix_test -v
greatawk:
# Tests with: GCC, -O3, oldest supported Ubuntu (in non-extended support)
name: GCC -O3
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Configure
run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DPCRE2_DEBUG=ON -DCMAKE_C_FLAGS="$CFLAGS_GCC_STYLE" -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_BUILD_TYPE=Release -B build
- name: Build
run: cd build && make -j3
- name: Test
run: cd build && ctest -j3 --output-on-failure
- name: Install
run: |
cd build
cmake --install . --prefix install-dir
../maint/RunManifestTest install-dir ../maint/manifest-cmakeinstall-linux
dodo:
# Tests with: Autconf on oldest supported Ubuntu (in non-extended support)
name: GCC -Os, old Autotools
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Prepare
run: ./autogen.sh
- name: Configure
run: ./configure CFLAGS="-Os $CFLAGS_GCC_STYLE" --enable-jit --enable-pcre2-16 --enable-pcre2-32 --enable-debug --enable-Werror
- name: Build
run: make -j3
- name: Test
run: make check || (cat ./test-suite.log; false)
- name: Install
run: |
make install "DESTDIR=`pwd`/install-dir"
maint/RunManifestTest install-dir maint/manifest-makeinstall-linux
wasp:
# Tests with: French locale; oldest supported CMake; no JIT; -Os; libreadline
name: GCC -Os, CMake+ninja, no JIT
runs-on: ubuntu-24.04
env:
CMAKE_VER: "3.15.7"
steps:
- name: Setup
run: |
sudo apt-get -qq update
sudo apt-get -qq install language-pack-fr ninja-build libreadline-dev
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Cache CMake
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
key: cmake-${{ env.CMAKE_VER }}-Linux-x86_64
path: cmake-${{ env.CMAKE_VER }}-Linux-x86_64.tar.gz
- name: Install CMake
run: |
[ -f cmake-${CMAKE_VER}-Linux-x86_64.tar.gz ] || curl -L -S -O "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-Linux-x86_64.tar.gz"
tar -xz -f cmake-${CMAKE_VER}-Linux-x86_64.tar.gz
realpath "cmake-${CMAKE_VER}-Linux-x86_64/bin" >> "$GITHUB_PATH"
- name: Configure
run: |
cmake --version | grep "version ${CMAKE_VER}" || (echo "CMake version mismatch" && exit 1)
CC='clang' cmake -G Ninja -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DPCRE2_DEBUG=ON -DPCRE2_SUPPORT_LIBREADLINE=ON -DCMAKE_C_FLAGS="$CFLAGS_GCC_STYLE" -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_BUILD_TYPE=MinSizeRel -B build
- name: Build
run: ninja -C build
- name: Test
run: cd build && ctest -j3 --output-on-failure
- name: Install
run: |
cd build
cmake --install . --prefix install-dir
../maint/RunManifestTest install-dir ../maint/manifest-cmakeinstall-linux
bat:
# Tests with: MSVC 32-bit, and a variety of CMake options
name: Windows (Win32)
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Configure
run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2GREP_SUPPORT_CALLOUT_FORK=OFF -DPCRE2_DEBUG=ON -DPCRE2_NEWLINE=ANYCRLF -DPCRE2_STATIC_PIC=ON -DPCRE2_STATIC_RUNTIME=ON -DPCRE2_SUPPORT_BSR_ANYCRLF=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_C_FLAGS="$CFLAGS_MSVC" -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -B build -A Win32
- name: Build
run: cmake --build build --config RelWithDebInfo
- name: Test
run: cd build && ctest -C RelWithDebInfo -j3 --output-on-failure
pterodactyl:
# Tests with: MSVC 64-bit, Debug, shared libraries
name: Windows (x64)
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Configure
run: cmake -DPCRE2_SUPPORT_JIT=OFF -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2_DEBUG=ON -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF -DCMAKE_C_FLAGS="$CFLAGS_MSVC" -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -B build -A x64
- name: Build
run: cmake --build build --config Debug
- name: Test
run: cd build && ctest -C Debug -j3 --output-on-failure
bigbird:
# Job to execute ManyConfigTests
name: manyconfig
runs-on: ubuntu-24.04
steps:
- name: Setup
run: |
sudo apt-get -qq update
sudo apt-get -qq install -y valgrind
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Run
run: |
./autogen.sh
./maint/ManyConfigTests
camel:
# Job to execute RunPerlTest
name: perl
runs-on: ubuntu-24.04
container: perl:devel
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: yes
- name: Test
run: |
perl -v
maint/RunPerlTest
chaffinch:
# Job to verify that the CMake "unity" build (single-file / jumbo build) passes.
# If this fails, it's usually because two different files define some file-static
# functions or macros which collide.
name: CMake unity build
runs-on: ubuntu-24.04
env:
# Disallowing shadowing would be very spammy for unity builds, because the
# same variable name can be used in multiple files.
# We disable format truncation/overflow because the heuristics used for
# these warnings are not very good, and are apparently affected by the
# inliner, which is used much less aggressively in unity builds.
CFLAGS_UNITY: "-Wno-shadow -Wno-format-truncation -Wno-format-overflow"
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Configure
run: cmake -DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=0 -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2_DEBUG=ON -DCMAKE_C_FLAGS="$CFLAGS_GCC_STYLE $CFLAGS_UNITY" -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_BUILD_TYPE=Release -B build
- name: Build
run: cd build && make -j3
- name: Test
run: cd build && ctest -j3 --output-on-failure
msys2:
# Tests with: MSYS2 unix-on-Windows environment
name: MSYS2
runs-on: windows-latest
if: github.event_name != 'pull_request'
strategy:
fail-fast: false
matrix:
# UCRT64 is the new default MSYS2 runtime, which builds native 64-bit
# binaries which can then be shipped and run on systems without MSYS2
# installed (using MinGW-x64 + the UCRT).
# MSYS is the Unix-variant runtime, which builds binaries that have a
# dependency on MSYS2 being installed, but those binaries then use a
# full emulated Unix environment at runtime.
msystem: ["UCRT64", "MSYS"]
steps:
- name: Pre-checkout
run: git config --global core.autocrlf input
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Setup
uses: msys2/setup-msys2@d44ca8e88d8b43d56cf5670f91747359d5537f97 # v2.26.0
with:
msystem: ${{ matrix.msystem }}
update: true
pacboy: diffutils gcc:p cmake:p ninja:p ${{ matrix.msystem == 'MSYS' && 'libreadline:p' || 'readline:p' }}
- name: Configure
shell: msys2 {0}
run: cmake -G Ninja -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DPCRE2_DEBUG=ON -DCMAKE_C_FLAGS="$CFLAGS_GCC_STYLE -Wno-format-truncation -Wno-format-overflow" -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_BUILD_TYPE=Release -B build
- name: Build
shell: msys2 {0}
run: ninja -C build
- name: Test
shell: msys2 {0}
run: cd build && ctest -j3 --output-on-failure
ptarmigan:
# Tests with various unusual processor architectures
name: Multiarch
strategy:
fail-fast: false
matrix:
include:
# S390x is important, because it's basically the only supported big-endian
# architecture I can find anywhere. I used to work on SPARC and PPC-be systems
# a long time ago, but even Debian has dropped those architectures now, so
# it's nice that there's *least one* arch remaining to shake out endian
# assumptions.
- arch: "s390x"
distro: ubuntu_latest
# Big-iron POWER only (this is not the PowerPC arch used in old Apple Macs)
- arch: "ppc64le"
distro: "ubuntu_latest"
# A 32-bit Linux build. i386 is mostly gone now, so ARMv7 is all that's left.
- arch: "armv7"
distro: "ubuntu_latest"
# The only really widely-deployed non-x86 archicture, at least that's likely
# to be running PCRE2.
- arch: "aarch64"
distro: "ubuntu_latest"
# Not used by anyone yet, really, but potentially the "next big thing".
- arch: "riscv64"
distro: "ubuntu_latest"
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write # Necessary for uraimo/run-on-arch-action to use GitHub's Docker repository as a cache
if: github.event_name != 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Prepare
run: ./autogen.sh
- uses: uraimo/run-on-arch-action@ac33288c3728ca72563c97b8b88dda5a65a84448 # v2.8.1
name: Configure, build, and test
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
# Not required, but speeds up builds by storing container images in
# a GitHub package registry.
githubToken: ${{ github.token }}
env: | # YAML, but pipe character is necessary
CFLAGS_GCC_STYLE: ${{ env.CFLAGS_GCC_STYLE }}
install: |
apt-get -qq update
apt-get -qq install -y gcc cmake ninja-build zlib1g-dev libbz2-dev
run: |
set -e
# TODO: Set -DCMAKE_COMPILE_WARNING_AS_ERROR=ON (there's currently a build failure on S390x)
cmake -G Ninja -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DPCRE2_DEBUG=ON -DCMAKE_C_FLAGS="$CFLAGS_GCC_STYLE -Wno-format-truncation -Wno-format-overflow" -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -B build
ninja -C build
(cd build && ctest -j3 --output-on-failure)
zebrilus:
# Tests with: Zig compiler
name: Zig
runs-on: ubuntu-24.04
if: github.event_name != 'pull_request'
steps:
- name: Setup
run: |
sudo snap install zig --classic --beta
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Build
run: zig build
- name: Test
run: |
# Zig does something weird with the stack - it uses more space than the
# equivalent plain C program.
ulimit -S -s 16384
srcdir=`pwd` pcre2test=`pwd`/zig-out/bin/pcre2test ./RunTest
bazel:
# Tests with: Bazel build system
name: Bazel
strategy:
fail-fast: false
matrix:
os: ["ubuntu-24.04", "windows-latest"]
runs-on: ${{ matrix.os }}
if: github.event_name != 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Build
run: bazelisk build //... --enable_runfiles --incompatible_strict_action_env
- name: Test
run: bazelisk test //... --enable_runfiles --incompatible_strict_action_env --test_output=all
heron:
# Job to verify that the tasks performed by PrepareRelease have been done. It is
# the committer's responsibility (currently) to run PrepareRelease themselves when
# making a PR, so that everything is kept in-sync.
name: Check autogenerated file freshness
runs-on: ubuntu-24.04 # TODO: Update to ubuntu-latest when that switches to 24.04
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: false
fetch-depth: 0 # Necessary for maint/PrepareRelease
fetch-tags: false
# Check out the unmerged source branch for `pull_request`-triggered runs;
# otherwise use the tip of the branch for `workflow_dispatch` and `pull` triggers.
ref: ${{ github.head_ref || github.ref }}
- name: PrepareRelease
run: maint/PrepareRelease
- name: 'Rebuild *.h.generic'
run: |
./autogen.sh && ./configure
rm -f src/*.generic
make src/config.h.generic src/pcre2.h.generic
# If we're in a forked repo, it's too onerous to expect contributors to run the
# checks locally to keep these files up to date (since the tool versions are very
# fussy and brittle).
#
# However, we still want to run the steps above, to check that the PrepareRelease
# process is able to run to completion, since it can pick up errors in the man pages.
- name: Commit and push, if not in a forked repo
if: github.event_name != 'pull_request' || ( ! github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' )
run: |
if [ -n "`git status --porcelain`" ] ; then
# Dirty working tree: push it
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -u
git commit -m "Sync autogenerated files"
git push
fi