Skip to content

Commit 5b3edae

Browse files
authored
Add CI test to ensure installation manifest is correct (#630)
The new CI job ensures that `make distcheck` passes. It also bundles up the tarball and includes in the GitHub artifacts, along with a GitHub-provided attestation that the tarball is derived from the given build steps.
1 parent 413bd8a commit 5b3edae

20 files changed

+1953
-14
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
testdata/* -text
1+
testdata/* -text
2+
maint/manifest-* -text

.github/workflows/build.yml

Lines changed: 85 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ jobs:
4545
- name: Test (pcre2posix program)
4646
run: ./pcre2posix_test -v
4747

48+
- name: Install
49+
run: |
50+
make install "DESTDIR=`pwd`/install-dir"
51+
maint/RunManifestTest install-dir maint/manifest-makeinstall-linux
52+
4853
alpine:
4954
name: alpine
5055
runs-on: ubuntu-latest
@@ -79,6 +84,11 @@ jobs:
7984
- name: Test (pcre2posix program)
8085
run: ./pcre2posix_test -v
8186

87+
- name: Install
88+
run: |
89+
make install "DESTDIR=`pwd`/install-dir"
90+
maint/RunManifestTest install-dir maint/manifest-makeinstall-linux
91+
8292
macos:
8393
name: macOS universal
8494
runs-on: macos-latest
@@ -89,14 +99,20 @@ jobs:
8999
submodules: true
90100

91101
- name: Configure
92-
run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2_SUPPORT_LIBZ=ON -DPCRE2_SUPPORT_LIBBZ2=ON -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DCMAKE_C_FLAGS='-Wall -Wextra' -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_BUILD_TYPE=Release -B build
102+
run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2_SUPPORT_LIBZ=ON -DPCRE2_SUPPORT_LIBBZ2=ON -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DCMAKE_C_FLAGS='-Wall -Wextra' -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_BUILD_TYPE=Release -B build
93103

94104
- name: Build
95105
run: cd build && make -j3
96106

97107
- name: Test
98108
run: cd build && ctest -j3 --output-on-failure
99109

110+
- name: Install
111+
run: |
112+
cd build
113+
cmake --install . --prefix install-dir
114+
../maint/RunManifestTest install-dir ../maint/manifest-cmakeinstall-macos
115+
100116
windows:
101117
name: Windows
102118
runs-on: windows-latest
@@ -111,14 +127,20 @@ jobs:
111127
submodules: true
112128

113129
- name: Configure
114-
run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -B build -A ${{ matrix.arch }}
130+
run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -B build -A ${{ matrix.arch }}
115131

116132
- name: Build
117133
run: cmake --build build --config Release
118134

119135
- name: Test
120136
run: cd build && ctest -C Release -j3 --output-on-failure
121137

138+
- name: Install
139+
run: |
140+
cd build
141+
cmake --install . --config Release --prefix install-dir
142+
../maint/RunManifestTest.ps1 install-dir ../maint/manifest-cmakeinstall-windows
143+
122144
freebsd:
123145
name: FreeBSD
124146
runs-on: ubuntu-latest
@@ -142,6 +164,9 @@ jobs:
142164
make -j3 CPPFLAGS='-Wall -Wextra -Werror'
143165
make check
144166
167+
make install "DESTDIR=`pwd`/install-dir"
168+
maint/RunManifestTest install-dir maint/manifest-makeinstall-freebsd
169+
145170
solaris:
146171
name: Solaris
147172
runs-on: ubuntu-latest
@@ -192,6 +217,64 @@ jobs:
192217
make CPPFLAGS='-Wall -Wextra -Werror'
193218
make check
194219
220+
make install "DESTDIR=`pwd`/install-dir"
221+
maint/RunManifestTest install-dir maint/manifest-makeinstall-linux
222+
223+
distcheck:
224+
name: Build & verify distribution
225+
runs-on: ubuntu-24.04 # TODO: Update to ubuntu-latest when that switches to 24.04
226+
permissions:
227+
id-token: write # Needed to make calls to the Sigstore service
228+
attestations: write # Needed to write the attestation to GitHub's database
229+
contents: read
230+
steps:
231+
- name: Checkout
232+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
233+
with:
234+
submodules: true
235+
236+
- name: Prepare
237+
run: |
238+
./autogen.sh
239+
240+
# Workaround for incorrect filesystem permissions on /usr/share/aclocal, which
241+
# causes the m4 macros to be copied with incorrect permissions.
242+
chmod u=rw,go=r m4/*.m4
243+
244+
- name: Configure
245+
run: ./configure
246+
247+
- name: Distcheck
248+
run: make distcheck -j3
249+
250+
- name: Manifest
251+
run: |
252+
mkdir tarball-dir
253+
tar -C tarball-dir -xzf pcre2-*.tar.gz
254+
# Budge the directory, so we don't back the version number into the
255+
# `manifest-tarball` file:
256+
mv tarball-dir/pcre2-* tarball-dir/pcre2-SNAPSHOT
257+
maint/RunManifestTest tarball-dir maint/manifest-tarball
258+
259+
- name: Upload to GitHub artifacts
260+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
261+
with:
262+
name: "Distribution release"
263+
path: |
264+
pcre2-*.tar.bz2
265+
pcre2-*.tar.gz
266+
pcre2-*.zip
267+
if-no-files-found: error
268+
269+
- name: Attest
270+
uses: actions/attest-build-provenance@7668571508540a607bdfd90a87a560489fe372eb # v2.1.0
271+
if: |
272+
github.event_name != 'pull_request' &&
273+
(startsWith(github.ref, 'refs/heads/release/') ||
274+
startsWith(github.ref, 'refs/tags/pcre2-'))
275+
with:
276+
subject-path: 'pcre2-*.tar.bz2, pcre2-*.tar.gz, pcre2-*.zip'
277+
195278
coverage:
196279
name: Code coverage
197280
runs-on: ubuntu-latest

.github/workflows/dev.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,20 @@ jobs:
9595
submodules: true
9696

9797
- name: Configure
98-
run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2_DEBUG=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_BUILD_TYPE=Release -B build
98+
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_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_BUILD_TYPE=Release -B build
9999

100100
- name: Build
101101
run: cd build && make -j3
102102

103103
- name: Test
104104
run: cd build && ctest -j3 --output-on-failure
105105

106+
- name: Install
107+
run: |
108+
cd build
109+
cmake --install . --prefix install-dir
110+
../maint/RunManifestTest install-dir ../maint/manifest-cmakeinstall-linux
111+
106112
dodo:
107113
# Tests with: Autconf on oldest supported Ubuntu (in non-extended support)
108114
name: GCC -Os, old Autotools
@@ -125,6 +131,11 @@ jobs:
125131
- name: Test
126132
run: make check
127133

134+
- name: Install
135+
run: |
136+
make install "DESTDIR=`pwd`/install-dir"
137+
maint/RunManifestTest install-dir maint/manifest-makeinstall-linux
138+
128139
wasp:
129140
# Tests with: French locale; oldest supported CMake; no JIT; -Os; libreadline
130141
name: GCC -Os, CMake+ninja, no JIT
@@ -157,14 +168,20 @@ jobs:
157168
- name: Configure
158169
run: |
159170
cmake --version | grep "version ${CMAKE_VER}" || (echo "CMake version mismatch" && exit 1)
160-
CC='clang' CFLAGS='-fsanitize=undefined,address,integer -fno-sanitize-recover=undefined,integer -fno-sanitize=unsigned-shift-base,function -pedantic -Wall -Wextra -Wpedantic -Wdeclaration-after-statement -Wshadow -Wno-overlength-strings -Werror -Wno-error=incompatible-pointer-types-discards-qualifiers' cmake -G Ninja -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2_DEBUG=ON -DPCRE2_SUPPORT_LIBREADLINE=ON -DCMAKE_BUILD_TYPE=MinSizeRel -B build
171+
CC='clang' CFLAGS='-fsanitize=undefined,address,integer -fno-sanitize-recover=undefined,integer -fno-sanitize=unsigned-shift-base,function -pedantic -Wall -Wextra -Wpedantic -Wdeclaration-after-statement -Wshadow -Wno-overlength-strings -Werror -Wno-error=incompatible-pointer-types-discards-qualifiers' cmake -G Ninja -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_BUILD_TYPE=MinSizeRel -B build
161172
162173
- name: Build
163174
run: ninja -C build
164175

165176
- name: Test
166177
run: cd build && ctest -j3 --output-on-failure
167178

179+
- name: Install
180+
run: |
181+
cd build
182+
cmake --install . --prefix install-dir
183+
../maint/RunManifestTest install-dir ../maint/manifest-cmakeinstall-linux
184+
168185
bat:
169186
# Tests with: MSVC 32-bit, and a variety of CMake options
170187
name: Windows (Win32)

maint/CheckTxt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl
1+
#! /usr/bin/perl
22

33
# This is a script for checking whether a file contains any carriage return
44
# characters, and whether it is valid UTF-8.

maint/Detrail

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl
1+
#! /usr/bin/perl
22

33
# This is a script for removing trailing whitespace from lines in files that
44
# are listed on the command line.

maint/GenerateCommon.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#! /usr/bin/python
2-
31
# PCRE2 UNICODE PROPERTY SUPPORT
42
# ------------------------------
53

maint/GenerateTest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/python
1+
#! /usr/bin/env python3
22

33
# PCRE2 UNICODE PROPERTY SUPPORT
44
# ------------------------------

maint/GenerateUcd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/python
1+
#! /usr/bin/env python3
22

33
# PCRE2 UNICODE PROPERTY SUPPORT
44
# ------------------------------

maint/GenerateUcpHeader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/python
1+
#! /usr/bin/env python3
22

33
# PCRE2 UNICODE PROPERTY SUPPORT
44
# ------------------------------

maint/GenerateUcpTables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/python
1+
#! /usr/bin/env python3
22

33
# PCRE2 UNICODE PROPERTY SUPPORT
44
# ------------------------------

0 commit comments

Comments
 (0)