11# =============================================================================
2- # Multi-Architecture Build & Test Workflow for libppd
2+ # Multi-Architecture / multi-CUPS Build & Test Workflow for libppd
33#
4- # Modelled on the QEMU-based CI used in the sister OpenPrinting repositories
5- # (libcupsfilters, cups-filters). Proves on every push / PR / manual dispatch
6- # that libppd compiles end-to-end (libppd.la + every check_PROGRAMS binary)
7- # and that every registered TEST in Makefile.am passes under
8- # `make check V=1 VERBOSE=1` on FOUR architectures:
4+ # Matrix: 4 architectures x 3 CUPS releases = 12 combinations.
5+ # architectures: amd64, arm64 (native runners); armhf, riscv64 (QEMU)
6+ # CUPS releases: 2.4.x (distro libcups2-dev), 2.5.x (OpenPrinting/cups
7+ # master), 3.x (OpenPrinting/libcups master)
98#
10- # * amd64 - native, ubuntu-latest
11- # * arm64 - native, ubuntu-24.04-arm
12- # * armhf - emulated via QEMU (armv7)
13- # * riscv64 - emulated via QEMU
14- #
15- # The hermetic C unit tests exercised: testppd, test_ppd_localize,
16- # test_ppd_cache, test_ppd_ipp, test_ppd_mark, test_ppd_custom,
17- # test_ppd_attr, test_ppd_page, test_ppd_conflicts.
18- #
19- # apt package list derived from libppd's configure.ac:
20- # PKG_CHECK_MODULES([LIBCUPSFILTERS]) -> libcupsfilters-dev
21- # PKG_CHECK_MODULES([ZLIB]) -> zlib1g-dev
22- # AC_PATH_TOOL(CUPSCONFIG) -> libcups2-dev
23- # AC_CHECK_PROG(gs / pdftops / mutool) -> ghostscript, poppler-utils,
24- # mupdf-tools
25- # AM_GNU_GETTEXT([external]) -> gettext, autopoint
26- # AC_PROG_CC / CXX / LT_INIT / pkg-config -> build-essential, autoconf,
27- # automake, libtool,
28- # libtool-bin, pkg-config
29- # transitive (poppler / qpdf renderers) -> libqpdf-dev, libpoppler-dev,
30- # libpoppler-cpp-dev
9+ # libppd depends on BOTH libcups and libcupsfilters. For the source-CUPS legs
10+ # the distro libcupsfilters-dev is the wrong ABI, so ci/ci-setup.sh builds
11+ # libcupsfilters (and pdfio) from source against the active CUPS. All the
12+ # per-combination work lives in that script so the legs differ only in which
13+ # CUPS is provided and whether they run under emulation.
3114# =============================================================================
32-
33- name : Build and Test (libppd, multi-arch)
15+ name : Build and Test (libppd, Multi-Architecture, Multi-CUPS)
3416
3517on :
3618 push :
4123 - ' **'
4224 workflow_dispatch :
4325
26+ concurrency :
27+ group : ${{ github.workflow }}-${{ github.ref }}
28+ cancel-in-progress : true
29+
4430jobs :
45- build :
46- name : Build & Test (${{ matrix.arch }})
31+ build-matrix :
32+ name : Build & Test (${{ matrix.arch }}, ${{ matrix.cups }} )
4733 runs-on : ${{ matrix.runs-on }}
34+ # Building CUPS / libcupsfilters from source under QEMU is slow; allow plenty.
35+ timeout-minutes : 360
4836
4937 strategy :
5038 fail-fast : false
5139 matrix :
40+ arch : [amd64, arm64, armhf, riscv64]
41+ cups : [system-2x, source-2.5.x, source-3.x]
5242 include :
5343 - arch : amd64
5444 runs-on : ubuntu-latest
@@ -66,156 +56,80 @@ jobs:
6656 qemu-arch : riscv64
6757
6858 steps :
69- - name : Checkout repository
70- uses : actions/checkout@v4
71-
72- - name : Save workspace directory
73- run : echo "REPO_DIR=$(pwd)" >> $GITHUB_ENV
74-
75- # -----------------------------------------------------------------------
76- # NATIVE LEG (amd64 on ubuntu-latest, arm64 on ubuntu-24.04-arm)
77- # -----------------------------------------------------------------------
78- - name : Install dependencies (native)
79- if : matrix.use-qemu == false
80- run : |
81- set -ex
82- sudo apt-get clean
83- sudo apt-get update --fix-missing -y -o Acquire::Retries=3
84- # Drop any pre-shipped libppd-dev so our local build wins
85- sudo apt-get remove -y libppd-dev || true
86- sudo apt-get install -y --no-install-recommends \
87- build-essential \
88- autoconf \
89- automake \
90- autopoint \
91- libtool \
92- libtool-bin \
93- pkg-config \
94- gettext \
95- git \
96- wget \
97- tar \
98- libcups2-dev \
99- libcupsfilters-dev \
100- libqpdf-dev \
101- libpoppler-dev \
102- libpoppler-cpp-dev \
103- zlib1g-dev \
104- ghostscript \
105- poppler-utils \
106- mupdf-tools \
107- file
59+ - uses : actions/checkout@v4
10860
109- - name : Build & test libppd (native)
61+ # ==========================================
62+ # NATIVE EXECUTION (amd64 and arm64)
63+ # ==========================================
64+ - name : Build & Test (Native)
11065 if : matrix.use-qemu == false
66+ env :
67+ CUPS_KIND : ${{ matrix.cups }}
68+ EMULATED : " 0"
11169 run : |
11270 set -ex
113- cd "$REPO_DIR"
114- ./autogen.sh
115- # --enable-ppdc-utils: the downstream libppd-2-dev autopkgtest needs
116- # the staged `ppdc` to compile its test.drv into a PPD.
117- ./configure --enable-ppdc-utils
118- make -j$(nproc) V=1
119- make check V=1 VERBOSE=1 || {
120- echo "==== test-suite.log ===="
121- test -f test-suite.log && cat test-suite.log
122- echo "==== per-test logs ===="
123- for f in $(find . -name '*.log' -not -name 'config.log'); do
124- echo "---- $f ----"; cat "$f"
125- done
126- exit 1
127- }
71+ sh ci/ci-setup.sh deps
72+ sh ci/ci-setup.sh cups "${{ matrix.cups }}"
73+ sh ci/ci-setup.sh pdfio
74+ sh ci/ci-setup.sh libcupsfilters "${{ matrix.cups }}"
75+ sh ci/ci-setup.sh build-libppd
12876
12977 - name : Autopkgtest (DESTDIR staging, native)
78+ # Run the downstream autopkgtest suite (libppd-2-dev compile/link/run +
79+ # libppd-2-ppd-handling) against every CUPS version under test.
13080 if : matrix.use-qemu == false
13181 run : |
13282 set -ex
133- cd "$REPO_DIR"
134- # Full downstream suite: libppd-2-dev (compile/link/run) +
135- # libppd-2-ppd-handling. Both point at the staged tree via
136- # environment overrides, so no privilege or path redirection is
137- # needed.
13883 make test-autopkgtest V=1
13984
140- # -----------------------------------------------------------------------
141- # EMULATED LEG (armhf via QEMU armv7, riscv64 via QEMU)
142- # -----------------------------------------------------------------------
143- - name : Set up QEMU
144- if : matrix.use-qemu == true
145- uses : docker/setup-qemu-action@v3
85+ - name : Upload test artifacts (Native)
86+ if : matrix.use-qemu == false && always()
87+ continue-on-error : true
88+ timeout-minutes : 5
89+ uses : actions/upload-artifact@v4
14690 with :
147- platforms : ${{ matrix.qemu-arch }}
91+ name : libppd-logs-${{ matrix.arch }}-${{ matrix.cups }}
92+ path : |
93+ config.log
94+ test-suite.log
95+ ppd/*.log
96+ ppd/*.trs
97+ if-no-files-found : ignore
14898
149- - name : Build & test libppd (emulated)
99+ # ==========================================
100+ # EMULATED EXECUTION (armhf and riscv64)
101+ # ==========================================
102+ - name : Build & Test (Emulated)
150103 if : matrix.use-qemu == true
151104 uses : uraimo/run-on-arch-action@v3
152105 with :
153106 arch : ${{ matrix.qemu-arch }}
154107 distro : ubuntu24.04
155- dockerRunArgs : |
156- --volume "${{ github.workspace }}:/workspace"
108+ githubToken : ${{ github.token }}
157109 install : |
158- apt-get clean
159- apt-get update --fix-missing -y -o Acquire::Retries=3
160- DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
161- apt-get remove -y libppd-dev 2>/dev/null || true
162- apt-get install -y --no-install-recommends \
163- build-essential \
164- gcc g++ \
165- autoconf \
166- automake \
167- autopoint \
168- libtool \
169- libtool-bin \
170- pkg-config \
171- gettext \
172- git \
173- wget \
174- tar \
175- libcups2-dev \
176- libcupsfilters-dev \
177- libqpdf-dev \
178- libpoppler-dev \
179- libpoppler-cpp-dev \
180- zlib1g-dev \
181- ghostscript \
182- poppler-utils \
183- mupdf-tools \
184- file
110+ apt-get update --fix-missing -y
111+ DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata ca-certificates git
185112 run : |
186113 set -ex
187- cd /workspace
188- ./autogen.sh
189- # --enable-ppdc-utils: needed by the libppd-2-dev autopkgtest.
190- ./configure --enable-ppdc-utils
191- make -j$(nproc) V=1
192- make check V=1 VERBOSE=1 || {
193- echo "==== test-suite.log ===="
194- test -f test-suite.log && cat test-suite.log
195- echo "==== per-test logs ===="
196- for f in $(find . -name '*.log' -not -name 'config.log'); do
197- echo "---- $f ----"; cat "$f"
198- done
199- exit 1
200- }
201-
202- # Full downstream autopkgtest suite. Both tests resolve the
203- # staged build tree through environment overrides (no absolute
204- # paths, no privilege, no bind mounts), so the same suite that
205- # runs on the native legs runs unchanged under QEMU emulation.
114+ export CUPS_KIND="${{ matrix.cups }}"
115+ export EMULATED=1
116+ sh ci/ci-setup.sh deps
117+ sh ci/ci-setup.sh cups "${{ matrix.cups }}"
118+ sh ci/ci-setup.sh pdfio
119+ sh ci/ci-setup.sh libcupsfilters "${{ matrix.cups }}"
120+ sh ci/ci-setup.sh build-libppd
206121 make test-autopkgtest V=1
207122
208- # -----------------------------------------------------------------------
209- # ARTIFACT UPLOAD (all four legs, only on failure)
210- # -----------------------------------------------------------------------
211- - name : Upload test logs on failure
212- if : failure()
123+ - name : Upload test artifacts (Emulated)
124+ if : matrix.use-qemu == true && always()
125+ continue-on-error : true
126+ timeout-minutes : 5
213127 uses : actions/upload-artifact@v4
214128 with :
215- name : libppd-test- logs-${{ matrix.arch }}
129+ name : libppd-logs-${{ matrix.arch }}-${{ matrix.cups }}
216130 path : |
131+ config.log
217132 test-suite.log
218- **/*.log
219- **/*.trs
220- if-no-files-found : warn
221- retention-days : 14
133+ ppd/*.log
134+ ppd/*.trs
135+ if-no-files-found : ignore
0 commit comments