Tests #61
This file contains hidden or 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
| name: Tests | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11.5" | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y liblapack3 libblas3 gfortran | |
| - name: Install latex | |
| run: | | |
| sudo apt-get install -y \ | |
| texlive-latex-base \ | |
| texlive-latex-recommended \ | |
| texlive-latex-extra \ | |
| texlive-fonts-recommended \ | |
| dvipng \ | |
| cm-super | |
| - name: Install test dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install pybind11 setuptools pyomo idaes-pse | |
| pyomo download-extensions | |
| pyomo build-extensions | |
| idaes get-extensions --to $GITHUB_WORKSPACE/.idaes | |
| pushd $GITHUB_WORKSPACE/.idaes | |
| tar -xf idaes-local-ubuntu*-x86_64.tar.gz | |
| popd | |
| tree $GITHUB_WORKSPACE/.idaes | |
| echo "$GITHUB_WORKSPACE/.idaes/bin" >> "$GITHUB_PATH" | |
| export PKG_CONFIG_PATH="$GITHUB_WORKSPACE/.idaes/lib/pkgconfig:$PKG_CONFIG_PATH" | |
| python -m pip install ".[test]" | |
| - name: Run tests | |
| run: | | |
| export PATH="$PATH:$GITHUB_WORKSPACE/.idaes" | |
| ipopt --version | |
| python -m pytest \ | |
| var_elim/algorithms/tests \ | |
| var_elim/heuristics/tests \ | |
| var_elim/mip_formulations/tests | |
| - name: Run structural analysis | |
| run: | | |
| export PATH="$PATH:$GITHUB_WORKSPACE/.idaes" | |
| python reproduce.py structure --smoke --run-dir=. | |
| - name: Run solvetime analysis | |
| run: | | |
| export PATH="$PATH:$GITHUB_WORKSPACE/.idaes" | |
| export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/.idaes/lib" | |
| export PKG_CONFIG_PATH="$GITHUB_WORKSPACE/.idaes/lib/pkgconfig:$PKG_CONFIG_PATH" | |
| pkg-config --libs --cflags ipopt | |
| python reproduce.py solvetime --smoke --run-dir=. | |
| - name: Run convergence analysis | |
| run: | | |
| export PATH="$PATH:$GITHUB_WORKSPACE/.idaes" | |
| export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/.idaes/lib" | |
| export PKG_CONFIG_PATH="$GITHUB_WORKSPACE/.idaes/lib/pkgconfig:$PKG_CONFIG_PATH" | |
| pkg-config --libs --cflags ipopt | |
| python reproduce.py convergence --smoke --run-dir=. |