Skip to content

Commit

Permalink
GitHub-CI: Reduce number of runners on bytecode-interpreter branch.
Browse files Browse the repository at this point in the history
* .github/workflows/make.yaml: This branch follows the default branch very
closely. We don't need to run the same number of different configurations for
coverage. Save on GitHub cache by reducing the number of runners on this branch.
  • Loading branch information
mmuetzel committed Jan 18, 2024
1 parent 8db904b commit 2a59956
Showing 1 changed file with 3 additions and 316 deletions.
319 changes: 3 additions & 316 deletions .github/workflows/make.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
# For available GitHub-hosted runners, see:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
os: [ubuntu-22.04, ubuntu-20.04]
os: [ubuntu-22.04]
compiler: [gcc, clang]
include:
- compiler: gcc
Expand All @@ -30,15 +30,9 @@ jobs:
# "ccache" on Ubuntu 20.04 doesn't compress the cache.
# Clang seems to generally require less cache size (smaller object files?).
- ccache-max: 1.2G
- os: ubuntu-20.04
compiler: gcc
ccache-max: 6G
- os: ubuntu-22.04
compiler: gcc
ccache-max: 1.2G
- os: ubuntu-20.04
compiler: clang
ccache-max: 3G
- os: ubuntu-22.04
compiler: clang
ccache-max: 400M
Expand Down Expand Up @@ -468,7 +462,7 @@ jobs:

matrix:
# For available GitHub-hosted runners, see: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
os: [macos-13, macos-12]
os: [macos-13]
# Most (or all) homebrew packages are compiled with clang and link
# against libc++. So we also use clang to avoid issues with symbols
# that don't match.
Expand All @@ -489,13 +483,6 @@ jobs:
qt-cppflags: "-I/usr/local/opt/qt@6/include/QtCore -I/usr/local/opt/qt@6/include/QtGui -I/usr/local/opt/qt@6/include/QtHelp -I/usr/local/opt/qt@6/include/QtNetwork -I/usr/local/opt/qt@6/include/QtOpenGL -I/usr/local/opt/qt@6/include/QtOpenGLWidgets -I/usr/local/opt/qt@6/include/QtPrintSupport -I/usr/local/opt/qt@6/include/QtSql -I/usr/local/opt/qt@6/include/QtWidgets -I/usr/local/opt/qt@6/include/QtXml -I/usr/local/opt/qt@6/include/QtCore5Compat"
qt-ldflags: "-F/usr/local/opt/qt@6/Frameworks"
qt-libs: "-framework QtCore -framework QtGui -framework QtHelp -framework QtNetwork -framework QtOpenGL -framework QtOpenGLWidgets -framework QtPrintSupport -framework QtSql -framework QtWidgets -framework QtXml -framework QtCore5Compat"
- os: macos-13
qt: "5"
cc: "clang"
cxx: "clang++"
# SUNDIALS >= 6.5.0 doesn't compile with the default flags determined
# by the configure script. Set CXX manually to enable building with it.
cxx-compiler-flags: "-std=gnu++14"

env:
CC: ${{ matrix.cc }}
Expand Down Expand Up @@ -718,7 +705,7 @@ jobs:
matrix:
# For available GitHub-hosted runners, see: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
os: [windows-latest]
msystem: [MINGW64, CLANG64]
msystem: [MINGW64]
include:
- msystem: MINGW64
mingw-prefix: mingw64
Expand All @@ -729,22 +716,6 @@ jobs:
extra-config-flags: ""
ccache-max: 0.9G
allow-error: false
- msystem: CLANG64
mingw-prefix: clang64
target-prefix: mingw-w64-clang-x86_64
cc: clang
# It looks like we and graphicsmagick++ aren't ready for C++17 yet.
cxx: "clang++ -std=gnu++14"
f77: flang
# Clang seems to require a different set of dllexport attributes than GCC.
# autoconf and libtool still need help to correctly invoke flang.
extra-config-flags:
--disable-lib-visibility-flags
ac_cv_f77_compiler_gnu=yes
lt_cv_prog_gnu_ld=yes
ccache-max: 400M
# This configuration is not fully supported yet
allow-error: true

env:
CHERE_INVOKING: 1
Expand Down Expand Up @@ -980,287 +951,3 @@ jobs:
export PATH="/c/octave/pkg/${{ matrix.mingw-prefix }}/bin:$PATH"
mkoctfile --link-stand-alone embedded.cc -o embedded
./embedded.exe
- name: compress build artifact
if: matrix.msystem == 'MINGW64'
continue-on-error: true
run: |
cd /c/octave/pkg
tar -cvzf octave.tar.gz *
- name: upload build artifact
if: matrix.msystem == 'MINGW64'
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target-prefix }}-octave-${{ steps.ccache-prepare.outputs.timestamp }}
path: C:\octave\pkg\octave.tar.gz
retention-days: 7


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@v3

- name: install Cygwin build environment
uses: cygwin/cygwin-install-action@v2
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
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/[email protected]
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.
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
cd .build && ../configure \
--libexecdir=/usr/lib \
--enable-shared \
--disable-java \
--disable-docs \
JAVA_HOME="" \
EGREP="grep -E" \
FLIBS="-lgfortran -lquadmath"
- 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/[email protected]
with:
path: ${{ steps.ccache-prepare.outputs.ccachedir }}
key: ${{ steps.ccache-prepare.outputs.key }}

- 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-tree-evaluator | 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: check with bytecode interpreter
timeout-minutes: 60
run: |
mv ./.build/test/fntests.log ./.build/test/fntests-no-bci.log
export PATH=$(echo "$PATH" | sed -e "s|/usr/lib/ccache/bin:||g")
EGREP="grep -E" make -C ./.build check-bytecode-evaluator | tee ./test-suite-bci.log
- name: display test suite log with bytecode interpreter
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: difference between logs with and without bytecode interpreter
continue-on-error: true
run: |
echo "::group::diff test-suite.log"
echo "diff -urN ./test-suite.log ./test-suite-bci.log"
diff -urN ./test-suite.log ./test-suite-bci.log || true
echo "::endgroup::"
echo "::group::diff fntests.log"
echo "diff -urN ./.build/test/fntests-no-bci.log ./.build/test/fntests.log"
diff -urN ./.build/test/fntests-no-bci.log ./.build/test/fntests.log || true
echo "::endgroup::"
- 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"
[ -n "$(grep -e "FAIL\s*0" ./test-suite-bci.log)" ] || echo "::warning::At least one test failed with bytecode interpreter"
[ -z "$(grep -e "REGRESSION" ./test-suite-bci.log)" ] || echo "::warning::At least one regression in test suite with bytecode interpreter"
echo Finished analyzing test suite results.
- 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: |
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

0 comments on commit 2a59956

Please sign in to comment.