Skip to content

CI

CI #595

Workflow file for this run

# SPDX-License-Identifier: FSFAP
# Copyright (C) 2022-2023 Colin B. Macdonald
# Copyright (C) 2022 Chris Gorman
# Copyright (C) 2022 Alex Vong
# Copyright (C) 2023 Markus Mützel
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
#
# Github Actions configuration for Octave's Symbolic package.
name: CI
on:
push:
pull_request:
schedule:
- cron: '17 0 * * 0'
jobs:
# Just some misc stuff, minimal testing, diagnostics etc
try_stuff:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Run a one-line script
run: echo Hello, world!
- name: Run a multi-line script
run: |
echo Hello world
uname -a
docker pull docker.io/gnuoctave/octave:6.4.0
# sudo apt-get install --no-install-recommends -y octave
# octave --version
ls
cd inst
ls
docker run --rm -v $PWD:/workdir:rw gnuoctave/octave:6.4.0 octave-cli --eval 'pwd; ls; disp(42); help sympref'
docker run --rm -v $PWD:/workdir:rw gnuoctave/octave:6.4.0 octave-cli --eval "sympref diagnose"
docker run --rm -v $PWD:/workdir:rw gnuoctave/octave:6.4.0 octave-cli --eval "x=sym('x'); y=sin(x/17); disp(y)"
echo "Try a test"
docker run --rm -v $PWD:/workdir:rw gnuoctave/octave:6.4.0 octave-cli --eval "x=sym('x'); test @sym/qr"
# Built-in Self Tests and Doctests for various supported Octave and SymPy
# Test newest Octave and all supported SymPy
# Test other supported Octave releases with latest available SymPy
# Note that 1.10.1 not supported on Python 3.6 (Ubuntu 18.04-based systems)
bist_doc:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
octave: [8.3.0]
sympy: [1.4, 1.5.1, 1.6.2, 1.7.1, 1.8, 1.9, 1.10.1, 1.11.1, 1.12]
include:
- octave: 5.1.0
sympy: 1.8
- octave: 5.2.0
sympy: 1.8
- octave: 6.1.0
sympy: 1.12
- octave: 6.2.0
sympy: 1.12
- octave: 6.3.0
sympy: 1.12
- octave: 6.4.0
sympy: 1.12
- octave: 7.1.0
sympy: 1.12
- octave: 7.2.0
sympy: 1.12
- octave: 7.3.0
sympy: 1.12
- octave: 8.1.0
sympy: 1.12
- octave: 8.2.0
sympy: 1.12
steps:
- uses: actions/checkout@v3
- name: Container setup
env:
OCT: ${{ matrix.octave }}
SYMPY: ${{ matrix.sympy }}
run: |
uname -a
docker pull docker.io/gnuoctave/octave:$OCT
docker run --name=oc --detach --init \
--volume=$PWD:/workdir/octsympy:rw \
gnuoctave/octave:$OCT sleep inf
# FIXME: workaround "fatal: unsafe repository" error
# For more details, see https://stackoverflow.com/q/71901632
# and https://github.com/actions/checkout/issues/760
docker exec oc git config --global --add safe.directory /workdir/octsympy
docker exec oc pip3 install packaging
docker exec oc pip3 install sympy==$SYMPY
docker exec oc octave-cli --eval "pkg install -forge doctest"
- name: Run BIST in-place
run: docker exec oc make -C octsympy test
- name: Run doctests in-place
run: docker exec oc make -C octsympy doctest
- name: Make package, then install-load-unload-uninstall
run: |
docker exec oc make -C octsympy install
docker exec oc octave --eval "pkg load symbolic; sympref diagnose; syms x; clear all; pkg unload symbolic; pkg uninstall symbolic"
- name: Stop container
run: |
docker stop oc
docker rm oc
# Built-in Self Tests and Doctests using the Pythonic interface
# Currently, we only test with newer Octave and SymPy since the support for
# the Pythonic interface is experimental. We may change this in the future.
pythonic-bist-doctest:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
octave: [8.3.0]
sympy: [1.12]
steps:
- uses: actions/checkout@v3
- name: Container setup
env:
OCT: ${{ matrix.octave }}
SYMPY: ${{ matrix.sympy }}
run: |
uname -a
docker pull docker.io/gnuoctave/octave:"$OCT"
docker run --name=oc --detach --init \
--volume="$PWD":/workdir/octsympy:rw \
gnuoctave/octave:"$OCT" sleep inf
# FIXME: workaround "fatal: unsafe repository" error
# For more details, see https://stackoverflow.com/q/71901632
# and https://github.com/actions/checkout/issues/760
docker exec oc git config --global --add safe.directory /workdir/octsympy
docker exec oc apt-get update
docker exec oc apt-get install --no-install-recommends -y libpython3-dev
docker exec oc pip3 install packaging
docker exec oc pip3 install sympy=="$SYMPY"
docker exec oc octave-cli --eval "pkg install -forge doctest"
docker exec oc octave-cli --eval "pkg install -forge pythonic"
- name: Run BIST
run: |
docker exec oc make -C /workdir/octsympy install
docker exec oc octave-cli --eval "pkg list"
docker exec oc octave-cli \
--eval "pkg load pythonic; pkg load symbolic; sympref diagnose; pkg unload symbolic"
docker exec oc octave-cli \
--eval "pkg load pythonic; pkg load symbolic; \
r = octsympy_tests; if r, type ('fntests.log') end; exit (r)"
- name: Run Doctests
run: |
docker exec oc octave-cli \
--eval "pkg load doctest; pkg load pythonic; pkg load symbolic; \
sym ('x'); success = doctest ('octsympy/inst/'); exit (!success)"
- name: Stop container
run: |
docker stop oc
docker rm oc
# Built-in Self Tests and Doctests using the Pythonic main branch
pythonic-dev-bist-doctest:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
octave: [8.3.0]
sympy: [1.12]
steps:
- uses: actions/checkout@v3
- name: Container setup
env:
OCT: ${{ matrix.octave }}
SYMPY: ${{ matrix.sympy }}
run: |
uname -a
docker pull docker.io/gnuoctave/octave:"$OCT"
docker run --name=oc --detach --init \
--volume="$PWD":/workdir/octsympy:rw \
gnuoctave/octave:"$OCT" sleep inf
# FIXME: workaround "fatal: unsafe repository" error
# For more details, see https://stackoverflow.com/q/71901632
# and https://github.com/actions/checkout/issues/760
docker exec oc git config --global --add safe.directory /workdir/octsympy
docker exec oc apt-get update
docker exec oc apt-get install --no-install-recommends -y libpython3-dev
docker exec oc pip3 install packaging
docker exec oc pip3 install sympy=="$SYMPY"
docker exec oc octave-cli --eval "pkg install -forge doctest"
docker exec oc octave-cli --eval \
"pkg install https://gitlab.com/gnu-octave/octave-pythonic/-/archive/main/octave-pythonic-main.tar.gz"
- name: Run BIST
run: |
docker exec oc make -C /workdir/octsympy install
docker exec oc octave-cli --eval "pkg list"
docker exec oc octave-cli \
--eval "pkg load pythonic; pkg load symbolic; sympref diagnose; pkg unload symbolic"
docker exec oc octave-cli \
--eval "pkg load pythonic; pkg load symbolic; \
r = octsympy_tests; if r, type ('fntests.log') end; exit (r)"
- name: Run Doctests
run: |
docker exec oc octave-cli \
--eval "pkg load doctest; pkg load pythonic; pkg load symbolic; \
sym ('x'); success = doctest ('octsympy/inst/'); exit (!success)"
- name: Stop container
run: |
docker stop oc
docker rm oc
ubuntu2204_ootb:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install Octave, Python and SymPy
run: |
uname -a
sudo apt-get update
sudo apt-get install --no-install-recommends -y octave python3
octave --version
python3 --version
sudo apt-get install --no-install-recommends -y python3-sympy
python3 -c "import sympy; print(sympy.__version__)"
- name: Install package, verify
run: |
pwd
make install
octave --eval "pkg load symbolic; sympref diagnose; pkg unload symbolic"
- name: Load package, run tests
run: |
octave --eval "pkg test symbolic"
- name: uninstall package
run: |
octave --eval "pkg uninstall symbolic; pkg list"
ubuntu2204_pip_sympy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install Octave and Python
run: |
uname -a
sudo apt-get update
sudo apt-get install --no-install-recommends -y octave python3 python3-pip
octave --version
python3 --version
pip3 --version
- name: Install SymPy from pip
run: |
pip3 install sympy
python3 -c "import sympy; print(sympy.__version__)"
- name: Install package, verify
run: |
pwd
make install
octave --eval "pkg load symbolic; sympref diagnose; pkg unload symbolic"
- name: Load package, run tests
run: |
octave --eval "pkg test symbolic"
- name: Build HTML documentation
run: |
octave --eval "pkg install -forge generate_html"
make html
octave --eval "pkg uninstall generate_html; pkg list"
- name: uninstall package
run: |
octave --eval "pkg uninstall symbolic; pkg list"
windows_msys2_mingw:
runs-on: windows-latest
name: mingw-w64 ${{ matrix.msystem }}
defaults:
run:
# Use MSYS2 as default shell
shell: msys2 {0}
strategy:
# Allow other runners in the matrix to continue if some fail
fail-fast: false
matrix:
msystem: [MINGW64, UCRT64]
include:
- msystem: MINGW64
target-prefix: mingw-w64-x86_64
- msystem: UCRT64
target-prefix: mingw-w64-ucrt-x86_64
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install packages from MSYS2
uses: msys2/setup-msys2@v2
with:
update: true
release: false
install: >-
base-devel
git
${{ matrix.target-prefix }}-autotools
${{ matrix.target-prefix }}-cc
${{ matrix.target-prefix }}-fltk
${{ matrix.target-prefix }}-octave
${{ matrix.target-prefix }}-python
${{ matrix.target-prefix }}-python-sympy
msystem: ${{ matrix.msystem }}
- name: Show package versions
run: |
uname -a
octave --version
python --version
python -c "import sympy; print(sympy.__version__)"
- name: Install package, verify
id: install-package
run: |
pwd
make install
octave --eval "pkg load symbolic; sympref diagnose; pkg unload symbolic"
- name: Load package, run tests
id: test-package
# For some reason, Octave distributed by MSYS2 crashes on the GitHub
# runner when trying to plot with qt. `--no-gui-libs` avoids that crash
# during the test for `@sym/ezplot.m`.
# For some reason, Octave exits with error 127 after the test suite.
# This is reproducible locally and not limited to the GitHub runner.
# Ignore that error for now.
run: |
( octave --no-gui-libs --eval "pkg test symbolic" | tee ./test-suite.log ) || true
echo Checking test results...
[ -n "$(grep -e "FAIL\s*0" ./test-suite.log)" ] || \
( echo "::error::At least one test failed" && exit 1 )
[ -z "$(grep -e "REGRESSION" ./test-suite.log)" ] || \
( echo "::error::At least one regression in test suite" && exit 1 )
echo Test suite completed successfully
- name: Display test log
if: always() && (steps.test-package.outcome != 'skipped')
run: cat ./fntests.log
- name: Uninstall package
if: always() && (steps.install-package.outcome == 'success')
run: |
octave --eval "pkg uninstall symbolic; pkg list"