Skip to content

Merge PRs #651 + #652: stage2_ef_solver_name and stoch_admm changes #1173

Merge PRs #651 + #652: stage2_ef_solver_name and stoch_admm changes

Merge PRs #651 + #652: stage2_ef_solver_name and stoch_admm changes #1173

name: GitHub CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
env:
COV_ARGS: "--parallel-mode --rcfile=${{ github.workspace }}/.coveragerc --data-file=${{ github.workspace }}/.coverage --source=${{ github.workspace }}/mpisppy"
EX_COV_ARGS: "--parallel-mode --rcfile=${{ github.workspace }}/.coveragerc --data-file=${{ github.workspace }}/.coverage --source=${{ github.workspace }}/mpisppy,${{ github.workspace }}/examples"
jobs:
ruff:
name: Ruff Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
nompi4py:
name: no mpi4py
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme cplex
pip install xpress pandas dill coverage
- name: setup the program
run: |
pip install -e .
- name: PH EF tests
run: |
cd mpisppy/tests
coverage run $COV_ARGS test_ef_ph.py
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-nompi4py
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
regression:
name: Basic regression tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo sphinx sphinx_rtd_theme sphinx-copybutton dill gridx-egret cplex pybind11
pip install xpress coverage
- name: Build pyomo extensions
run: |
# we don't need it all; just APPSI's extensions
pyomo build-extensions || python -c "from pyomo.contrib.appsi.cmodel import cmodel_available; exit(0) if bool(cmodel_available) else exit(1)"
- name: setup the program
run: |
pip install -e .
- name: Test EF/PH
run: |
coverage run $COV_ARGS mpisppy/tests/test_ef_ph.py
- name: Test afew
run: |
PYARGS="-m coverage run $COV_ARGS"
cd examples
coverage run $EX_COV_ARGS afew.py xpress_persistent "" --python-args="$PYARGS"
- name: Test ComponentMap
run: |
coverage run $COV_ARGS -m pytest mpisppy/tests/test_component_map_usage.py
- name: Test nonant name validation
run: |
coverage run $COV_ARGS -m pytest mpisppy/tests/test_nonant_validation.py -v
- name: Test generic_cylinders usage
run: |
coverage run $COV_ARGS -m pytest mpisppy/tests/test_generic_cylinders.py -v
- name: Test docs
run: |
cd ./doc/
make doctest
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-regression
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
runall_persistent_part1:
name: run_all.py persistent solver (part 1)
runs-on: ubuntu-latest
needs: [ruff]
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo sphinx sphinx_rtd_theme dill gridx-egret cplex pybind11
pip install xpress coverage
- name: Build pyomo extensions
run: |
# we don't need it all; just APPSI's extensions
pyomo build-extensions || python -c "from pyomo.contrib.appsi.cmodel import cmodel_available; exit(0) if bool(cmodel_available) else exit(1)"
- name: setup the program
run: |
pip install -e .
- name: Test run_all nouc (first part)
run: |
PYARGS="-m coverage run $COV_ARGS"
cd examples
coverage run $EX_COV_ARGS run_all.py xpress_persistent "" nouc --first-part-only --python-args="$PYARGS"
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-runall-persistent-part1
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
runall_persistent_part2:
name: run_all.py persistent solver (part 2)
runs-on: ubuntu-latest
needs: [ruff]
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo sphinx sphinx_rtd_theme dill gridx-egret cplex pybind11
pip install xpress coverage
- name: Build pyomo extensions
run: |
# we don't need it all; just APPSI's extensions
pyomo build-extensions || python -c "from pyomo.contrib.appsi.cmodel import cmodel_available; exit(0) if bool(cmodel_available) else exit(1)"
- name: setup the program
run: |
pip install -e .
- name: Test run_all nouc (second part)
run: |
PYARGS="-m coverage run $COV_ARGS"
cd examples
coverage run $EX_COV_ARGS run_all.py xpress_persistent "" nouc --second-part-only --python-args="$PYARGS"
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-runall-persistent-part2
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
runall_part1:
name: run_all.py direct solver (part 1)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo sphinx sphinx_rtd_theme dill gridx-egret cplex pybind11
pip install xpress coverage
- name: Build pyomo extensions
run: |
# we don't need it all; just APPSI's extensions
pyomo build-extensions || python -c "from pyomo.contrib.appsi.cmodel import cmodel_available; exit(0) if bool(cmodel_available) else exit(1)"
- name: setup the program
run: |
pip install -e .
- name: Test run_all nouc (first part)
run: |
PYARGS="-m coverage run $COV_ARGS"
cd examples
coverage run $EX_COV_ARGS run_all.py xpress_direct "" nouc --first-part-only --python-args="$PYARGS"
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-runall-direct-part1
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
runall_part2:
name: run_all.py direct solver (part 2)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo sphinx sphinx_rtd_theme dill gridx-egret cplex pybind11
pip install xpress coverage
- name: Build pyomo extensions
run: |
# we don't need it all; just APPSI's extensions
pyomo build-extensions || python -c "from pyomo.contrib.appsi.cmodel import cmodel_available; exit(0) if bool(cmodel_available) else exit(1)"
- name: setup the program
run: |
pip install -e .
- name: Test run_all nouc (second part)
run: |
PYARGS="-m coverage run $COV_ARGS"
cd examples
coverage run $EX_COV_ARGS run_all.py xpress_direct "" nouc --second-part-only --python-args="$PYARGS"
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-runall-direct-part2
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
schur-complement:
name: schur-complement
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v3
- name: setup conda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
channels: anaconda, conda-forge
activate-environment: test_env
- name: Install dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov pybind11 coverage
conda install -y conda-forge::libstdcxx-ng
conda install -y openmpi pymumps --no-update-deps
pip install mpi4py pandas
pip install git+https://github.com/pyutilib/pyutilib.git
git clone https://github.com/pyomo/pyomo.git
cd pyomo/
pip install -e .
pyomo download-extensions
pyomo build-extensions
cd ../
pip install git+https://github.com/parapint/parapint.git
pip install -e .
- name: Test with pytest (serial)
shell: bash -l {0}
run: |
coverage run $COV_ARGS -m pytest -q -vv mpisppy/tests/test_sc.py
- name: Test with pytest under MPI
shell: bash -l {0}
run: |
mpirun -np 3 -oversubscribe coverage run $COV_ARGS -m pytest -q -vv mpisppy/tests/test_sc.py
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-schur-complement
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
straight-tests:
name: straight_tests.py
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo xpress cplex dill matplotlib scipy coverage
- name: setup the program
run: |
pip install -e .
- name: mpi tests
run: |
PYARGS="-m coverage run $COV_ARGS"
cd mpisppy/tests
coverage run $COV_ARGS straight_tests.py --python-args="$PYARGS"
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-straight-tests
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
admm-wrapper:
name: admm wrapper tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo xpress cplex
pip install numpy packaging coverage
- name: setup the program
run: |
pip install -e .
- name: run tests
timeout-minutes: 10
run: |
PYARGS="-m coverage run $COV_ARGS"
cd mpisppy/tests
coverage run $COV_ARGS test_admmWrapper.py --python-args="$PYARGS"
coverage run $COV_ARGS test_stoch_admmWrapper.py --python-args="$PYARGS"
coverage run $COV_ARGS test_admm_bundler.py
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-admm-wrapper
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
aph:
name: aph tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo xpress cplex coverage
- name: setup the program
run: |
pip install -e .
- name: run tests
timeout-minutes: 10
run: |
cd mpisppy/tests
coverage run $COV_ARGS test_aph.py
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-aph
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
ph-main:
name: PH ph_main tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo xpress cplex coverage
- name: setup the program
run: |
pip install -e .
- name: run tests
timeout-minutes: 10
run: |
cd mpisppy/tests
coverage run $COV_ARGS test_ph_main.py
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-ph-main
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
ph-extensions:
name: PH extension tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo xpress cplex coverage
- name: setup the program
run: |
pip install -e .
- name: run tests
timeout-minutes: 10
run: |
cd mpisppy/tests
coverage run $COV_ARGS test_ph_extensions.py
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-ph-extensions
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
pickled-bundles:
name: pickled bundles tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py "numpy" setuptools
pip install pyomo pandas xpress cplex scipy sympy dill PyYAML Pympler networkx pandas packaging coverage
- name: setup the program
run: |
pip install -e .
- name: run pickled bundles tests
timeout-minutes: 10
run: |
PYARGS="-m coverage run $COV_ARGS"
cd mpisppy/tests
coverage run $COV_ARGS test_pickle_bundle.py --python-args="$PYARGS"
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-pickled-bundles
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
pre-pickle-pipeline:
name: pre-pickle preprocessing pipeline tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py "numpy" setuptools
pip install pyomo pandas xpress cplex scipy sympy dill PyYAML Pympler networkx packaging coverage pytest
- name: setup the program
run: |
pip install -e .
- name: run pre-pickle pipeline tests
timeout-minutes: 10
# Run the test file directly via unittest.main rather than via
# pytest, because the --python-args shim used to inject coverage
# into spawned subprocesses must reach the test file's sys.argv.
# pytest would consume / reject --python-args itself.
run: |
PYARGS="-m coverage run $COV_ARGS"
cd mpisppy/tests
coverage run $COV_ARGS test_pre_pickle_pipeline.py --python-args="$PYARGS"
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-pre-pickle-pipeline
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
mps:
name: MPS tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo xpress cplex mip coverage
- name: setup the program
run: |
pip install -e .
- name: run MPS tests
timeout-minutes: 2
run: |
cd mpisppy/tests
coverage run $COV_ARGS test_mps.py
- name: List coverage files (debug)
if: always()
run: ls -la ${{ github.workspace }}/.coverage* || echo "No .coverage files found"
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-mps
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
smps:
name: SMPS tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo xpress cplex mip pytest coverage
- name: setup the program
run: |
pip install -e .
- name: run SMPS tests
timeout-minutes: 2
run: |
cd mpisppy/tests
coverage run $COV_ARGS -m pytest test_smps.py -v
- name: List coverage files (debug)
if: always()
run: ls -la ${{ github.workspace }}/.coverage* || echo "No .coverage files found"
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-smps
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
confidence-intervals:
name: confidence intervals tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py "numpy" setuptools
pip install pyomo pandas xpress cplex scipy sympy dill packaging coverage
- name: setup the program
run: |
pip install -e .
- name: run farmer tests
timeout-minutes: 10
run: |
cd mpisppy/tests
coverage run $COV_ARGS test_conf_int_farmer.py
- name: run aircond tests
timeout-minutes: 10
run: |
cd mpisppy/tests
coverage run $COV_ARGS test_conf_int_aircond.py
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-confidence-intervals
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
test-generic-pyomo-released:
name: generic_tester.py
runs-on: ubuntu-latest
needs: [ruff]
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo sphinx sphinx_rtd_theme dill gridx-egret cplex pybind11 mip coverage
- name: Build pyomo extensions
run: |
# we don't need it all; just APPSI's extensions
pyomo build-extensions || python -c "from pyomo.contrib.appsi.cmodel import cmodel_available; exit(0) if bool(cmodel_available) else exit(1)"
- name: setup the program
run: |
pip install -e .
- name: Test test_generic nouc
run: |
PYARGS="-m coverage run $COV_ARGS"
cd examples
coverage run $EX_COV_ARGS generic_tester.py cplex_direct "" nouc --python-args="$PYARGS"
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-generic-tester
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
test-gradient-rho:
name: gradient and rho tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
channels: conda-forge, defaults
- name: Install dependencies
run: |
conda install -y conda-forge::libstdcxx-ng
conda install -y -c conda-forge openmpi mpi4py "numpy" setuptools cmake
pip install pyomo pandas xpress cplex scipy sympy dill packaging coverage
- name: setup the program
run: |
pip install -e .
- name: run gradient/rho tests
timeout-minutes: 10
run: |
cd mpisppy/tests
coverage run $COV_ARGS test_gradient_rho.py
coverage run $COV_ARGS test_xbar_w_reader_writer.py
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-gradient-rho
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
test-headers:
name: header test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py "numpy" setuptools
pip install pyomo addheader pyyaml pytest
- name: setup the program
run: |
pip install -e .
- name: run headers test
timeout-minutes: 10
run: |
cd mpisppy/tests
pytest test_headers.py
test-pysp:
name: pysp tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools pytest pyyaml networkx
pip install pyomo xpress cplex coverage
- name: setup the program
run: |
pip install -e .
- name: run pysp model tests
timeout-minutes: 10
run: |
cd mpisppy/tests
coverage run $COV_ARGS test_pysp_model.py
- name: run pysp unit tests
timeout-minutes: 10
run: |
cd mpisppy/utils/pysp_model
coverage run $COV_ARGS -m pytest -v .
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-pysp
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
test-cylinders:
name: tests on some cylinders
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py "numpy" setuptools
pip install pyomo pandas xpress cplex scipy packaging coverage
- name: setup the program
run: |
pip install -e .
- name: run tests
timeout-minutes: 10
run: |
cd mpisppy/tests
mpiexec -np 2 coverage run $COV_ARGS -m mpi4py test_with_cylinders.py
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-cylinders
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
test-agnostic:
name: tests on agnostic
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo xpress cplex coverage
pip install numpy packaging
python -m pip install amplpy --upgrade
python -m amplpy.modules install highs cbc gurobi
conda install -c conda-forge openssl
echo "LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH:-}" >> $GITHUB_ENV
python -m pip install gamspy
python -m pip install mip
# license?
- name: setup the program
run: |
pip install -e .
- name: run agnostic tests
timeout-minutes: 10
run: |
cd mpisppy/tests
coverage run $COV_ARGS test_agnostic.py
- name: run agnostic cylinders
timeout-minutes: 10
run: |
cd mpisppy/agnostic/examples
coverage run $COV_ARGS afew_agnostic.py
- name: run loose AMPL
timeout-minutes: 10
run: |
cd examples/loose_agnostic/AMPL
bash farmer_example.bash
# GAMS is not tested because I don't want to deal with the license
#cd ../GAMS
#bash farmer_example.bash
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-agnostic
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
unit-tests:
name: unit tests (no solver required)
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo pytest coverage
- name: setup the program
run: |
pip install -e .
- name: run unit tests
run: |
coverage run $COV_ARGS -m pytest -v \
mpisppy/tests/test_sputils.py \
mpisppy/tests/test_config.py \
mpisppy/tests/test_log.py \
mpisppy/tests/test_scenario_tree.py \
mpisppy/tests/test_nice_join.py \
mpisppy/tests/test_solver_spec.py \
mpisppy/tests/test_extensions.py
- name: Upload coverage data
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-unit-tests
path: ${{ github.workspace }}/.coverage.*
if-no-files-found: ignore
include-hidden-files: true
coverage-report:
name: Coverage Report
runs-on: ubuntu-latest
needs:
- nompi4py
- regression
- runall_persistent_part1
- runall_persistent_part2
- runall_part1
- runall_part2
- schur-complement
- straight-tests
- admm-wrapper
- aph
- ph-main
- ph-extensions
- pickled-bundles
- pre-pickle-pipeline
- mps
- smps
- confidence-intervals
- test-generic-pyomo-released
- test-gradient-rho
- test-pysp
- test-cylinders
- test-agnostic
- unit-tests
if: always()
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
- name: Install coverage
run: pip install coverage
- name: Download all coverage artifacts
uses: actions/download-artifact@v4
with:
pattern: coverage-*
merge-multiple: true
- name: List coverage files
run: ls -la .coverage* || echo "No .coverage files found"
- name: Combine and report
run: |
coverage combine --rcfile=.coveragerc
coverage xml --rcfile=.coveragerc --include='mpisppy/*,examples/*.py' -o coverage.xml
coverage report --rcfile=.coveragerc --include='mpisppy/*,examples/*.py' --show-missing 2>&1 | head -150 || true
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
files: coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}