-
Notifications
You must be signed in to change notification settings - Fork 1
258 lines (222 loc) · 8.13 KB
/
Copy pathci.yml
File metadata and controls
258 lines (222 loc) · 8.13 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
build-plutobook:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install native dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
git \
pkg-config \
ninja-build \
pipx \
python3-pip \
libcairo2-dev \
libexpat1-dev \
libicu-dev \
libfreetype6-dev \
libfontconfig1-dev \
libharfbuzz-dev
pipx install meson==1.3.2
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Cache PlutoBook install
uses: actions/cache@v4
id: plutobook-cache
with:
path: tmp/plutobook-ci-install
key: plutobook-v0.19.0-${{ runner.os }}-${{ hashFiles('.github/workflows/ci.yml') }}
restore-keys: |
plutobook-v0.19.0-${{ runner.os }}-
- name: Build PlutoBook
if: steps.plutobook-cache.outputs.cache-hit != 'true'
run: |
git clone --depth 1 --branch v0.19.0 https://github.com/plutoprint/plutobook.git tmp/plutobook-ci-src
meson setup tmp/plutobook-ci-build tmp/plutobook-ci-src \
--prefix="$PWD/tmp/plutobook-ci-install" \
--libdir=lib \
--buildtype=release \
-Dcpp_args="['-include', 'memory_resource']" \
--force-fallback-for=harfbuzz \
-Dcurl=disabled \
-Dturbojpeg=disabled \
-Dwebp=disabled \
-Dtools=disabled \
-Dtests=disabled \
-Dexamples=disabled
meson compile -C tmp/plutobook-ci-build
meson install -C tmp/plutobook-ci-build
- uses: actions/upload-artifact@v4
with:
name: plutobook-ci-install
path: tmp/plutobook-ci-install
retention-days: 1
test:
needs: build-plutobook
runs-on: ubuntu-22.04
env:
PAGE_PRINT_PLUTOBOOK_PREFIX: ${{ github.workspace }}/tmp/plutobook-ci-install
PKG_CONFIG_PATH: ${{ github.workspace }}/tmp/plutobook-ci-install/lib/pkgconfig
LD_LIBRARY_PATH: ${{ github.workspace }}/tmp/plutobook-ci-install/lib
strategy:
fail-fast: false
matrix:
ruby:
- "3.2"
- "3.3"
- "3.4"
- "4.0"
steps:
- uses: actions/checkout@v4
- name: Install test dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
poppler-utils
- uses: actions/download-artifact@v4
with:
name: plutobook-ci-install
path: tmp/plutobook-ci-install
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: |
bundle exec rake compile -- \
--with-plutobook-include="$PAGE_PRINT_PLUTOBOOK_PREFIX/include" \
--with-plutobook-lib="$PAGE_PRINT_PLUTOBOOK_PREFIX/lib"
bundle exec rake test
native-sanitizers:
runs-on: ubuntu-22.04
env:
PAGE_PRINT_PLUTOBOOK_PREFIX: ${{ github.workspace }}/tmp/plutobook-sanitizer-install
PKG_CONFIG_PATH: ${{ github.workspace }}/tmp/plutobook-sanitizer-install/lib/pkgconfig
LD_LIBRARY_PATH: ${{ github.workspace }}/tmp/plutobook-sanitizer-install/lib
ASAN_OPTIONS: detect_leaks=0:halt_on_error=1:use_sigaltstack=0
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1
PAGE_PRINT_CONCURRENCY_ITERATIONS: 10
steps:
- uses: actions/checkout@v4
- name: Install native dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
git \
pkg-config \
ninja-build \
pipx \
python3-pip \
libcairo2-dev \
libexpat1-dev \
libicu-dev \
libfreetype6-dev \
libfontconfig1-dev \
libharfbuzz-dev
pipx install meson==1.3.2
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Build PlutoBook with sanitizers
run: |
git clone --depth 1 --branch v0.19.0 https://github.com/plutoprint/plutobook.git tmp/plutobook-sanitizer-src
meson setup tmp/plutobook-sanitizer-build tmp/plutobook-sanitizer-src \
--prefix="$PAGE_PRINT_PLUTOBOOK_PREFIX" \
--libdir=lib \
--buildtype=debugoptimized \
-Db_sanitize=address,undefined \
-Dcpp_args="['-include', 'memory_resource']" \
--force-fallback-for=harfbuzz \
-Dcurl=disabled \
-Dturbojpeg=disabled \
-Dwebp=disabled \
-Dtools=disabled \
-Dtests=disabled \
-Dexamples=disabled
meson compile -C tmp/plutobook-sanitizer-build
meson install -C tmp/plutobook-sanitizer-build
- name: Compile extension and run tests with sanitizers
env:
CFLAGS: -fsanitize=address,undefined -fno-omit-frame-pointer
LDFLAGS: -fsanitize=address,undefined
run: |
export LD_PRELOAD="$(gcc -print-file-name=libasan.so)"
bundle exec rake compile -- \
--with-plutobook-include="$PAGE_PRINT_PLUTOBOOK_PREFIX/include" \
--with-plutobook-lib="$PAGE_PRINT_PLUTOBOOK_PREFIX/lib"
bundle exec rake test
build-plutobook-macos:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install native dependencies
run: |
brew update
brew install meson ninja pkg-config cairo freetype harfbuzz fontconfig expat icu4c
- name: Configure Homebrew pkg-config paths
run: echo "PKG_CONFIG_PATH=$(brew --prefix icu4c)/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV"
- name: Cache PlutoBook install
uses: actions/cache@v4
id: plutobook-cache-macos
with:
path: tmp/plutobook-ci-install
key: plutobook-v0.19.0-${{ runner.os }}-${{ hashFiles('.github/workflows/ci.yml') }}
restore-keys: |
plutobook-v0.19.0-${{ runner.os }}-
- name: Build PlutoBook
if: steps.plutobook-cache-macos.outputs.cache-hit != 'true'
run: |
git clone --depth 1 --branch v0.19.0 https://github.com/plutoprint/plutobook.git tmp/plutobook-ci-src
meson setup tmp/plutobook-ci-build tmp/plutobook-ci-src \
--prefix="$PWD/tmp/plutobook-ci-install" \
--libdir=lib \
--buildtype=release \
-Dcurl=disabled \
-Dturbojpeg=disabled \
-Dwebp=disabled \
-Dtools=disabled \
-Dtests=disabled \
-Dexamples=disabled
meson compile -C tmp/plutobook-ci-build
meson install -C tmp/plutobook-ci-build
- uses: actions/upload-artifact@v4
with:
name: plutobook-ci-install-macos
path: tmp/plutobook-ci-install
retention-days: 1
test-macos:
needs: build-plutobook-macos
runs-on: macos-14
env:
PAGE_PRINT_PLUTOBOOK_PREFIX: ${{ github.workspace }}/tmp/plutobook-ci-install
PKG_CONFIG_PATH: ${{ github.workspace }}/tmp/plutobook-ci-install/lib/pkgconfig
DYLD_LIBRARY_PATH: ${{ github.workspace }}/tmp/plutobook-ci-install/lib
steps:
- uses: actions/checkout@v4
- name: Install test dependencies
run: brew install poppler
- uses: actions/download-artifact@v4
with:
name: plutobook-ci-install-macos
path: tmp/plutobook-ci-install
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Run tests
run: |
bundle exec rake compile -- \
--with-plutobook-include="$PAGE_PRINT_PLUTOBOOK_PREFIX/include" \
--with-plutobook-lib="$PAGE_PRINT_PLUTOBOOK_PREFIX/lib"
bundle exec rake test