EGRET GitHub CI #1767
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
name: EGRET GitHub CI | |
on: | |
# Trigger the workflow on push or pull request, | |
# but only for the main branch | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
# nightly tests at 8:00 UTC | |
schedule: | |
- cron: '0 8 * * *' | |
workflow_dispatch: | |
types: run-test | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
build: | |
name: ${{ matrix.os }}, Python ${{ matrix.python-version }}, Pyomo ${{ matrix.pyomo-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# still want the results of other tests even if one fails | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04] | |
python-version: [3.8, 3.9, '3.10', '3.11'] | |
pyomo-version: [6.4.3] | |
include: | |
- os: macos-latest | |
python-version: 3.7 | |
pyomo-version: 6.4.0 | |
- os: windows-latest | |
python-version: 3.7 | |
pyomo-version: 6.4.0 | |
- os: ubuntu-20.04 | |
python-version: 3.7 | |
pyomo-version: 6.4.0 | |
- os: ubuntu-20.04 | |
python-version: '3.11' | |
pyomo-version: main | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: test_env | |
python-version: ${{ matrix.python-version }} | |
auto-activate-base: false | |
- name: Conda Env | |
run: | | |
conda info | |
conda list | |
- name: Install Solvers | |
run: | | |
# download IPOPT & CBC from idaes-ext | |
echo "...downloading solvers" | |
SOLVER_DIR="${GITHUB_WORKSPACE}/cache/solvers" | |
mkdir -p "$SOLVER_DIR" | |
echo "$SOLVER_DIR" >> $GITHUB_PATH | |
DOWNLOAD_DIR="${GITHUB_WORKSPACE}/cache/download" | |
mkdir -p "$DOWNLOAD_DIR" | |
SOLVER_TAR=${DOWNLOAD_DIR}/solvers.tar.gz | |
URL=https://github.com/IDAES/idaes-ext | |
RELEASE=$(curl --max-time 150 --retry 8 \ | |
-L -s -H 'Accept: application/json' ${URL}/releases/latest) | |
VER=$(echo $RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/') | |
URL=${URL}/releases/download/$VER | |
if test "${{matrix.os}}" == ubuntu-20.04; then | |
curl --max-time 150 --retry 8 \ | |
-L $URL/idaes-solvers-ubuntu2004-x86_64.tar.gz \ | |
> $SOLVER_TAR | |
elif test "${{matrix.os}}" == macos-latest; then | |
curl --max-time 150 --retry 8 \ | |
-L $URL/idaes-solvers-darwin-x86_64.tar.gz \ | |
> $SOLVER_TAR | |
else | |
curl --max-time 150 --retry 8 \ | |
-L $URL/idaes-solvers-windows-x86_64.tar.gz \ | |
$URL/idaes-lib-windows-x86_64.tar.gz > $SOLVER_TAR | |
fi | |
cd $SOLVER_DIR | |
tar -xz < $SOLVER_TAR | |
echo "" | |
echo "$SOLVER_DIR" | |
ls -l $SOLVER_DIR | |
- name: Install Parameterized/Pytest | |
run: | | |
pip install parameterized pytest coveralls | |
- name: Install Pyomo | |
run: | | |
pip install git+https://github.com/Pyomo/pyomo.git@${{ matrix.pyomo-version }} | |
- name: Install EGRET | |
run: | | |
pip install -e . | |
- name: Run EGRET Tests | |
run: | | |
pytest -v egret |