-
Notifications
You must be signed in to change notification settings - Fork 59
282 lines (251 loc) · 10.1 KB
/
make-cygwin.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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
name: make-cygwin
on: [push]
concurrency: ci-cygwin-${{ github.ref }}
jobs:
cygwin:
runs-on: ${{ matrix.os }}
defaults:
run:
# Use Cygwin bash as default shell
shell: C:\cygwin\bin\bash.exe --login -eo pipefail -o igncr '{0}'
strategy:
# Allow other runners in the matrix to continue if some fail
fail-fast: false
matrix:
# For available GitHub-hosted runners, see: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
os: [windows-latest]
env:
CHERE_INVOKING: "1"
CC: gcc
CXX: g++
F77: gfortran
# ccache 3.1 doesn't read configuration files
CCACHE_COMPRESS: "1"
steps:
- name: get CPU name
shell: pwsh
run : |
Get-CIMInstance -Class Win32_Processor | Select-Object -Property Name
- name: checkout repository
# This must be done before installing Cygwin because their git is
# incompatible with this action.
uses: actions/checkout@v4
- name: install Cygwin build environment
uses: cygwin/cygwin-install-action@v4
with:
# The packages are listed in (alphabetically sorted) blocks:
# The first block is for mandatory dependencies.
# The second block is for optional dependencies needed when building from a release tarball.
# The third block is for additional dependencies needed when building from a repository checkout.
# The fourth block is for additional run-time dependencies (to run test suite) that aren't needed to build.
# FIXME: libklu-devel should depend on libbtf-devel. Install it manually even if Octave doesn't explicitly use it.
packages: >-
autoconf
automake
make
gcc-g++
gcc-fortran
bison
dash
flex
gperf
libtool
liblapack-devel
libpcre2-devel
libreadline-devel
ghostscript
gnuplot-base
libamd-devel
libarpack-devel
libbtf-devel
libbz2-devel
libcamd-devel
libccolamd-devel
libcholmod-devel
libcolamd-devel
libcurl-devel
libcxsparse-devel
libfftw3-devel
libfltk-devel
libfontconfig-devel
libfreetype-devel
libGL-devel
libgl2ps-devel
libglpk-devel
libGLU-devel
libgomp1
libGraphicsMagick-devel
libhdf5-devel
libiconv-devel
libklu-devel
libportaudio-devel
libqhull-devel
libqrupdate-devel
libqscintilla2_qt5-devel
libQt5Core-devel
libQt5Gui-devel
libQt5Help-devel
libsndfile-devel
libsuitesparseconfig-devel
libsundials-devel
libspqr-devel
libumfpack-devel
qt5-doc-tools
rapidjson-devel
ccache
git
icoutils
python
rsvg
texinfo
unzip
zip
- name: prepare ccache
# create key with human readable timestamp
# used in action/cache/restore and action/cache/save steps
id: ccache-prepare
run: |
echo "ccachedir=$(cygpath -m ~/.ccache)" >> $GITHUB_OUTPUT
echo "key=ccache:${{ matrix.os }}:cygwin:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT
- name: restore ccache
# Setup a github cache used to maintain the ccache from one run to the next
uses: actions/cache/restore@v4
with:
path: ${{ steps.ccache-prepare.outputs.ccachedir }}
key: ${{ steps.ccache-prepare.outputs.key }}
restore-keys: |
ccache:${{ matrix.os }}:cygwin:${{ github.ref }}
ccache:${{ matrix.os }}:cygwin:refs/heads/default
- name: configure ccache
run: |
# work around issue with ccache calling itself recursively
[ -f /usr/bin/ccache.exe ] && mv /usr/bin/ccache.exe /usr/bin/ccache
which ccache
ccache -V
# ccache 3.1 doesn't read configuration files
# test -d ${{ steps.ccache-prepare.outputs.ccachedir }} || mkdir -p ${{ steps.ccache-prepare.outputs.ccachedir }}
# echo "max_size = 0.9G" > ${{ steps.ccache-prepare.outputs.ccachedir }}/ccache.conf
# echo "compression = true" >> ${{ steps.ccache-prepare.outputs.ccachedir }}/ccache.conf
# limit maximum cache size to avoid exceeding the total disk or cache quota
ccache -M 0.9G
ccache -s
# create ccache symlinks for all compilers
test -d /usr/lib/ccache/bin || mkdir -p /usr/lib/ccache/bin
ln -s /usr/bin/ccache /usr/lib/ccache/bin/${CC}.exe
ln -s /usr/bin/ccache /usr/lib/ccache/bin/${CXX}.exe
ln -s /usr/bin/ccache /usr/lib/ccache/bin/${F77}.exe
# prepend path to ccache symlinks to PATH
echo 'export PATH="/usr/lib/ccache/bin:$PATH"' >> ~/.bash_profile
- name: bootstrap
run: GNULIB_URL=https://github.com/coreutils/gnulib.git ./bootstrap
- name: configure
# FIXME: Fix building with Java support. Override JAVA_HOME for now.
# FIXME: How do we get a working TeX environment in Cygwin? Disable building the documentation for now.
# FIXME: Exporting symbols for instantiated template classes doesn't work currently. Maybe, test again when Cygwin updated to a newer compiler than GCC 11.4.0?
run: |
echo $PATH
which $CC
echo $CC --version
$CC --version
which $CXX
echo $CXX --version
$CXX --version
which $F77
echo $F77 --version
$F77 --version
mkdir .build
echo "::group::Run configure script"
cd .build && ../configure \
--libexecdir=/usr/lib \
--enable-shared \
--disable-java \
--disable-docs \
--disable-lib-visibility-flags \
JAVA_HOME="" \
EGREP="grep -E" \
FLIBS="-lgfortran -lquadmath"
echo "::endgroup::"
echo "::group::Show config.log"
cat ./config.log
echo "::endgroup::"
- name: build
# Spawning processes seems to have a big overhead on this platform. Use a somewhat larger number of parallel processes to compensate for that.
run: |
EGREP="grep -E" make -C ./.build all -j8 V=1
- name: ccache status
continue-on-error: true
run: ccache -s
- name: save ccache
# Save the cache after we are done (successfully) building
uses: actions/cache/save@v4
with:
path: ${{ steps.ccache-prepare.outputs.ccachedir }}
key: ${{ steps.ccache-prepare.outputs.key }}
- name: rebase binaries
run: |
find ${GITHUB_WORKSPACE}/.build -name "*.oct" -or -name "*.dll" | tee binaries.list
rebase -O -T binaries.list
- name: check
# Continuing on error in this step means that jobs will be "green" even
# if the test suite crashes. But if we don't continue, we'll loose the
# ccache.
# It would be nice if we could mark the job as "yellow" (and continue)
# in that case. The second best thing is to display a warning in the
# job summary (see below).
continue-on-error: true
timeout-minutes: 60
# mkoctfile seems to have trouble when gcc is called via ccache. So,
# remove the directory with the ccache wrappers from PATH.
run: |
export PATH=$(echo "$PATH" | sed -e "s|/usr/lib/ccache/bin:||g")
EGREP="grep -E" 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: |
make -C ./.build install
- name: test stand-alone executable
run: |
unset CC
unset CXX
export PATH=$(echo "$PATH" | sed -e "s|/usr/lib/ccache/bin:||g")
cd examples/code
mkoctfile --link-stand-alone embedded.cc -o embedded
./embedded.exe
- name: test Octave packages
env:
# colon separated list of packages
PACKAGE_NAMES: "control:stk"
run: |
unset CC
unset CXX
export PATH=$(echo "$PATH" | sed -e "s|/usr/lib/ccache/bin:||g")
IFS=':' read -r -a packages <<< "${PACKAGE_NAMES}"
for package in "${packages[@]}"; 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.