-
Notifications
You must be signed in to change notification settings - Fork 2
249 lines (229 loc) · 9.11 KB
/
check.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
name: "freshly brewed Octave"
on:
# push:
workflow_dispatch:
schedule:
# Run job every day at 22:30 UTC
- cron: '30 22 * * *'
jobs:
check:
name: Windows test suite
runs-on: windows-latest
defaults:
run:
# Use pre-installed MSYS2 as default shell
shell: C:/msys64/usr/bin/bash.exe --login -eo pipefail "{0}"
strategy:
fail-fast: false
matrix:
target: [w64-default, w64, w64-64, w32]
include:
- target: w64-default
file-suffix: default-w64
folder-suffix: w64
mingw-prefix: mingw64
- target: w64
file-suffix: release-w64
folder-suffix: w64
mingw-prefix: mingw64
- target: w64-64
file-suffix: release-w64-64
folder-suffix: w64-64
mingw-prefix: mingw64
- target: w32
file-suffix: release-w32
folder-suffix: w32
mingw-prefix: mingw32
env:
MSYSTEM: MSYS
CHERE_INVOKING: 1
steps:
- name: get CPU name
shell: pwsh
run : |
Get-CIMInstance -Class Win32_Processor | Select-Object -Property Name
- name: prepare cache
# Create human readable timestamp
id: cache_timestamp
run: |
echo "timestamp=$(date +"%Y-%m-%d_%H-%M-%S")" >> $GITHUB_OUTPUT
- name: setup cache
id: setup-cache
uses: actions/cache/restore@v3
with:
path: oldid/${{ matrix.target }}
key: oldid:${{ matrix.target }}:${{ steps.cache_timestamp.outputs.timestamp }}:${{ github.sha }}
restore-keys: oldid:${{ matrix.target }}
- name: check build id
id: check-id
env:
TARGET: ${{ matrix.target }}
run: |
BUILDID=$(curl -s "https://buildbot.octave.space/api/v2/builders/octave/builds?state_string__eq=build%20successful&order=-started_at&limit=1" | grep "number" | grep -o "[0-9]*")
echo buildid: "${BUILDID}"
echo "buildid=${BUILDID}" >> $GITHUB_OUTPUT
mkdir -p oldid/${TARGET}
test -f oldid/${TARGET}/id && OLDBUILDID=$(cat oldid/${TARGET}/id)
echo oldbuildid: "${OLDBUILDID}"
echo "oldbuildid=${OLDBUILDID}" >> $GITHUB_OUTPUT
- name: download build
id: download
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid
env:
BUILDID: ${{ steps.check-id.outputs.buildid }}
FILE_SUFFIX: ${{ matrix.file-suffix }}
run: |
curl --insecure --output index.html "https://www.octave.space/data/stable/${BUILDID}/"
FILE7Z=$(grep -r "\-${FILE_SUFFIX}.7z" index.html | grep -o -P -m 1 "octave-[0-9\-]*-${FILE_SUFFIX}.7z" | head -n1 -)
curl --insecure --output octave-${FILE_SUFFIX}.7z "https://www.octave.space/data/stable/${BUILDID}/${FILE7Z}"
echo "file7z=${FILE7Z}" >> $GITHUB_OUTPUT
- name: unpack
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid
shell: cmd
env:
FILE_SUFFIX: ${{ matrix.file-suffix }}
run: 7z.exe x -y octave-%FILE_SUFFIX%.7z
- name: prepare
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid
env:
FILE7Z: ${{ steps.download.outputs.file7z }}
FOLDER_SUFFIX: ${{ matrix.folder-suffix }}
MY_MINGW_PREFIX: ${{ matrix.mingw-prefix }}
run: |
cd $(echo ${FILE7Z} | grep -o -P "octave-[0-9\-]*")${FOLDER_SUFFIX}
./post-install.bat
echo "Use OpenBLAS"
cp ./${MY_MINGW_PREFIX}/bin/libopenblas.dll ./${MY_MINGW_PREFIX}/bin/libblas.dll
# use system OpenGL drivers for 32-bit to avoid crash on printing with llvmpipe
if [ x${{ matrix.target }} = xw32 ]; then \
echo "Use system OpenGL drivers"
mv -f ./${MY_MINGW_PREFIX}/bin/opengl32.dll ./${MY_MINGW_PREFIX}/bin/opengl32.bak
fi
- name: show hg ids
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid
env:
FILE7Z: ${{ steps.download.outputs.file7z }}
FOLDER_SUFFIX: ${{ matrix.folder-suffix }}
run: |
cd $(echo ${FILE7Z} | grep -o -P "octave-[0-9\-]*")${FOLDER_SUFFIX}
echo MXE Octave hg id:
cat HG-ID
echo Octave hg id:
./octave-launch.exe --no-gui --no-init-file --silent --no-history --eval "fprintf ('%s', version ('-hgid'))"
- name: run test suite
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid
env:
FILE7Z: ${{ steps.download.outputs.file7z }}
FOLDER_SUFFIX: ${{ matrix.folder-suffix }}
# Write access to the /tmp folder that MSYS2 uses by default seems to be restricted.
run: |
export TMP="$RUNNER_TEMP"
export TEMP="$RUNNER_TEMP"
export OPENBLAS_NUM_THREADS=2
cd $(echo ${FILE7Z} | grep -o -P "octave-[0-9\-]*")${FOLDER_SUFFIX}
./octave-launch.exe --no-gui --no-init-file --silent --no-history --eval __run_test_suite__ | tee ./test-suite.log
- name: display log
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid
env:
FILE7Z: ${{ steps.download.outputs.file7z }}
FOLDER_SUFFIX: ${{ matrix.folder-suffix }}
run: |
cd $(echo ${FILE7Z} | grep -o -P "octave-[0-9\-]*")${FOLDER_SUFFIX}
cat ./fntests.log
- name: save current build id
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid
env:
BUILDID: ${{ steps.check-id.outputs.buildid }}
TARGET: ${{ matrix.target }}
run: echo $BUILDID > oldid/${TARGET}/id
- name: save cache with build id
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid
uses: actions/cache/save@v3
with:
path: oldid/${{ matrix.target }}
key: oldid:${{ matrix.target }}:${{ steps.cache_timestamp.outputs.timestamp }}:${{ github.sha }}
- name: test packages
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid
env:
FILE7Z: ${{ steps.download.outputs.file7z }}
FOLDER_SUFFIX: ${{ matrix.folder-suffix }}
MY_MINGW_PREFIX: ${{ matrix.mingw-prefix }}
run: |
export TMP="$RUNNER_TEMP"
export TEMP="$RUNNER_TEMP"
export OPENBLAS_NUM_THREADS=2
cd $(echo ${FILE7Z} | grep -o -P "octave-[0-9\-]*")${FOLDER_SUFFIX}
pkgs=("audio"
"biosig"
"cfitsio"
"communications"
"control"
"data-smoothing"
"database"
"dataframe"
"dicom"
"financial"
"fuzzy-logic-toolkit"
"ga"
"general"
"generate_html"
"geometry"
"gsl"
"image"
"instrument-control"
"interval"
"io"
"linear-algebra"
"lssa"
"ltfat"
"mapping"
"matgeom"
"miscellaneous"
"mqtt"
"nan"
"netcdf"
"nurbs"
"ocs"
"octproj"
"optim"
"optiminterp"
"quaternion"
"queueing"
"signal"
"sockets"
"sparsersb"
"splines"
"statistics"
"stk"
"strings"
"struct"
"symbolic"
"tisean"
"tsa"
"video"
"windows"
"zeromq")
for pkg in "${pkgs[@]}"
do
printf " \033[0;32m==>\033[0m Testing package \033[0;32m${pkg}\033[0m\n"
echo "::group::Test package $pkg"
( ./octave-launch.exe --no-gui --no-init-file --silent --no-history --eval "pkg('test','$pkg')" \
|| echo "::error::Octave terminated with error code $? during tests for package $pkg" ) \
| tee ./test-$pkg.log
echo "::endgroup::"
echo "::group::Display log for package $pkg"
cat ./fntests.log
echo "::endgroup::"
[ -n "$(grep -e "FAIL\s*0" ./test-$pkg.log)" ] || echo "::warning::At least one test failed for package $pkg"
[ -z "$(grep -e "REGRESSION" ./test-$pkg.log)" ] || echo "::warning::At least one regression in tests for package $pkg"
echo Finished tests for package $pkg
done
- name: analyze test suite result
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid
env:
FILE7Z: ${{ steps.download.outputs.file7z }}
FOLDER_SUFFIX: ${{ matrix.folder-suffix }}
run: |
cd $(echo ${FILE7Z} | grep -o -P "octave-[0-9\-]*")${FOLDER_SUFFIX}
[ -n "$(grep -e "FAIL\s*0" ./test-suite.log)" ] || exit 1
[ -z "$(grep -e "REGRESSION" ./test-suite.log)" ] || exit 1