Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 52 additions & 96 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Multi-Architecture Build and Test Workflow for libcupsfilters
name: Build and Test (Multi-Architecture)
# Multi-Architecture / multi-CUPS Build and Test Workflow for libcupsfilters
#
# Matrix: 4 architectures x 3 CUPS releases = 12 combinations.
# architectures: x86_64, arm64 (native runners); armv7, riscv64 (QEMU)
# CUPS releases: 2.4.x (distro libcups2-dev), 2.5.x (OpenPrinting/cups
# master), 3.x (OpenPrinting/libcups master)
# All the per-combination work lives in ci/ci-setup.sh so the legs differ only
# in which CUPS is provided and whether they run under emulation.
name: Build and Test (Multi-Architecture, Multi-CUPS)

on:
push:
Expand All @@ -10,159 +17,108 @@ on:
- '**'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-matrix:
strategy:
fail-fast: false
matrix:
arch: [x86_64, arm64, armv7, riscv64]
cups: [system-2x, source-2.5.x, source-3.x]
include:
# Native x86_64
- arch: x86_64
runs-on: ubuntu-latest
use-qemu: false

# Native ARM64
- arch: arm64
runs-on: ubuntu-24.04-arm
use-qemu: false

# Emulated 32-bit ARM
- arch: armv7
runs-on: ubuntu-latest
use-qemu: true

# Emulated RISC-V
- arch: riscv64
runs-on: ubuntu-latest
use-qemu: true

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

steps:
- uses: actions/checkout@v4

# ==========================================
# 1. NATIVE EXECUTION (x86_64 and arm64)
# NATIVE EXECUTION (x86_64 and arm64)
# ==========================================
- name: Install Dependencies (Native)
if: matrix.use-qemu == false
run: |
sudo apt-get update --fix-missing -y
sudo apt-get upgrade --fix-missing -y
# PREVENT CONFLICTS: Ensure system version doesn't override local source
sudo apt-get remove -y libcupsfilters-dev || true
sudo apt-get install -y \
libqpdf-dev \
avahi-daemon libavahi-client-dev libssl-dev libpam-dev libusb-1.0-0-dev zlib1g-dev \
autotools-dev autopoint cmake libtool pkg-config libcups2-dev libexif-dev liblcms2-dev \
libfontconfig1-dev libfreetype6-dev build-essential qtbase5-dev qtchooser libcairo2-dev \
libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev \
libopenjp2-7-dev libjpeg-dev libjxl-dev libpoppler-cpp-dev libpython3-dev libdbus-1-dev \
mupdf-tools poppler-utils ghostscript wget tar make gettext \
dbus file

- name: Build PDFio and libcupsfilters (Native)
- name: Build & Test (Native)
if: matrix.use-qemu == false
env:
CC: /usr/bin/gcc
CUPS_KIND: ${{ matrix.cups }}
EMULATED: "0"
run: |
set -ex

# Build pdfio
cd /tmp
wget -q https://github.com/michaelrsweet/pdfio/releases/download/v1.6.4/pdfio-1.6.4.tar.gz
tar -xzf pdfio-1.6.4.tar.gz && cd pdfio-1.6.4
./configure --prefix=/usr --enable-shared
make all
sudo make install
sudo ldconfig

# Build and Test libcupsfilters
cd "$GITHUB_WORKSPACE"
./autogen.sh
./configure
make -j$(nproc)
# V=1 shows compiler commands; VERBOSE=1 restores full internal test details
make check V=1 VERBOSE=1 || (test -f test-suite.log && cat test-suite.log; exit 1)
sh ci/ci-setup.sh deps
sh ci/ci-setup.sh cups "${{ matrix.cups }}"
sh ci/ci-setup.sh pdfio
sh ci/ci-setup.sh build-libcupsfilters

- name: Autopkgtest (DESTDIR staging, native)
# Run the downstream autopkgtest suite (consumer compile/link/run +
# functionality) against every CUPS version under test.
if: matrix.use-qemu == false
run: |
set -ex
cd "$GITHUB_WORKSPACE"
# Full downstream suite: libcupsfilters-2-dev (compile/link/run) +
# libcupsfilters-2-functionality. Both point at the staged tree via
# environment overrides, so no privilege or path redirection is needed.
make test-autopkgtest V=1

- name: Upload test artifacts (Native)
if: matrix.use-qemu == false && always()
continue-on-error: true
timeout-minutes: 5
uses: actions/upload-artifact@v4
with:
name: libcupsfilters-test-artifacts-${{ matrix.arch }}
name: libcupsfilters-logs-${{ matrix.arch }}-${{ matrix.cups }}
path: |
**/*.log
if-no-files-found: warn
config.log
test-suite.log
cupsfilters/*.log
if-no-files-found: ignore

# ==========================================
# 2. EMULATED EXECUTION (armv7 and riscv64)
# EMULATED EXECUTION (armv7 and riscv64)
# ==========================================
- name: Build and Test (Emulated)
- name: Build & Test (Emulated)
if: matrix.use-qemu == true
uses: uraimo/run-on-arch-action@v3
with:
arch: ${{ matrix.arch }}
distro: ubuntu24.04
githubToken: ${{ github.token }}
install: |
apt-get update --fix-missing -y
DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
# PREVENT CONFLICTS: Ensure system version doesn't override local source
apt-get remove -y libcupsfilters-dev || true
apt-get install -y \
libqpdf-dev \
avahi-daemon libavahi-client-dev libssl-dev libpam-dev libusb-1.0-0-dev zlib1g-dev \
autotools-dev autopoint cmake libtool pkg-config libcups2-dev libexif-dev liblcms2-dev \
libfontconfig1-dev libfreetype6-dev build-essential qtbase5-dev qtchooser libcairo2-dev \
libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev \
libopenjp2-7-dev libjpeg-dev libjxl-dev libpoppler-cpp-dev libpython3-dev libdbus-1-dev \
mupdf-tools poppler-utils ghostscript wget tar make gettext gcc g++ \
dbus file
DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata ca-certificates git
run: |
set -ex
REPO_DIR=$(pwd)

# Build pdfio
cd /tmp
wget -q https://github.com/michaelrsweet/pdfio/releases/download/v1.6.4/pdfio-1.6.4.tar.gz
tar -xzf pdfio-1.6.4.tar.gz && cd pdfio-1.6.4
./configure --prefix=/usr --enable-shared
make all
make install
ldconfig

# Build and Test libcupsfilters
cd $REPO_DIR
export CC=/usr/bin/gcc
./autogen.sh
./configure
make -j$(nproc)

# Mark test-pclm-overflow.sh as XFAIL; VERBOSE=1 for full internal logs
make check V=1 VERBOSE=1 XFAIL_TESTS="cupsfilters/test-pclm-overflow.sh" || (test -f test-suite.log && cat test-suite.log; exit 1)

# Full downstream autopkgtest suite. Both tests resolve the staged
# build tree through environment overrides (no absolute paths, no
# privilege, no bind mounts), so the same suite that runs on the
# native legs runs unchanged under QEMU emulation.
export CUPS_KIND="${{ matrix.cups }}"
export EMULATED=1
sh ci/ci-setup.sh deps
sh ci/ci-setup.sh cups "${{ matrix.cups }}"
sh ci/ci-setup.sh pdfio
sh ci/ci-setup.sh build-libcupsfilters
make test-autopkgtest V=1

- name: Upload test artifacts (Emulated)
if: matrix.use-qemu == true && always()
continue-on-error: true
timeout-minutes: 5
uses: actions/upload-artifact@v4
with:
name: libcupsfilters-test-artifacts-${{ matrix.arch }}
name: libcupsfilters-logs-${{ matrix.arch }}-${{ matrix.cups }}
path: |
**/*.log
if-no-files-found: warn

config.log
test-suite.log
cupsfilters/*.log
if-no-files-found: ignore
16 changes: 11 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ testcmyk_SOURCES = \
$(pkgfiltersinclude_DATA)
testcmyk_LDADD = \
libcupsfilters.la \
$(CUPS_LIBS) \
-lm
testcmyk_CFLAGS = \
$(CUPS_CFLAGS)
Expand All @@ -254,6 +255,7 @@ testdither_SOURCES = \
$(pkgfiltersinclude_DATA)
testdither_LDADD = \
libcupsfilters.la \
$(CUPS_LIBS) \
-lm
testdither_CFLAGS = \
$(CUPS_CFLAGS)
Expand All @@ -266,6 +268,7 @@ testimage_LDADD = \
$(LIBPNG_LIBS) \
$(TIFF_LIBS) \
libcupsfilters.la \
$(CUPS_LIBS) \
-lm
testimage_CFLAGS = \
$(LIBJPEG_CFLAGS) \
Expand All @@ -278,6 +281,7 @@ testrgb_SOURCES = \
$(pkgfiltersinclude_DATA)
testrgb_LDADD = \
libcupsfilters.la \
$(CUPS_LIBS) \
-lm
testrgb_CFLAGS = \
$(CUPS_CFLAGS)
Expand All @@ -299,7 +303,8 @@ testpdf1_CFLAGS = \
-I$(srcdir)/cupsfilters/ \
$(CUPS_CFLAGS)
testpdf1_LDADD = \
libcupsfilters.la
libcupsfilters.la \
$(CUPS_LIBS)

testpdf2_SOURCES = \
cupsfilters/testpdf2.c \
Expand All @@ -309,18 +314,19 @@ testpdf2_CFLAGS = \
-I$(srcdir)/cupsfilters/ \
$(CUPS_CFLAGS)
testpdf2_LDADD = \
libcupsfilters.la
libcupsfilters.la \
$(CUPS_LIBS)

test_analyze_SOURCES = cupsfilters/fontembed/test-analyze.c
test_analyze_LDADD = libcupsfilters.la
test_analyze_LDADD = libcupsfilters.la $(CUPS_LIBS)
test_analyze_CFLAGS = $(CUPS_CFLAGS)

test_pdf_SOURCES = cupsfilters/fontembed/test-pdf.c
test_pdf_LDADD = libcupsfilters.la
test_pdf_LDADD = libcupsfilters.la $(CUPS_LIBS)
test_pdf_CFLAGS = $(CUPS_CFLAGS)

test_ps_SOURCES = cupsfilters/fontembed/test-ps.c
test_ps_LDADD = libcupsfilters.la
test_ps_LDADD = libcupsfilters.la $(CUPS_LIBS)
test_ps_CFLAGS = $(CUPS_CFLAGS)

testfilters_SOURCES = \
Expand Down
Loading
Loading