CI #557
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-License-Identifier: FSFAP | |
# Copyright (C) 2022-2023 Colin B. Macdonald | |
# Copyright (C) 2022 Chris Gorman | |
# Copyright (C) 2022 Alex Vong | |
# | |
# 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.2.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 | |
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.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 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.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 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" |