-
Notifications
You must be signed in to change notification settings - Fork 34
133 lines (128 loc) · 4.34 KB
/
teal-integration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: TEAL integration
on:
push:
branches:
- main
- '*_rel'
pull_request:
branches: [ main ]
workflow_dispatch:
defaults:
run:
# important to make sure that all commands on Windows are run using Bash
# -l: login shell, needed when using Conda
shell: bash -l -eo pipefail {0}
env:
PIP_PROGRESS_BAR: "off"
jobs:
raven-basic:
name: RAVEN (py${{ matrix.python-version }}/${{ matrix.os }})
runs-on: ${{ matrix.os-version }}
strategy:
fail-fast: false
matrix:
python-version: ['3.8']
os:
- linux
- win64
include:
- os: linux
os-version: ubuntu-20.04
raven-supported: false
- os: win64
os-version: windows-2019
raven-supported: true
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python package and dependencies
run: |
echo '::group::Output of "pip install" commands'
pip install --upgrade wheel setuptools
pip install -r requirements-teal.txt
echo '::endgroup::'
echo '::group::Display installed packages'
pip list
echo '::endgroup::'
- name: Verify that required RAVEN Python APIs can be imported
if: matrix.raven-supported
run: |
python -c "
from ravenframework.utils import xmlUtils; print(xmlUtils)
from ravenframework import ROMExternal; print(ROMExternal)
"
- name: Download and run RAVEN example(s)
if: matrix.raven-supported
env:
raven_repo_clone_url: https://github.com/idaholab/raven
raven_repo_clone_dir: ../raven-repo-clone
raven_repo_workdir: tests/framework/user_guide/ForwardSamplingStrategies
raven_file_path: forwardSamplingGrid.xml
run: |
git clone "$raven_repo_clone_url" "$raven_repo_clone_dir" && cd "$raven_repo_clone_dir"
git log -n 1
cd "$raven_repo_workdir"
raven_framework "$raven_file_path"
teal:
name: TEAL (py${{ matrix.python-version }}/${{ matrix.os }})
runs-on: ${{ matrix.os-version }}
strategy:
fail-fast: false
matrix:
python-version: ['3.8']
os:
- win64
include:
- os: win64
os-version: windows-2019
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python package and dependencies
run: |
echo '::group::Output of "pip install" commands'
pip install --upgrade wheel setuptools
pip install -r requirements-teal.txt
echo '::endgroup::'
echo '::group::Display installed packages'
pip list
echo '::endgroup::'
echo '::group::Output of pip freeze'
pip freeze
echo '::endgroup::'
- name: Verify that required TEAL Python APIs can be imported
run: |
python -c "
from TEAL.src import CashFlows; print(CashFlows)
from TEAL.src import main; print(main)
from TEAL.src.Amortization import MACRS; print(MACRS)
"
- name: Install IDAES solvers
run: |
echo '::group::Install IDAES solvers'
idaes get-extensions --verbose
echo '::endgroup::'
echo "$(idaes bin-directory)" >> $GITHUB_PATH
- name: Verify that both python and ipopt are available
run: |
which -a python
which -a ipopt
- name: Download and run TEAL example(s)
env:
teal_repo_clone_url: https://github.com/idaholab/TEAL
teal_repo_clone_dir: ../teal-repo-clone
run: |
git clone "$teal_repo_clone_url" "$teal_repo_clone_dir" && cd "$teal_repo_clone_dir"
git log -n 1
python tests/PyomoTest.py
- name: Execute Jupyter notebooks with TEAL integration
env:
PYTEST_ADDOPTS: --color=yes -p no:python --nbcheck=exec --durations=0 --cell-timeout=600
run: |
pytest -k "multiperiod_design_pricetaker_wTEALandSynhist.ipynb"