1111 - all
1212 - canary
1313 - dragon
14- - greatawk
14+ - puffin
1515 - dodo
1616 - passenger
17+ - greatawk
1718 - wasp
1819 - bat
1920 - pterodactyl
@@ -97,27 +98,52 @@ jobs:
9798 ulimit -S -s 49152 # Raise stack limit; ASAN with -O0 is very stack-hungry
9899 (make check; rc=$?; for i in test-suite.log Run*Test.log pcre2*_test.log; do echo "== $i =="; cat $i; done; exit $rc)
99100
100- greatawk :
101- # Tests with: GCC, -O3, oldest supported Ubuntu (in non-extended support)
102- name : GCC -O3
101+ puffin :
102+ # Tests with: GCC, -O3, very latest CMake, libedit
103+ name : GCC -O3, CMake
103104 runs-on : ubuntu-latest
104- container : ubuntu:22.04
105- if : github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'greatawk')
105+ if : github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'puffin')
106106 steps :
107107 - name : Setup
108108 run : |
109- echo "set man-db/auto-update false" | debconf-communicate && dpkg-reconfigure man-db
110- export DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC
111- apt-get -qq update
112- apt-get -qq install -y git build-essential cmake
109+ echo "set man-db/auto-update false" | sudo debconf-communicate && sudo dpkg-reconfigure man-db
110+ sudo apt-get -qq update
111+ sudo apt-get -qq install -y git build-essential cmake zlib1g-dev libbz2-dev libedit-dev
113112
114113 - name : Checkout
115114 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
116115 with :
117116 submodules : true
118117
118+ - name : Check latest CMake
119+ id : get-cmake-ver
120+ run : |
121+ CMAKE_VER=$(curl -s https://api.github.com/repos/Kitware/CMake/releases/latest | jq -r '.tag_name' | sed 's/^v//')
122+ if ! echo "$CMAKE_VER" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$' ; then
123+ echo "Extracted CMake version: '$CMAKE_VER'" >&2
124+ echo "This does not match the expected version format" >&2
125+ exit 1
126+ fi
127+ echo "CMAKE_VER=$CMAKE_VER" >> $GITHUB_OUTPUT
128+ echo "CMAKE_VER=$CMAKE_VER" >> $GITHUB_ENV
129+ echo "Latest CMake version is $CMAKE_VER"
130+
131+ - name : Cache CMake
132+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
133+ with :
134+ key : cmake-${{ steps.get-cmake-ver.outputs.CMAKE_VER }}-linux-x86_64
135+ path : cmake-${{ steps.get-cmake-ver.outputs.CMAKE_VER }}-linux-x86_64.tar.gz
136+
137+ - name : Install CMake
138+ run : |
139+ [ -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"
140+ tar -xz -f cmake-${CMAKE_VER}-linux-x86_64.tar.gz -C "$RUNNER_TEMP"
141+ realpath "$RUNNER_TEMP/cmake-${CMAKE_VER}-linux-x86_64/bin" >> "$GITHUB_PATH"
142+
119143 - name : Configure
120- run : cmake $CMAKE_FLAGS -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
144+ run : |
145+ cmake --version | grep "version ${CMAKE_VER}" || (echo "CMake version mismatch" && exit 1)
146+ cmake $CMAKE_FLAGS -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_LIBEDIT=ON -DPCRE2_SUPPORT_LIBREADLINE=OFF -DCMAKE_C_FLAGS="$CFLAGS_GCC_STYLE" -DCMAKE_POLICY_VERSION_MINIMUM=$CMAKE_VER -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_BUILD_TYPE=Release -B build
121147
122148 - name : Build
123149 run : cd build && make -j3
@@ -251,9 +277,88 @@ jobs:
251277 maint/RunManifestTest install-dir maint/manifest-makeinstall-linux
252278 maint/RunSymbolTest install-dir/usr/local/lib/ maint/
253279
280+ greatawk :
281+ # Tests with: GCC, -O2, oldest supported Ubuntu (in non-extended support)
282+ name : GCC -O2, old CMake
283+ runs-on : ubuntu-latest
284+ container : ubuntu:22.04
285+ if : github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'greatawk')
286+ steps :
287+ - name : Setup
288+ run : |
289+ echo "set man-db/auto-update false" | debconf-communicate && dpkg-reconfigure man-db
290+ export DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC
291+ apt-get -qq update
292+ apt-get -qq install -y git build-essential cmake zlib1g-dev libbz2-dev libreadline-dev
293+
294+ - name : Checkout
295+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
296+ with :
297+ submodules : true
298+
299+ - name : Configure
300+ run : cmake $CMAKE_FLAGS -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=RelWithDebInfo -B build
301+
302+ - name : Build
303+ run : cd build && make -j3
304+
305+ - name : Test
306+ run : cd build && ctest -j3 --output-on-failure && (cat ./Testing/Temporary/LastTest.log || true)
307+
308+ - name : Install
309+ run : |
310+ cd build
311+ cmake --install . --prefix install-dir
312+ ../maint/RunManifestTest install-dir ../maint/manifest-cmakeinstall-linux relwithdebinfo
313+ ../maint/RunSymbolTest install-dir/lib/ ../maint/
314+
315+ - name : Test CMake install interface
316+ run : |
317+ INSTALL_PREFIX=`pwd`/build/install-dir
318+ cd maint/cmake-tests/install-interface
319+
320+ for useStaticLibs in ON OFF; do
321+ echo "== Testing CMake install interface with PCRE2_USE_STATIC_LIBS=$useStaticLibs =="
322+ rm -rf build
323+ cmake $CMAKE_FLAGS -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH="$INSTALL_PREFIX" -DPCRE2_USE_STATIC_LIBS=$useStaticLibs -B build
324+ (cd build; make)
325+ ./build/test_executable
326+ ldd ./build/test_executable
327+ if [ $useStaticLibs = ON ]; then
328+ (ldd ./build/test_executable | grep -q "pcre2") && (echo "Error: PCRE2 found in ldd output" && exit 1)
329+ else
330+ # Test that the shared library is actually linked in
331+ (ldd ./build/test_executable | grep -q "$INSTALL_PREFIX/lib/libpcre2-8.so.0") || (echo "Error: Shared library not linked in" && exit 1)
332+ fi
333+ done
334+
335+ - name : Test CMake build interface
336+ run : |
337+ BUILD_DIR=`pwd`
338+ cp -rp maint/cmake-tests/build-interface ../cmake-tests-build-interface
339+ cd ../cmake-tests-build-interface
340+ ln -s "$BUILD_DIR" pcre2
341+
342+ for buildLibs in "ON;OFF" "OFF;ON"; do
343+ static=`echo $buildLibs | cut -d';' -f1`
344+ shared=`echo $buildLibs | cut -d';' -f2`
345+ echo "== Testing CMake build interface with BUILD_STATIC_LIBS=$static and BUILD_SHARED_LIBS=$shared =="
346+ rm -rf build
347+ cmake $CMAKE_FLAGS -DCMAKE_BUILD_TYPE=Debug -DBUILD_STATIC_LIBS=$static -DBUILD_SHARED_LIBS=$shared -B build
348+ (cd build; make)
349+ ./build/test_executable
350+ ldd ./build/test_executable
351+ if [ $static = ON ]; then
352+ (ldd ./build/test_executable | grep -q "pcre2") && (echo "Error: PCRE2 found in ldd output" && exit 1)
353+ else
354+ # Test that the shared library is actually linked in
355+ (ldd ./build/test_executable | grep -q "`pwd`/build/pcre2/libpcre2-8.so.0") || (echo "Error: Shared library not linked in" && exit 1)
356+ fi
357+ done
358+
254359 wasp :
255360 # Tests with: French locale; oldest supported CMake; no JIT; -Os; libreadline
256- name : GCC -Os, CMake+ ninja, no JIT
361+ name : GCC -Os, very old CMake, ninja, no JIT
257362 runs-on : ubuntu-latest
258363 if : github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'wasp')
259364 env :
@@ -263,7 +368,7 @@ jobs:
263368 run : |
264369 echo "set man-db/auto-update false" | sudo debconf-communicate && sudo dpkg-reconfigure man-db
265370 sudo apt-get -qq update
266- sudo apt-get -qq install -y language-pack-fr ninja-build libreadline-dev
371+ sudo apt-get -qq install -y language-pack-fr ninja-build zlib1g-dev libbz2-dev libreadline-dev
267372
268373 - name : Checkout
269374 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -274,14 +379,13 @@ jobs:
274379 uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
275380 with :
276381 key : cmake-${{ env.CMAKE_VER }}-Linux-x86_64
277- path : ../ cmake-${{ env.CMAKE_VER }}-Linux-x86_64.tar.gz
382+ path : cmake-${{ env.CMAKE_VER }}-Linux-x86_64.tar.gz
278383
279384 - name : Install CMake
280385 run : |
281- cd ..
282386 [ -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"
283- tar -xz -f cmake-${CMAKE_VER}-Linux-x86_64.tar.gz
284- realpath "cmake-${CMAKE_VER}-Linux-x86_64/bin" >> "$GITHUB_PATH"
387+ tar -xz -f cmake-${CMAKE_VER}-Linux-x86_64.tar.gz -C "$RUNNER_TEMP"
388+ realpath "$RUNNER_TEMP/ cmake-${CMAKE_VER}-Linux-x86_64/bin" >> "$GITHUB_PATH"
285389
286390 - name : Configure
287391 run : |
@@ -511,7 +615,7 @@ jobs:
511615 install : |
512616 echo "set man-db/auto-update false" | debconf-communicate && dpkg-reconfigure man-db
513617 apt-get -qq update
514- apt-get -qq install -y gcc cmake ninja-build zlib1g-dev libbz2-dev
618+ apt-get -qq install -y gcc cmake ninja-build zlib1g-dev libbz2-dev libreadline-dev
515619
516620 run : |
517621 set -e
0 commit comments