Wrap diagnostics #155
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 | |
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-ui-dev | |
PYTEST_ADDOPTS: "--color=yes" | |
defaults: | |
run: | |
# -l: login shell, needed when using Conda run: | |
shell: bash -l {0} | |
jobs: | |
pytest: | |
# description: Run pytest with dev dependencies | |
name: pytest (py${{ matrix.python-version }}/${{ matrix.os }}) | |
runs-on: ${{ matrix.runner-image }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- '3.8' | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
os: | |
- linux | |
- win64 | |
include: | |
- os: linux | |
runner-image: ubuntu-20.04 | |
- os: win64 | |
runner-image: windows-2022 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Conda environment | |
uses: conda-incubator/setup-miniconda@v2.2.0 | |
with: | |
activate-environment: ${{ env.IDAES_CONDA_ENV_NAME_DEV }} | |
python-version: ${{ matrix.python-version }} | |
- name: Install additional dependencies | |
run: pip install idaes-pse | |
- name: Install the code | |
uses: ./.github/actions/install | |
with: | |
install-target: -r requirements-dev.txt | |
- name: Run pytest | |
run: pytest -v -s -m "not integration" | |
cypress: | |
name: cypress (py${{ matrix.python-version }}/${{ matrix.os }}) | |
#setup python environment for python server, install UI | |
runs-on: ${{ matrix.runner-image }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- '3.8' | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
os: | |
- linux | |
- win64 | |
include: | |
- os: linux | |
runner-image: ubuntu-20.04 | |
- os: win64 | |
runner-image: windows-2022 | |
steps: | |
#python starts here | |
- uses: actions/checkout@v3 | |
- name: Set up Conda environment | |
uses: conda-incubator/setup-miniconda@v2.2.0 | |
with: | |
activate-environment: ${{ env.IDAES_CONDA_ENV_NAME_DEV }} | |
python-version: ${{ matrix.python-version }} | |
- name: Install the code | |
uses: ./.github/actions/install | |
with: | |
install-target: -r requirements-dev.txt | |
#cypress starts here | |
- name: Install node packages | |
run: npm install | |
- name: Start UI | |
run: npm run ui & echo "UI Server started" | |
- name: Extract server port | |
run: | | |
echo "Reading port from shared_variable.json" | |
echo 'URL='$(node -pe "require('./shared_variable.json').url") >> $GITHUB_ENV | |
- name: Cypress run | |
uses: cypress-io/github-action@v5 | |
with: | |
wait-on: ${{ env.URL }} | |
wait-on-timeout: 20 | |
command: npm run test | |
browser: chrome |