Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Fix issue 12 and extend CI tests to additional Python versions/OSes #13

Merged
merged 6 commits into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 41 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,64 @@ name: Run examples

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
examples:
runs-on: ubuntu-18.04
name: Build examples (py${{ matrix.python-version }}/${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
# if fail-fast == true (the default), jobs for the remaining values in the matrix are cancelled
fail-fast: false
matrix:
python-version:
- '3.6'
- '3.7'
os:
- ubuntu-18.04
- windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup Conda env
# `conda activate` does not work properly because env vars are not persisted between steps
# to circumvent this, instead of creating and activating a new Conda env,
# we install the packages in the Conda base environment, which is active by default
# caveat: specify full path to executables in the $CONDA/bin directory
run: |
$CONDA/bin/conda install --quiet --yes --name base python=3.7 pip
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install own dependencies
run: |
echo $PWD
ls -lh .
$CONDA/bin/pip install --progress-bar=off -r requirements.txt
python -m pip install --progress-bar=off -r requirements.txt
- name: Install IDAES
run: |
$CONDA/bin/pip install --progress-bar=off git+https://github.com/idaes/idaes-pse
$CONDA/bin/idaes --version
python -m pip install --progress-bar=off git+https://github.com/idaes/idaes-pse
idaes --version
- name: Install IDAES extensions
run: |
$CONDA/bin/idaes get-extensions --platform ubuntu1804
idaes get-extensions --verbose
# NOTE: these commands are Unix-shell specific
# and will need to be changed if we want to test on CMD.exe/Powershell
find $(idaes data-directory) -ls
# add bin directory to $PATH (only valid for subsequent steps)
echo "$(idaes bin-directory)" >> $GITHUB_PATH
- name: Test access to executables
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
ipopt.exe -v
else
ipopt -v
fi
- name: Run non-integration tests
run: |
$CONDA/bin/pytest --verbose -m "not integration" tests/
pytest --verbose -m "not integration" tests/
- name: Save Sphinx build artifacts
uses: actions/upload-artifact@v2
with:
Expand Down
5 changes: 4 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@


# This is a workaround for a bug in some versions of Tornado on Windows for Python 3.8
if sys.platform == "win32":
# this is the recommended fix for this according to e.g. https://github.com/tornadoweb/tornado#2608
# it should be revisited with python>=3.9 or if a fix is implemented by e.g. Jupyter
# the sys.version_info check includes the micro version, so e.g. 3.8.0 will also evaluate to True
if sys.platform == "win32" and sys.version_info > (3, 8):
import asyncio

asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
Expand Down