-
Notifications
You must be signed in to change notification settings - Fork 5
137 lines (127 loc) · 3.9 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
131
132
133
134
135
136
137
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:
PYTEST_ADDOPTS: "--color=yes"
defaults:
run:
# -l: login shell, needed when using Conda run:
shell: bash -l {0}
jobs:
pytest:
# description: Run pytest test suite
name: pytest (${{ matrix.install-variant }}/py${{ matrix.python-version }}/${{ matrix.os }})
runs-on: ${{ matrix.runner-image }}
strategy:
fail-fast: false
matrix:
install-variant:
- standard
- dev
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: IDAES/idaes-ui/.github/actions/install@main
with:
variant: ${{ matrix.install-variant }}
python-version: ${{ matrix.python-version }}
- name: Run pytest
run: pytest -v --pyargs idaes_ui.fv
cypress:
name: cypress (${{ matrix.install-variant }}/py${{ matrix.python-version }}/${{ matrix.os }})
#setup python environment for python server, install UI
runs-on: ${{ matrix.runner-image }}
strategy:
fail-fast: false
matrix:
install-variant:
- standard
- dev
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
- name: Install python code
uses: IDAES/idaes-ui/.github/actions/install@main
with:
variant: ${{ matrix.install-variant }}
python-version: ${{ matrix.python-version }}
#cypress starts here
- name: Check out files needed to run cypress tests
if: matrix.install-variant != 'dev'
uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: |
cypress
package.json
package-lock.json
cypress.config.js
- name: Install node packages
run: npm install
- name: Start UI
run: |
python -m idaes_ui.fv.example &
sleep 30
- name: Cypress run
uses: cypress-io/github-action@v5
with:
wait-on-timeout: 50
command: npm run test
browser: chrome
- name: Upload screenshots
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: cypress-screenshots-${{ matrix.install-variant }}-py${{ matrix.python-version }}-${{ matrix.os }}
path: cypress/screenshots