Skip to content

Attempts to solve some problems related to tests in the case of pull requests and simplify branches future updates #466

Attempts to solve some problems related to tests in the case of pull requests and simplify branches future updates

Attempts to solve some problems related to tests in the case of pull requests and simplify branches future updates #466

Workflow file for this run

# Unit tests
on:
push:
branches-ignore:
- codac2_codac4matlab
tags: '' # Restrict to blank tags
pull_request:
branches-ignore:
- codac2_codac4matlab
jobs:
tests:
runs-on: ${{ matrix.cfg.os }}
strategy:
fail-fast: false
matrix:
cfg:
- { os: ubuntu-24.04, gcc_v: 11, py_v_maj: 3, py_v_min: 10, desc: 'Ubuntu 24.04 GCC 11 Python 3.10 tests' }
name: ${{ matrix.cfg.desc }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
clean: false
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.cfg.py_v_maj }}.${{ matrix.cfg.py_v_min }}
- run: |
# Installing gcc
sudo apt install build-essential manpages-dev software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get -q update ; sudo apt-get -y install gcc-${{ matrix.cfg.gcc_v }} g++-${{ matrix.cfg.gcc_v }} || true
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.cfg.gcc_v }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.cfg.gcc_v }}
gcc --version
g++ --version
pip install --upgrade --force-reinstall setuptools
python -c "import sys; print(sys.version)"
pip --version
sudo sh -c 'echo "deb [trusted=yes] https://packages.ensta-bretagne.fr/$(if [ -z "$(. /etc/os-release && echo $UBUNTU_CODENAME)" ]; then echo debian/$(. /etc/os-release && echo $VERSION_CODENAME); else echo ubuntu/$(. /etc/os-release && echo $UBUNTU_CODENAME); fi) ./" > /etc/apt/sources.list.d/ensta-bretagne.list'
sudo apt update
sudo apt-get -y install flex bison libeigen3-dev
# For documentation
pip install sphinx breathe sphinx-issues sphinx-tabs sphinx_rtd_theme
sudo apt-get -y install doxygen graphviz
# For Python wrapping
#pip install wheel
#pip install --upgrade pip
#pip install pyibex
#pip install --upgrade pyibex==1.8.0
pwd
ls
export ORIGIN_DIR=$PWD
cd ..
pwd
ls
cd $ORIGIN_DIR
# IBEX
bash scripts/dependencies/install_ibex.sh
# CAPD
# cancelled on 2023/05/09: bash scripts/dependencies/install_capd.sh
# Environment variables
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$HOME/codac/build_install
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$HOME/ibex-lib/build_install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
#py_version=$(python -c "import sys; print(sys.version[:3])") # default python version
#echo "$py_version"
cd $ORIGIN_DIR
pwd
ls
git submodule init ; git submodule update # for pybind11 submodule
mkdir build -p
cd build
# Building lib + tests
cmake -DCMAKE_INSTALL_PREFIX=$HOME/codac/build_install -DCMAKE_PREFIX_PATH=$HOME/ibex-lib/build_install -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_C_FLAGS="-fPIC" -DWITH_PYTHON=ON -DBUILD_TESTS=ON -DTEST_EXAMPLES=ON ..
make -j 4
#make doc # todo
make install
cd python/python_package
python setup.py develop --user
#pip install -e .
cd ../../
python ../tests/core/domains/codac2_tests_BoolInterval.py
make test
python -m unittest discover codac.tests
## Building the examples
cd ../examples
cd 01_batman/
mkdir build ; cd build ; cmake -DCMAKE_PREFIX_PATH="~/ibex-lib/build_install;~/codac/build_install" -DCMAKE_BUILD_TYPE=Debug .. ; make ; ./codac_example
cd ../../02_centered_form/
mkdir build ; cd build ; cmake -DCMAKE_PREFIX_PATH="~/ibex-lib/build_install;~/codac/build_install" -DCMAKE_BUILD_TYPE=Debug .. ; make ; ./codac_example