-
Notifications
You must be signed in to change notification settings - Fork 0
378 lines (349 loc) · 15.7 KB
/
ci.yml
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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# This is the continuous integration job for `scribbu`. It will run on
# both MacOS & Ubuntu, using various versions of `boost`. I'd also
# like to try installing & building against multple `gcc` versions.
# The intent here is get as many lints & checks as possible out of my
# personal checklist & into automation, being run every night.
# Reference:
#
# - pwd
# - MacOS: /Users/runner/work/scribbu/scribbu
# - Ubuntu: /home/runner/work/scribbu/scribbu
name: Continuous Integration
on:
workflow_dispatch:
push:
pull_request:
types: [opened, edited, reopened] # don't say `synchronize`-- that is taken care of by `push`
schedule:
- cron: '01 02 * * *'
jobs:
build:
name: build
strategy:
matrix:
os: [macos-12, ubuntu-22.04]
# I moved to C++ 20 2024-01-12-- the earliest version of boost that can compile
# under C++ 20 seems to be 1.75. That was released 2020-12-11, over three years
# ago so I'm comfortable calling that "oldest", now. Let's call 1.81 (one year ago)
# "pinned".
boost: [oldest, pinned, latest]
include:
- os: macos-12
boost: oldest
boost-ver: 1_75_0
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.bz2
- os: macos-12
boost: pinned
boost-ver: 1_81_0
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2
- os: macos-12
boost: latest
boost-ver: 1_84_0
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.bz2
- os: ubuntu-22.04
boost: oldest
boost-ver: 1_75_0
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.bz2
- os: ubuntu-22.04
boost: pinned
boost-ver: 1_81_0
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2
- os: ubuntu-22.04
boost: latest
boost-ver: latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Check for TODO-s left in code
shell: bash
run: |
set -x
if find . -not -path '*/.git/*' -not -name 'tbt-lexer.cc' -not -name 'tbt-lexer.hh' '(' -iname '*.hh' -or -iname '*cc' ')' -print0 | xargs -0 -e grep -nE 'TODO|TOOD|\\todo|\\tood'; then
echo "You have TODO-s"
exit 1
fi
- name: Get build number
shell: bash
run: |
set -x
version=`awk '/^AC_INIT/ {print substr($2, 2, length($2)-3)}' configure.ac`
echo "Building scribbu version $version."
echo "SCRIBBU_BUILD_NUMBER=${version}" >> $GITHUB_ENV
- name: Install pre-requisites (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
shell: bash
run: |
set -x
sudo apt-get update
sudo apt-get install -y autoconf automake libtool openssl guile-3.0-dev doxygen flex bison graphviz libunistring-dev texlive tzdata locales
- name: Install pre-requisites (MacOS)
if: matrix.os == 'macos-12'
shell: bash
run: |
set -x
# This seems wrong on multiple levels, but see here:
# <https://github.com/orgs/Homebrew/discussions/4612#discussioncomment-6339258>
set +e
brew cleanup
# Will exit with non-zero status if it finds problems, but can be handy
# for trouble-shooting:
brew doctor
brew update
brew upgrade
brew install autoconf automake libtool openssl doxygen flex bison graphviz texinfo
brew install --cask basictex
type -p guile || brew install guile
set -e
- name: Cache boost (Ubuntu)
# On Ubuntu, we install "latest" directly from the package repositories.
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'latest'
id: cache-boost-ubuntu
uses: actions/cache@v2
with:
path: boost_${{ matrix.boost-ver }}/installdir
key: ${{ runner.os }}-${{ matrix.boost-ver }}
- name: Cache boost (MacOS)
if: matrix.os == 'macos-12'
id: cache-boost-macos
uses: actions/cache@v2
with:
path: boost_${{ matrix.boost-ver }}/installdir
key: ${{ runner.os }}-${{ matrix.boost-ver }}
- name: Install boost (Ubuntu, latest)
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'latest'
run: |
set -x
pwd
sudo apt-get install -y libboost-all-dev
- name: Get boost (Ubuntu, non-latest)
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'latest' && steps.cache-boost-ubuntu.outputs.cache-hit != 'true'
run: |
set -ex
pwd
curl -L -o boost_${{ matrix.boost-ver }}.tar.bz2 ${{ matrix.boost-dl }}
md5sum boost_${{ matrix.boost-ver }}.tar.bz2
tar xf boost_${{ matrix.boost-ver }}.tar.bz2
cd boost_${{ matrix.boost-ver }}
mkdir installdir
# libboost_python fails for boost 1.58.0-- I don't need it, so didn't bother debugging it
./bootstrap.sh --prefix=./installdir --without-libraries=python || cat bootstrap.log
./b2 && ./b2 install
- name: Get boost (MacOS)
if: matrix.os == 'macos-12' && steps.cache-boost-macos.outputs.cache-hit != 'true'
run: |
set -ex
pwd
curl -L -o boost_${{ matrix.boost-ver }}.tar.bz2 ${{ matrix.boost-dl }}
ls -l boost_${{ matrix.boost-ver }}.tar.bz2
md5 boost_${{ matrix.boost-ver }}.tar.bz2
# Apple clang version 14.0.0 (clang-1400.0.29.202)
cc --version
tar xf boost_${{ matrix.boost-ver }}.tar.bz2
mkdir boost_${{ matrix.boost-ver }}/installdir
- name: Build boost (MacOS)
if: matrix.os == 'macos-12' && steps.cache-boost-macos.outputs.cache-hit != 'true'
shell: bash
run: |
pwd
set -x
cd boost_${{ matrix.boost-ver }}
pwd
ls
export CFLAGS="-Wno-error=implicit-function-declaration"
# python failed for boost 1.63; I don't use it, so didn't bother debugging
./bootstrap.sh --prefix=./installdir --without-libraries=python || { cat bootstrap.log; exit 1; }
./b2
./b2 install
- name: Patch boost library dependencies (MacOS)
if: matrix.os == 'macos-12' # && steps.cache-boost-macos.outputs.cache-hit != 'true'
run: |
cd boost_${{ matrix.boost-ver }}/installdir/lib
pwd
ls
echo ================================================
otool -L libboost_log.dylib
otool -L libboost_chrono.dylib
otool -L libboost_thread.dylib
echo ================================================
here=$(pwd)
install_name_tool -change @rpath/libboost_atomic.dylib ${here}/libboost_atomic.dylib libboost_log.dylib
install_name_tool -change @rpath/libboost_chrono.dylib ${here}/libboost_chrono.dylib libboost_log.dylib
install_name_tool -change @rpath/libboost_filesystem.dylib ${here}/libboost_filesystem.dylib libboost_log.dylib
install_name_tool -change @rpath/libboost_thread.dylib ${here}/libboost_thread.dylib libboost_log.dylib
install_name_tool -change @rpath/libboost_date_time.dylib ${here}/libboost_date_time.dylib libboost_log.dylib
install_name_tool -change @rpath/libboost_system.dylib ${here}/libboost_system.dylib libboost_log.dylib
install_name_tool -change @rpath/libboost_regex.dylib ${here}/libboost_regex.dylib libboost_log.dylib
install_name_tool -change @rpath/libboost_system.dylib ${here}/libboost_system.dylib libboost_chrono.dylib
install_name_tool -change @rpath/libboost_system.dylib ${here}/libboost_system.dylib libboost_thread.dylib
echo ================================================
otool -L libboost_log.dylib
otool -L libboost_chrono.dylib
otool -L libboost_thread.dylib
echo ================================================
- name: Configure scribbu (Ubuntu, non-latest)
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'latest'
shell: bash
run: |
autoconf --version
automake --version
set -x
pwd
ls
./bootstrap
./configure --with-boost=$(cd boost_${{ matrix.boost-ver }}/installdir; pwd)
- name: Configure scribbu (Ubuntu, latest)
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'latest'
shell: bash
run: |
autoconf --version
automake --version
set -x
pwd
ls
./bootstrap
./configure
- name: Configure scribbu (MacOS)
if: matrix.os == 'macos-12'
shell: bash
run: |
autoconf --version
automake --version
set -x
pwd
ls
./bootstrap
eval "$(/usr/libexec/path_helper)"
PATH="/usr/local/opt/bison/bin:/usr/local/opt/texinfo/bin:$PATH" ./configure --with-boost=$(cd boost_${{ matrix.boost-ver }}/installdir; pwd) --with-openssl=/usr/local/opt/openssl CPPFLAGS="-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR -I/usr/local/opt/[email protected]/include" LDFLAGS="-L/usr/local/opt/[email protected]/lib"
- name: Make scribbu (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
shell: bash
run: |
set -x
pwd
make -j 4
- name: Make scribbu (MacOS)
if: matrix.os == 'macos-12'
shell: bash
run: |
set -x
pwd
eval "$(/usr/libexec/path_helper)"
PATH="/usr/local/opt/bison/bin:/usr/local/opt/texinfo/bin:$PATH" make -j 4
- name: Patch boost binary dependencies (MacOS)
if: matrix.os == 'macos-12'
shell: bash
run: |
set -x
echo "===================================="
otool -L scribbu/.libs/libscribbu.dylib
echo "===================================="
there=$(cd boost_${{ matrix.boost-ver }}/installdir/lib; pwd)
echo "Changing the load location for boost libs to ${there}."
install_name_tool -change @rpath/libboost_iostreams.dylib ${there}/libboost_iostreams.dylib scribbu/.libs/libscribbu.dylib
install_name_tool -change @rpath/libboost_log.dylib ${there}/libboost_log.dylib scribbu/.libs/libscribbu.dylib
install_name_tool -change @rpath/libboost_program_options.dylib ${there}/libboost_program_options.dylib scribbu/.libs/libscribbu.dylib
install_name_tool -change @rpath/libboost_regex.dylib ${there}/libboost_regex.dylib scribbu/.libs/libscribbu.dylib
install_name_tool -change @rpath/libboost_system.dylib ${there}/libboost_system.dylib scribbu/.libs/libscribbu.dylib
echo "===================================="
otool -L scribbu/.libs/libscribbu.dylib
echo "===================================="
echo "===================================="
otool -L src/.libs/scribbu
echo "===================================="
there=$(cd boost_${{ matrix.boost-ver }}/installdir/lib; pwd)
echo "Changing the load location for boost libs to ${there}."
install_name_tool -change @rpath/libboost_iostreams.dylib ${there}/libboost_iostreams.dylib src/.libs/scribbu
install_name_tool -change @rpath/libboost_log.dylib ${there}/libboost_log.dylib src/.libs/scribbu
install_name_tool -change @rpath/libboost_program_options.dylib ${there}/libboost_program_options.dylib src/.libs/scribbu
install_name_tool -change @rpath/libboost_regex.dylib ${there}/libboost_regex.dylib src/.libs/scribbu
install_name_tool -change @rpath/libboost_system.dylib ${there}/libboost_system.dylib src/.libs/scribbu
there=$(cd scribbu/.libs; pwd)
echo "Changing the load location for scribbu lib to be ${there}."
install_name_tool -change /usr/local/lib/libscribbu.4.dylib ${there}/libscribbu.4.dylib src/.libs/scribbu
echo "===================================="
otool -L src/.libs/scribbu
src/.libs/scribbu --version
echo "===================================="
cd test && make unit
echo "===================================="
otool -L .libs/unit
echo "===================================="
there=$(cd ../boost_${{ matrix.boost-ver }}/installdir/lib; pwd)
echo "Changing the load location for boost libs to ${there}."
install_name_tool -change @rpath/libboost_iostreams.dylib ${there}/libboost_iostreams.dylib .libs/unit
install_name_tool -change @rpath/libboost_log.dylib ${there}/libboost_log.dylib .libs/unit
install_name_tool -change @rpath/libboost_program_options.dylib ${there}/libboost_program_options.dylib .libs/unit
install_name_tool -change @rpath/libboost_regex.dylib ${there}/libboost_regex.dylib .libs/unit
install_name_tool -change @rpath/libboost_system.dylib ${there}/libboost_system.dylib .libs/unit
install_name_tool -change @rpath/libboost_unit_test_framework.dylib ${there}/libboost_unit_test_framework.dylib .libs/unit
there=$(cd ../scribbu/.libs; pwd)
echo "Changing the load location for unit lib to be ${there}."
install_name_tool -change /usr/local/lib/libscribbu.4.dylib ${there}/libscribbu.4.dylib .libs/unit
echo "===================================="
otool -L .libs/unit
.libs/unit --help
- name: Test scribbu (Ubuntu, non-latest)
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'latest'
shell: bash
run: |
set -x
pwd
here=$(pwd)
ldd scribbu/.libs/libscribbu.so
find ${here}/boost_${{ matrix.boost-ver }}/installdir -iname '*.so'
export LD_LIBRARY_PATH="${here}/boost_${{ matrix.boost-ver }}/installdir/lib:$LD_LIBRARY_PATH"
pwd
if ! make check; then
cat test/test-suite.log
exit 1
fi
- name: Test scribbu (Ubuntu, latest)
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'latest'
shell: bash
run: |
set -x
pwd
ldd scribbu/.libs/libscribbu.so
if ! make check; then
cat test/test-suite.log
exit 1
fi
- name: Test scribbu (MacOS)
if: matrix.os == 'macos-12'
shell: bash
run: |
set -x
pwd
if ! make check; then
cat test/test-suite.log
exit 1
fi
- name: Test the Autotools distribution (Ubuntu, non-latest)
# I only make the Autotools distro on Ubuntu, so just test there
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'latest'
shell: bash
run: |
set -x
pwd
ls
here=$(pwd)
version=${{ env.SCRIBBU_BUILD_NUMBER }}
export DISTCHECK_CONFIGURE_FLAGS="--with-boost=$(cd boost_${{ matrix.boost-ver }}/installdir; pwd)"
export LD_LIBRARY_PATH="${here}/boost_${{ matrix.boost-ver }}/installdir/lib:$LD_LIBRARY_PATH"
if ! make -j 4 distcheck; then
cat test/test-suite.log
test -f scribbu-${version}/_build/sub/test/test-suite.log && \
cat scribbu-${version}/_build/sub/test/test-suite.log
exit 1
fi
- name: Test the Autotools distribution (Ubuntu, latest)
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'latest'
shell: bash
run: |
pwd
make -j 4 distcheck
# Given that I had to move heaven & earth to get `make check` to
# work on MacOS, I'm going to hold-off on `make distcheck` until I
# want to really support MacOS, or someone asks for it... or
# something.