Skip to content

Commit ff7392c

Browse files
authored
Build against CUPS 2.4, 2.5 and 3.x; add 12-combination CI matrix (#159)
* Support building against CUPS 2.x, CUPS 2.5, and 3.x and add 12-combo CI matrix * Link CUPS_LIBS into test programs for CUPS 2.5+ where string/option helpers come from libcups * Install source CUPS 2.5 to multiarch libdir; build source CUPS only on native arches * Run full 12-combo matrix: all three CUPS versions on all four architectures * Use native cupsParseOptions(); translate to cupsParseOptions2/3-arg form for CUPS 2.x in libcups2-private.h
1 parent 6cb4b02 commit ff7392c

7 files changed

Lines changed: 349 additions & 390 deletions

File tree

.github/workflows/build.yaml

Lines changed: 52 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
# Multi-Architecture Build and Test Workflow for libcupsfilters
2-
name: Build and Test (Multi-Architecture)
1+
# Multi-Architecture / multi-CUPS Build and Test Workflow for libcupsfilters
2+
#
3+
# Matrix: 4 architectures x 3 CUPS releases = 12 combinations.
4+
# architectures: x86_64, arm64 (native runners); armv7, riscv64 (QEMU)
5+
# CUPS releases: 2.4.x (distro libcups2-dev), 2.5.x (OpenPrinting/cups
6+
# master), 3.x (OpenPrinting/libcups master)
7+
# All the per-combination work lives in ci/ci-setup.sh so the legs differ only
8+
# in which CUPS is provided and whether they run under emulation.
9+
name: Build and Test (Multi-Architecture, Multi-CUPS)
310

411
on:
512
push:
@@ -10,159 +17,108 @@ on:
1017
- '**'
1118
workflow_dispatch:
1219

20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
1324
jobs:
1425
build-matrix:
1526
strategy:
1627
fail-fast: false
1728
matrix:
29+
arch: [x86_64, arm64, armv7, riscv64]
30+
cups: [system-2x, source-2.5.x, source-3.x]
1831
include:
19-
# Native x86_64
2032
- arch: x86_64
2133
runs-on: ubuntu-latest
2234
use-qemu: false
23-
24-
# Native ARM64
2535
- arch: arm64
2636
runs-on: ubuntu-24.04-arm
2737
use-qemu: false
28-
29-
# Emulated 32-bit ARM
3038
- arch: armv7
3139
runs-on: ubuntu-latest
3240
use-qemu: true
33-
34-
# Emulated RISC-V
3541
- arch: riscv64
3642
runs-on: ubuntu-latest
3743
use-qemu: true
3844

3945
runs-on: ${{ matrix.runs-on }}
40-
name: Build & Test (${{ matrix.arch }})
46+
name: Build & Test (${{ matrix.arch }}, ${{ matrix.cups }})
47+
# Building CUPS 2.5 / libcups3 from source under QEMU is slow; allow plenty.
48+
timeout-minutes: 360
4149

4250
steps:
4351
- uses: actions/checkout@v4
4452

4553
# ==========================================
46-
# 1. NATIVE EXECUTION (x86_64 and arm64)
54+
# NATIVE EXECUTION (x86_64 and arm64)
4755
# ==========================================
48-
- name: Install Dependencies (Native)
49-
if: matrix.use-qemu == false
50-
run: |
51-
sudo apt-get update --fix-missing -y
52-
sudo apt-get upgrade --fix-missing -y
53-
# PREVENT CONFLICTS: Ensure system version doesn't override local source
54-
sudo apt-get remove -y libcupsfilters-dev || true
55-
sudo apt-get install -y \
56-
libqpdf-dev \
57-
avahi-daemon libavahi-client-dev libssl-dev libpam-dev libusb-1.0-0-dev zlib1g-dev \
58-
autotools-dev autopoint cmake libtool pkg-config libcups2-dev libexif-dev liblcms2-dev \
59-
libfontconfig1-dev libfreetype6-dev build-essential qtbase5-dev qtchooser libcairo2-dev \
60-
libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev \
61-
libopenjp2-7-dev libjpeg-dev libjxl-dev libpoppler-cpp-dev libpython3-dev libdbus-1-dev \
62-
mupdf-tools poppler-utils ghostscript wget tar make gettext \
63-
dbus file
64-
65-
- name: Build PDFio and libcupsfilters (Native)
56+
- name: Build & Test (Native)
6657
if: matrix.use-qemu == false
6758
env:
6859
CC: /usr/bin/gcc
60+
CUPS_KIND: ${{ matrix.cups }}
61+
EMULATED: "0"
6962
run: |
7063
set -ex
71-
72-
# Build pdfio
73-
cd /tmp
74-
wget -q https://github.com/michaelrsweet/pdfio/releases/download/v1.6.4/pdfio-1.6.4.tar.gz
75-
tar -xzf pdfio-1.6.4.tar.gz && cd pdfio-1.6.4
76-
./configure --prefix=/usr --enable-shared
77-
make all
78-
sudo make install
79-
sudo ldconfig
80-
81-
# Build and Test libcupsfilters
82-
cd "$GITHUB_WORKSPACE"
83-
./autogen.sh
84-
./configure
85-
make -j$(nproc)
86-
# V=1 shows compiler commands; VERBOSE=1 restores full internal test details
87-
make check V=1 VERBOSE=1 || (test -f test-suite.log && cat test-suite.log; exit 1)
64+
sh ci/ci-setup.sh deps
65+
sh ci/ci-setup.sh cups "${{ matrix.cups }}"
66+
sh ci/ci-setup.sh pdfio
67+
sh ci/ci-setup.sh build-libcupsfilters
8868
8969
- name: Autopkgtest (DESTDIR staging, native)
70+
# Run the downstream autopkgtest suite (consumer compile/link/run +
71+
# functionality) against every CUPS version under test.
9072
if: matrix.use-qemu == false
9173
run: |
9274
set -ex
93-
cd "$GITHUB_WORKSPACE"
94-
# Full downstream suite: libcupsfilters-2-dev (compile/link/run) +
95-
# libcupsfilters-2-functionality. Both point at the staged tree via
96-
# environment overrides, so no privilege or path redirection is needed.
9775
make test-autopkgtest V=1
9876
9977
- name: Upload test artifacts (Native)
10078
if: matrix.use-qemu == false && always()
79+
continue-on-error: true
80+
timeout-minutes: 5
10181
uses: actions/upload-artifact@v4
10282
with:
103-
name: libcupsfilters-test-artifacts-${{ matrix.arch }}
83+
name: libcupsfilters-logs-${{ matrix.arch }}-${{ matrix.cups }}
10484
path: |
105-
**/*.log
106-
if-no-files-found: warn
85+
config.log
86+
test-suite.log
87+
cupsfilters/*.log
88+
if-no-files-found: ignore
10789

10890
# ==========================================
109-
# 2. EMULATED EXECUTION (armv7 and riscv64)
91+
# EMULATED EXECUTION (armv7 and riscv64)
11092
# ==========================================
111-
- name: Build and Test (Emulated)
93+
- name: Build & Test (Emulated)
11294
if: matrix.use-qemu == true
11395
uses: uraimo/run-on-arch-action@v3
11496
with:
11597
arch: ${{ matrix.arch }}
11698
distro: ubuntu24.04
99+
githubToken: ${{ github.token }}
117100
install: |
118101
apt-get update --fix-missing -y
119-
DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
120-
# PREVENT CONFLICTS: Ensure system version doesn't override local source
121-
apt-get remove -y libcupsfilters-dev || true
122-
apt-get install -y \
123-
libqpdf-dev \
124-
avahi-daemon libavahi-client-dev libssl-dev libpam-dev libusb-1.0-0-dev zlib1g-dev \
125-
autotools-dev autopoint cmake libtool pkg-config libcups2-dev libexif-dev liblcms2-dev \
126-
libfontconfig1-dev libfreetype6-dev build-essential qtbase5-dev qtchooser libcairo2-dev \
127-
libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev \
128-
libopenjp2-7-dev libjpeg-dev libjxl-dev libpoppler-cpp-dev libpython3-dev libdbus-1-dev \
129-
mupdf-tools poppler-utils ghostscript wget tar make gettext gcc g++ \
130-
dbus file
102+
DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata ca-certificates git
131103
run: |
132104
set -ex
133-
REPO_DIR=$(pwd)
134-
135-
# Build pdfio
136-
cd /tmp
137-
wget -q https://github.com/michaelrsweet/pdfio/releases/download/v1.6.4/pdfio-1.6.4.tar.gz
138-
tar -xzf pdfio-1.6.4.tar.gz && cd pdfio-1.6.4
139-
./configure --prefix=/usr --enable-shared
140-
make all
141-
make install
142-
ldconfig
143-
144-
# Build and Test libcupsfilters
145-
cd $REPO_DIR
146-
export CC=/usr/bin/gcc
147-
./autogen.sh
148-
./configure
149-
make -j$(nproc)
150-
151-
# Mark test-pclm-overflow.sh as XFAIL; VERBOSE=1 for full internal logs
152-
make check V=1 VERBOSE=1 XFAIL_TESTS="cupsfilters/test-pclm-overflow.sh" || (test -f test-suite.log && cat test-suite.log; exit 1)
153-
154-
# Full downstream autopkgtest suite. Both tests resolve the staged
155-
# build tree through environment overrides (no absolute paths, no
156-
# privilege, no bind mounts), so the same suite that runs on the
157-
# native legs runs unchanged under QEMU emulation.
105+
export CUPS_KIND="${{ matrix.cups }}"
106+
export EMULATED=1
107+
sh ci/ci-setup.sh deps
108+
sh ci/ci-setup.sh cups "${{ matrix.cups }}"
109+
sh ci/ci-setup.sh pdfio
110+
sh ci/ci-setup.sh build-libcupsfilters
158111
make test-autopkgtest V=1
159112
160113
- name: Upload test artifacts (Emulated)
161114
if: matrix.use-qemu == true && always()
115+
continue-on-error: true
116+
timeout-minutes: 5
162117
uses: actions/upload-artifact@v4
163118
with:
164-
name: libcupsfilters-test-artifacts-${{ matrix.arch }}
119+
name: libcupsfilters-logs-${{ matrix.arch }}-${{ matrix.cups }}
165120
path: |
166-
**/*.log
167-
if-no-files-found: warn
168-
121+
config.log
122+
test-suite.log
123+
cupsfilters/*.log
124+
if-no-files-found: ignore

Makefile.am

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ testcmyk_SOURCES = \
245245
$(pkgfiltersinclude_DATA)
246246
testcmyk_LDADD = \
247247
libcupsfilters.la \
248+
$(CUPS_LIBS) \
248249
-lm
249250
testcmyk_CFLAGS = \
250251
$(CUPS_CFLAGS)
@@ -254,6 +255,7 @@ testdither_SOURCES = \
254255
$(pkgfiltersinclude_DATA)
255256
testdither_LDADD = \
256257
libcupsfilters.la \
258+
$(CUPS_LIBS) \
257259
-lm
258260
testdither_CFLAGS = \
259261
$(CUPS_CFLAGS)
@@ -266,6 +268,7 @@ testimage_LDADD = \
266268
$(LIBPNG_LIBS) \
267269
$(TIFF_LIBS) \
268270
libcupsfilters.la \
271+
$(CUPS_LIBS) \
269272
-lm
270273
testimage_CFLAGS = \
271274
$(LIBJPEG_CFLAGS) \
@@ -278,6 +281,7 @@ testrgb_SOURCES = \
278281
$(pkgfiltersinclude_DATA)
279282
testrgb_LDADD = \
280283
libcupsfilters.la \
284+
$(CUPS_LIBS) \
281285
-lm
282286
testrgb_CFLAGS = \
283287
$(CUPS_CFLAGS)
@@ -299,7 +303,8 @@ testpdf1_CFLAGS = \
299303
-I$(srcdir)/cupsfilters/ \
300304
$(CUPS_CFLAGS)
301305
testpdf1_LDADD = \
302-
libcupsfilters.la
306+
libcupsfilters.la \
307+
$(CUPS_LIBS)
303308

304309
testpdf2_SOURCES = \
305310
cupsfilters/testpdf2.c \
@@ -309,18 +314,19 @@ testpdf2_CFLAGS = \
309314
-I$(srcdir)/cupsfilters/ \
310315
$(CUPS_CFLAGS)
311316
testpdf2_LDADD = \
312-
libcupsfilters.la
317+
libcupsfilters.la \
318+
$(CUPS_LIBS)
313319

314320
test_analyze_SOURCES = cupsfilters/fontembed/test-analyze.c
315-
test_analyze_LDADD = libcupsfilters.la
321+
test_analyze_LDADD = libcupsfilters.la $(CUPS_LIBS)
316322
test_analyze_CFLAGS = $(CUPS_CFLAGS)
317323

318324
test_pdf_SOURCES = cupsfilters/fontembed/test-pdf.c
319-
test_pdf_LDADD = libcupsfilters.la
325+
test_pdf_LDADD = libcupsfilters.la $(CUPS_LIBS)
320326
test_pdf_CFLAGS = $(CUPS_CFLAGS)
321327

322328
test_ps_SOURCES = cupsfilters/fontembed/test-ps.c
323-
test_ps_LDADD = libcupsfilters.la
329+
test_ps_LDADD = libcupsfilters.la $(CUPS_LIBS)
324330
test_ps_CFLAGS = $(CUPS_CFLAGS)
325331

326332
testfilters_SOURCES = \

0 commit comments

Comments
 (0)