-
Notifications
You must be signed in to change notification settings - Fork 5
130 lines (124 loc) · 3.96 KB
/
core.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
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