comparison .github/workflows/make.yaml @ 29718:504fcc051d51

GitHub-CI: Add workflow for native Windows builds. * .github/workflows/make.yaml (windows): Add rules to run CI tests on Windows.
author Markus Mützel <markus.muetzel@gmx.de>
date Tue, 01 Jun 2021 20:10:34 +0200
parents 3ef50a8d01c5
children 24effbddcbe8
comparison
equal deleted inserted replaced
29717:3e046fba8805 29718:504fcc051d51
257 # in that case. 257 # in that case.
258 # It would also be nice if we could analyze the test suite results 258 # It would also be nice if we could analyze the test suite results
259 # automatically. 259 # automatically.
260 continue-on-error: true 260 continue-on-error: true
261 run: make -C ./.build check V=1 261 run: make -C ./.build check V=1
262
263
264 windows:
265 runs-on: ${{ matrix.os }}
266
267 defaults:
268 run:
269 # Use pre-installed MSYS2 as default shell
270 shell: C:/msys64/usr/bin/bash.exe --login -eo pipefail "{0}"
271
272 strategy:
273 matrix:
274 # For available GitHub-hosted runners, see: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
275 os: [windows-2019]
276 compiler: [gcc]
277 target: [x86_64, i686]
278 include:
279 - compiler: gcc
280 target: x86_64
281 target-triplet: x86_64-w64-mingw32
282 target-prefix: mingw-w64-x86_64
283 msystem: MINGW64
284 mingw-prefix: mingw64
285 cc: x86_64-w64-mingw32-gcc
286 cxx: x86_64-w64-mingw32-g++
287 f77: x86_64-w64-mingw32-gfortran
288 - compiler: gcc
289 target: i686
290 target-triplet: i686-w64-mingw32
291 target-prefix: mingw-w64-i686
292 msystem: MINGW32
293 mingw-prefix: mingw32
294 cc: i686-w64-mingw32-gcc
295 cxx: i686-w64-mingw32-g++
296 f77: i686-w64-mingw32-gfortran
297
298 env:
299 MSYSTEM: ${{ matrix.msystem }}
300 CHERE_INVOKING: 1
301 CC: ${{ matrix.cc }}
302 CXX: ${{ matrix.cxx }}
303 F77: ${{ matrix.f77 }}
304 TARGET_TRIPLET: ${{ matrix.target-triplet }}
305 TARGET_PREFIX: ${{ matrix.target-prefix }}
306 # perl uses cmd shell by default
307 PERL5SHELL: bash -l -c
308
309 steps:
310 - name: install dependencies
311 # The packages are listed in (alphabetically sorted) blocks:
312 # The first block is for mandatory dependencies.
313 # The second block is for optional dependencies needed when building from a release tarball.
314 # The third block is for additional dependencies needed when building from a repository checkout.
315 run: |
316 pacman --noconfirm -S --needed --overwrite * \
317 base-devel ${TARGET_PREFIX}-toolchain ${TARGET_PREFIX}-lapack ${TARGET_PREFIX}-openblas ${TARGET_PREFIX}-pcre \
318 ${TARGET_PREFIX}-arpack ${TARGET_PREFIX}-curl ${TARGET_PREFIX}-cvode ${TARGET_PREFIX}-fftw ${TARGET_PREFIX}-fltk ${TARGET_PREFIX}-gl2ps ${TARGET_PREFIX}-glpk ${TARGET_PREFIX}-ghostscript ${TARGET_PREFIX}-gnuplot ${TARGET_PREFIX}-graphicsmagick ${TARGET_PREFIX}-hdf5 ${TARGET_PREFIX}-libsndfile ${TARGET_PREFIX}-portaudio ${TARGET_PREFIX}-qhull ${TARGET_PREFIX}-qrupdate ${TARGET_PREFIX}-qscintilla ${TARGET_PREFIX}-qt5 ${TARGET_PREFIX}-rapidjson ${TARGET_PREFIX}-suitesparse \
319 git ${TARGET_PREFIX}-ccache ${TARGET_PREFIX}-icoutils ${TARGET_PREFIX}-librsvg texinfo
320
321 - name: checkout repository
322 uses: actions/checkout@v2
323
324 - name: prepare ccache
325 # Create human readable timestamp
326 id: ccache_cache_timestamp
327 run: |
328 echo "::set-output name=TIMESTAMP::$(date +"%Y-%m-%d_%H-%M-%S")"
329
330 - name: setup ccache
331 # Setup the github cache used to maintain the ccache from one job to the next
332 uses: actions/cache@v2
333 with:
334 path: C:/msys64/home/runneradmin/.ccache
335 key: ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ matrix.target }}:${{ github.ref }}:${{ steps.ccache_cache_timestamp.outputs.timestamp }}:${{ github.sha }}
336 restore-keys: |
337 ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ matrix.target }}:${{ github.ref }}
338 ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ matrix.target }}
339
340 - name: configure ccache
341 # Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota.
342 run: |
343 which ccache
344 test -d ~/.ccache || mkdir -p ~/.ccache
345 echo "max_size = 1.2G" > ~/.ccache/ccache.conf
346 echo "compression = true" >> ~/.ccache/ccache.conf
347 ccache -s
348 # create ccache helper script for Fortran compiler
349 echo -e '#!/bin/bash\nccache '$MINGW_PREFIX'/bin/'$F77' "$@"' > $MINGW_PREFIX/lib/ccache/bin/$F77
350 # prepend path to helper scripts to PATH
351 echo 'export PATH="$MINGW_PREFIX/lib/ccache/bin:$PATH"' >> ~/.bash_profile
352
353 - name: bootstrap
354 run: |
355 ./bootstrap
356
357 - name: configure
358 # PortAudio requires linking to libuuid. But its pkg-config file doesn't reference the path to that library.
359 # FIXME: Fix building with Java support. Override JAVA_HOME for now.
360 # FIXME: How do we get a working TeX environment in MSYS2? Disable building the documentation for now.
361 # Linking with ncurses fails. Use termcap library instead.
362 run: |
363 which $CC
364 echo $CC --version
365 $CC --version
366 which $CXX
367 echo $CXX --version
368 $CXX --version
369 which $F77
370 echo $F77 --version
371 $F77 --version
372 mkdir .build
373 cd .build && ../configure \
374 JAVA_HOME="" \
375 --disable-docs \
376 ac_cv_search_tputs=-ltermcap
377
378 - name: build
379 # Spawning processes seems to have a big overhead on this platform. Use a somewhat larger number of parallel processes to compensate for that.
380 # MSYS2's "fltk-config" returns wrong LIBS. Override them for make.
381 # See: https://github.com/msys2/MINGW-packages/issues/8806
382 # MSYS2's "portaudio" doesn't depend on uuid. But its package-config file still contains "-luuid". Override the flags for make.
383 # See: https://github.com/msys2/MINGW-packages/issues/8805
384 run: |
385 make -C ./.build all -j8 V=1 \
386 FLTK_LIBS="-lfltk_gl -lopengl32 -lglu32 -lfltk -lpthread" \
387 PORTAUDIO_LIBS="-lportaudio -ldsound -lsetupapi -lwinmm -lm -lole32"
388
389 - name: ccache status
390 continue-on-error: true
391 run: ccache -s
392
393 - name: install
394 # Install Octave
395 # Create symlinks to the libexec binaries in bin (or they won't find their libraries?)
396 run: |
397 make -C ./.build install V=1
398 ln -sf ${MINGW_PREFIX}/libexec/octave/7.0.0/exec/${TARGET_TRIPLET}/octave-gui.exe ${MINGW_PREFIX}/bin/octave-gui.exe
399 ln -sf ${MINGW_PREFIX}/libexec/octave/7.0.0/exec/${TARGET_TRIPLET}/octave-svgconvert.exe ${MINGW_PREFIX}/bin/octave-svgconvert.exe
400
401 - name: check
402 # Continuing on error in this step means that jobs will be "green" even
403 # if the test suite crashes. But if we don't continue, we'll loose the
404 # ccache and other jobs will be cancelled, too.
405 # It would be nice if we could mark the job as "yellow" (and continue)
406 # in that case.
407 # It would also be nice if we could analyze the test suite results
408 # automatically.
409 continue-on-error: true
410
411 # We cannot run "make check" in the MSYS2 shell because it will fail with backslash as a file separator.
412 # Instead, use the CMD shell and set up the environment to pick up what we just built.
413 shell: cmd
414 env:
415 MSYS_PATH: C:\msys64\${{ matrix.mingw-prefix }}\bin;C:\msys64\usr\bin
416 MSYSTEM: ${{ matrix.msystem }}
417 TERM: cygwin
418 GNUTERM: wxt
419 GS: gs.exe
420
421 # Also, install .bat file for "makeinfo" so that it can be called from that shell.
422 run: |
423 set PATH=%MSYS_PATH%;%PATH%
424 echo @echo off > C:/msys64/usr/bin/makeinfo.bat
425 echo %%~d0 >> C:/msys64/usr/bin/makeinfo.bat
426 echo cd "%%~dp0" >> C:/msys64/usr/bin/makeinfo.bat
427 echo perl "%%~n0" %%* >> C:/msys64/usr/bin/makeinfo.bat
428 rem Start Octave and run test suite
429 octave-gui --eval "__run_test_suite__"
430
431 - name: display test results
432 continue-on-error: true
433 # Displaying the log shouldn't take long. Cancel the step if it does.
434 timeout-minutes: 5
435 run: cat fntests.log