-
Notifications
You must be signed in to change notification settings - Fork 59
258 lines (234 loc) · 8.06 KB
/
make-alpine.yaml
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: make-alpine
on: [push]
concurrency: ci-alpine-${{ github.ref }}
jobs:
alpine:
runs-on: ubuntu-latest
name: Alpine (x86, musl)
defaults:
run:
# Use emulated shell as default
shell: alpine.sh {0}
env:
LIBGL_ALWAYS_SOFTWARE: "1"
steps:
- name: get CPU information
shell: bash
run: |
cat /proc/cpuinfo
- name: checkout repository
uses: actions/checkout@v4
- name: install dependencies
uses: jirutka/setup-alpine@v1
with:
# For available CPU architectures, see:
# https://github.com/marketplace/actions/setup-alpine-linux-environment
arch: x86
# QScintilla-Qt6 is currently not distributed by Alpine Linux. When
# it is, consider switching to Qt6 packages:
# qt6-qt5compat-dev
# qt6-qttools-dev
# The following packages are only needed to buid and install gl2ps:
# cmake
# wget
# libpng
# sudo
# ARPACK as distributed for Alpine latest-stable seems to be broken:
# arpack-dev
packages: >
build-base
autoconf
automake
m4
git
ccache
coreutils
gfortran
flex
gperf
icoutils
mesa-dri-gallium
libtool
libltdl
rsvg-convert
texlive-dvi
bison
curl-dev
fftw-dev
fltk-dev
fontconfig-dev
freetype-dev
ghostscript-dev
glpk-dev
glu-dev
gnuplot
graphicsmagick-dev
hdf5-dev
lcms2-dev
libsm-dev
libsndfile-dev
openblas-dev
pcre2-dev
perl
portaudio-dev
qhull-dev
qrupdate-dev
qscintilla-dev
qt5-qttools-dev
qscintilla-dev
rapidjson-dev
readline-dev
suitesparse-dev
texinfo
texmf-dist-lang
texmf-dist-latexrecommended
texmf-dist-plaingeneric
xvfb-run
xz-dev
zlib-dev
bzip2
gzip
tar
zip
cmake
wget
libpng
sudo
- name: prepare ccache
# create key with human readable timestamp
# used in action/cache/restore and action/cache/save steps
id: ccache-prepare
run: |
echo "key=ccache:alpine:x86:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT
- name: restore ccache
# setup the github cache used to maintain the ccache from one job to the next
uses: actions/cache/restore@v4
with:
# location of the ccache of the chroot in the root file system
path: /home/runner/rootfs/alpine-latest-x86/home/runner/.ccache
key: ${{ steps.ccache-prepare.outputs.key }}
restore-keys: |
ccache:alpine:x86:${{ github.ref }}
ccache:alpine:x86:refs/heads/default
- name: configure ccache
run: |
test -d ~/.ccache || mkdir ~/.ccache
echo "max_size = 1G" >> ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
ccache --version
ccache -p
ccache -s
echo "/usr/lib/ccache/bin" >> $GITHUB_PATH
- name: build gl2ps
# gl2ps is currently not distributed by Alpine Linux.
# We need it for printing.
run: |
mkdir -p gl2ps && cd gl2ps
printf "::group::\033[0;32m==>\033[0m Download tarball\n"
wget -O gl2ps-1.4.2.tgz https://geuz.org/gl2ps/src/gl2ps-1.4.2.tgz
echo "::endgroup::"
printf "::group::\033[0;32m==>\033[0m Unpack tarball\n"
tar zxvf gl2ps-1.4.2.tgz
echo "::endgroup::"
printf "::group::\033[0;32m==>\033[0m Configure\n"
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ../gl2ps-1.4.2
echo "::endgroup::"
printf "::group::\033[0;32m==>\033[0m Build\n"
cmake --build .
echo "::endgroup::"
printf "::group::\033[0;32m==>\033[0m Install\n"
sudo cmake --install .
echo "::endgroup::"
- name: bootstrap
run: GNULIB_URL=https://github.com/coreutils/gnulib.git ./bootstrap
- name: configure
timeout-minutes: 30
run: |
echo $PATH
echo which ccache
which ccache
which gcc
echo gcc --version
gcc --version
which g++
echo g++ --version
g++ --version
which gfortran
echo gfortran --version
gfortran --version
mkdir .build
echo "::group::Run configure script"
cd .build && ../configure
echo "::endgroup::"
echo "::group::Show config.log"
cat ./config.log
echo "::endgroup::"
- name: build
# Parallel make seems to fail intermittently when creating the figures
# for the manual. The error message says it fails to connect to a
# display. Maybe an xvfb issue?
# Use single job make for now which seems to work more reliably.
run: |
XDG_RUNTIME_DIR=$RUNNER_TEMP xvfb-run -a make -C ./.build all V=1
- name: ccache status
run: ccache -s
- name: save ccache
# Save the cache after we are done (successfully) building
uses: actions/cache/save@v4
with:
path: /home/runner/rootfs/alpine-latest-x86/home/runner/.ccache
key: ${{ steps.ccache-prepare.outputs.key }}
- name: check
timeout-minutes: 60
run: |
XDG_RUNTIME_DIR=$RUNNER_TEMP \
xvfb-run -a make -C ./.build check | tee ./test-suite.log
- name: display test suite log
continue-on-error: true
# Displaying the log shouldn't take long. Cancel the step if it does.
timeout-minutes: 5
run: cat ./.build/test/fntests.log
- name: test history file creation
# see bug #62365
# Pipe to an interactive session to trigger appending the command to
# the history. This will trigger the creation of a history file.
run: |
echo "history_file (make_absolute_filename ('./a/b/c/history')); disp ('test')" | ./.build/run-octave -i
[ -f ./a/b/c/history ] || echo "::warning::Creating history file failed"
- name: install
run: |
sudo make -C ./.build install
- name: test stand-alone executable
run: |
cd examples/code
mkoctfile --link-stand-alone embedded.cc -o embedded
LD_LIBRARY_PATH="/usr/local/lib/octave/$(octave --eval "disp(version())")" ./embedded
- name: test Octave packages
env:
# colon separated list of packages
PACKAGE_NAMES: "control:stk"
run: |
unset CC
unset CXX
IFS=:
for package in "${PACKAGE_NAMES}"; do
printf " \033[0;32m==>\033[0m Octave package \033[0;32m${package}\033[0m\n"
echo "::group::Install ${package}"
octave --eval "pkg install -verbose -forge ${package}"
echo "::endgroup::"
echo "::group::Test ${package}"
octave --eval "pkg test ${package}"
echo "::endgroup::"
echo "::group::Test log for ${package}"
cat ${GITHUB_WORKSPACE}/fntests.log
echo "::endgroup::"
done
- name: analyze test suite results
# Make sure the test summary lists 0 "FAIL"s and no "REGRESSION"
run: |
[ -n "$(grep -e "FAIL\s*0" ./test-suite.log)" ] \
|| echo "::warning::At least one test failed"
[ -z "$(grep -e "REGRESSION" ./test-suite.log)" ] \
|| echo "::warning::At least one regression in test suite"
echo Finished analyzing test suite results.