Add CI job for compatibility testing #5388
Workflow file for this run
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: Tests | |
on: | |
push: | |
branches: | |
- main | |
- '*_rel' | |
schedule: | |
# run daily at 5:00 am UTC (12 am ET/9 pm PT) | |
- cron: '0 5 * * *' | |
repository_dispatch: | |
# to run this, send a POST API call at repos/IDAES/idaes-pse/dispatches with the specified event_type | |
# e.g. `gh repos/IDAES/idaes-pse/dispatches -F event_type=ci_run_tests` | |
types: [ci_run_tests] | |
workflow_dispatch: | |
inputs: | |
git-ref: | |
description: Git hash (optional) | |
required: false | |
pull_request: | |
types: | |
- opened | |
# ready_for_review occurs when a draft PR is turned to non-draft | |
- ready_for_review | |
# synchronize occurs whenever commits are pushed to the PR branch | |
- synchronize | |
concurrency: | |
# NOTE: the value of `group` should be chosen carefully, | |
# otherwise we might end up over- or under-canceling workflow runs | |
# e.g. if we want to have Codecov results for each commit on `main`, | |
# we should use something `github.sha` instead of `github.ref_name` | |
# to avoid over-canceling runs from `main` | |
# in which case we'd need to access the PR number from somewhere else rather than `github.ref_name` | |
# to avoid under-canceling runs from PRs | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
cancel-in-progress: true | |
env: | |
# default Python version to use for checks that do not require multiple versions | |
DEFAULT_PYTHON_VERSION: '3.8' | |
IDAES_CONDA_ENV_NAME_DEV: idaes-pse-dev | |
PYTEST_ADDOPTS: "--color=yes" | |
defaults: | |
run: | |
# -l: login shell, needed when using Conda run: | |
shell: bash -l {0} | |
jobs: | |
compat: | |
name: Compatibility tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Conda environment | |
uses: conda-incubator/[email protected] | |
with: | |
activate-environment: ${{ env.IDAES_CONDA_ENV_NAME_DEV }} | |
python-version: ${{ env.DEFAULT_PYTHON_VERSION }} | |
- name: Set up idaes | |
uses: ./.github/actions/setup-idaes | |
with: | |
install-target: -r requirements-dev.txt | |
- name: Create empty pytest.ini file | |
run: | | |
echo "" > pytest.ini | |
- name: Install and run compatibility tests | |
run: | | |
pip install "git+https://github.com/IDAES/idaes-compatibility@main" | |
pytest --pyargs idaes_compatibility |