-
Notifications
You must be signed in to change notification settings - Fork 28
199 lines (188 loc) · 6.72 KB
/
Copy pathbuild.yml
File metadata and controls
199 lines (188 loc) · 6.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# =============================================================================
# Multi-Architecture Build & Test Workflow for libppd
#
# Modelled on the QEMU-based CI used in the sister OpenPrinting repositories
# (libcupsfilters, cups-filters). Proves on every push / PR / manual dispatch
# that libppd compiles end-to-end (libppd.la + every check_PROGRAMS binary)
# and that every registered TEST in Makefile.am passes under
# `make check V=1 VERBOSE=1` on FOUR architectures:
#
# * amd64 - native, ubuntu-latest
# * arm64 - native, ubuntu-24.04-arm
# * armhf - emulated via QEMU (armv7)
# * riscv64 - emulated via QEMU
#
# The hermetic C unit tests exercised: testppd, test_ppd_localize,
# test_ppd_cache, test_ppd_ipp, test_ppd_mark, test_ppd_custom,
# test_ppd_attr, test_ppd_page, test_ppd_conflicts.
#
# apt package list derived from libppd's configure.ac:
# PKG_CHECK_MODULES([LIBCUPSFILTERS]) -> libcupsfilters-dev
# PKG_CHECK_MODULES([ZLIB]) -> zlib1g-dev
# AC_PATH_TOOL(CUPSCONFIG) -> libcups2-dev
# AC_CHECK_PROG(gs / pdftops / mutool) -> ghostscript, poppler-utils,
# mupdf-tools
# AM_GNU_GETTEXT([external]) -> gettext, autopoint
# AC_PROG_CC / CXX / LT_INIT / pkg-config -> build-essential, autoconf,
# automake, libtool,
# libtool-bin, pkg-config
# transitive (poppler / qpdf renderers) -> libqpdf-dev, libpoppler-dev,
# libpoppler-cpp-dev
# =============================================================================
name: Build and Test (libppd, multi-arch)
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:
jobs:
build:
name: Build & Test (${{ matrix.arch }})
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
runs-on: ubuntu-latest
use-qemu: false
- arch: arm64
runs-on: ubuntu-24.04-arm
use-qemu: false
- arch: armhf
runs-on: ubuntu-latest
use-qemu: true
qemu-arch: armv7
- arch: riscv64
runs-on: ubuntu-latest
use-qemu: true
qemu-arch: riscv64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Save workspace directory
run: echo "REPO_DIR=$(pwd)" >> $GITHUB_ENV
# -----------------------------------------------------------------------
# NATIVE LEG (amd64 on ubuntu-latest, arm64 on ubuntu-24.04-arm)
# -----------------------------------------------------------------------
- name: Install dependencies (native)
if: matrix.use-qemu == false
run: |
set -ex
sudo apt-get clean
sudo apt-get update --fix-missing -y -o Acquire::Retries=3
# Drop any pre-shipped libppd-dev so our local build wins
sudo apt-get remove -y libppd-dev || true
sudo apt-get install -y --no-install-recommends \
build-essential \
autoconf \
automake \
autopoint \
libtool \
libtool-bin \
pkg-config \
gettext \
git \
wget \
tar \
libcups2-dev \
libcupsfilters-dev \
libqpdf-dev \
libpoppler-dev \
libpoppler-cpp-dev \
zlib1g-dev \
ghostscript \
poppler-utils \
mupdf-tools
- name: Build & test libppd (native)
if: matrix.use-qemu == false
run: |
set -ex
cd "$REPO_DIR"
./autogen.sh
./configure
make -j$(nproc) V=1
make check V=1 VERBOSE=1 || {
echo "==== test-suite.log ===="
test -f test-suite.log && cat test-suite.log
echo "==== per-test logs ===="
for f in $(find . -name '*.log' -not -name 'config.log'); do
echo "---- $f ----"; cat "$f"
done
exit 1
}
# -----------------------------------------------------------------------
# EMULATED LEG (armhf via QEMU armv7, riscv64 via QEMU)
# -----------------------------------------------------------------------
- name: Set up QEMU
if: matrix.use-qemu == true
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.qemu-arch }}
- name: Build & test libppd (emulated)
if: matrix.use-qemu == true
uses: uraimo/run-on-arch-action@v3
with:
arch: ${{ matrix.qemu-arch }}
distro: ubuntu24.04
dockerRunArgs: |
--volume "${{ github.workspace }}:/workspace"
install: |
apt-get clean
apt-get update --fix-missing -y -o Acquire::Retries=3
DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
apt-get remove -y libppd-dev 2>/dev/null || true
apt-get install -y --no-install-recommends \
build-essential \
gcc g++ \
autoconf \
automake \
autopoint \
libtool \
libtool-bin \
pkg-config \
gettext \
git \
wget \
tar \
libcups2-dev \
libcupsfilters-dev \
libqpdf-dev \
libpoppler-dev \
libpoppler-cpp-dev \
zlib1g-dev \
ghostscript \
poppler-utils \
mupdf-tools
run: |
set -ex
cd /workspace
./autogen.sh
./configure
make -j$(nproc) V=1
make check V=1 VERBOSE=1 || {
echo "==== test-suite.log ===="
test -f test-suite.log && cat test-suite.log
echo "==== per-test logs ===="
for f in $(find . -name '*.log' -not -name 'config.log'); do
echo "---- $f ----"; cat "$f"
done
exit 1
}
# -----------------------------------------------------------------------
# ARTIFACT UPLOAD (all four legs, only on failure)
# -----------------------------------------------------------------------
- name: Upload test logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: libppd-test-logs-${{ matrix.arch }}
path: |
test-suite.log
**/*.log
**/*.trs
if-no-files-found: warn
retention-days: 14