-
Notifications
You must be signed in to change notification settings - Fork 19
231 lines (197 loc) · 7.23 KB
/
ci.yaml
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
name: CI
on:
pull_request:
push:
branches: main
schedule:
- cron: '5 0 * * *'
# Cancel in progress CI runs when a new run targeting the same PR or branch/tag is triggered.
# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
flake8:
name: Flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
uses: actions/setup-python@v5
with:
# matches compat target in setup.py
python-version: '3.8'
- name: Flake8 test
run: |
python3 -m venv myenv
source myenv/bin/activate
python -m pip install wheel
python -m pip install flake8 pep8-naming flake8-quotes flake8-bugbear
python -m flake8 --show-source --statistics "$(basename $GITHUB_REPOSITORY)" test examples setup.py doc/conf.py bin/ && echo "Flake8 found no errors."
mypy:
name: Mypy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install
run: |
. .ci-support/install.sh
- name: Run mypy
run: |
MINIFORGE_INSTALL_DIR=.miniforge3
. "$MINIFORGE_INSTALL_DIR/bin/activate" testing
python -m pip install types-psutil types-PyYAML
./run-mypy.sh
pylint:
name: Pylint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install
run: |
. .ci-support/install.sh
- name: Run Pylint
run: |
MINIFORGE_INSTALL_DIR=.miniforge3
. "$MINIFORGE_INSTALL_DIR/bin/activate" testing
./run-pylint.sh
pydocstyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Run Pydocstyle
run: |
python3 -m venv myenv
source myenv/bin/activate
python -m pip install wheel
python -m pip install pydocstyle
python -m pydocstyle "$(basename $GITHUB_REPOSITORY)" && echo "pydocstyle found no errors."
pytest:
name: Pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install
run: |
. .ci-support/install.sh
- name: Run tests
run: |
MINIFORGE_INSTALL_DIR=.miniforge3
. "$MINIFORGE_INSTALL_DIR/bin/activate" testing
cd test
python -m pip install pytest
python -m pytest --durations=0 --tb=native --junitxml=pytest.xml --doctest-modules -rxsw . ../doc/*.rst ../doc/*/*.rst
examples:
name: Examples
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, porter]
steps:
- uses: actions/checkout@v4
- name: Install
run: |
. .ci-support/install.sh
- name: Run examples
run: |
set -x
MINIFORGE_INSTALL_DIR=.miniforge3
. "$MINIFORGE_INSTALL_DIR/bin/activate" testing
export XDG_CACHE_HOME=/tmp
mamba install vtk # needed for the accuracy comparison
# Temporary workaround for https://github.com/conda-forge/openvino-feedstock/pull/73
[[ $(hostname) == "porter" ]] && export PYOPENCL_TEST="port:nv" && unset XDG_CACHE_HOME
# This is only possible because actions run sequentially on porter
[[ $(hostname) == "porter" ]] && rm -rf /tmp/githubrunner/pocl-scratch && rm -rf /tmp/githubrunner/xdg-scratch
scripts/run-integrated-tests.sh --examples
doc:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install
run: |
. .ci-support/install.sh
- name: Build docs
run: |
set -x
MINIFORGE_INSTALL_DIR=.miniforge3
. "$MINIFORGE_INSTALL_DIR/bin/activate" testing
sudo apt-get update
sudo apt-get install texlive-latex-extra latexmk
mamba install sphinx graphviz 'docutils>=0.16'
# Work around "Not enough memory to run on this device." errors in CI:
mamba uninstall pocl
pip install sphinx-math-dollar sphinx-copybutton furo
cd doc
make html SPHINXOPTS="-W --keep-going -n"
make latexpdf SPHINXOPTS="-W --keep-going -n"
emirge:
name: Emirge installation
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Install emirge
run: |
[[ $(uname) == Linux ]] && sudo apt-get update && sudo apt-get install -y openmpi-bin libopenmpi-dev
[[ $(uname) == Darwin ]] && ( brew upgrade || true; brew install mpich )
cd ..
git clone https://github.com/illinois-ceesd/emirge
cd emirge
cp -a ../mirgecom .
./install.sh --skip-clone
- name: Run simple mirgecom test
run: |
cd ..
source emirge/config/activate_env.sh
cd mirgecom/examples
python -m mpi4py ./pulse.py
production:
name: Production testing
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, porter]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Prepare production environment
run: |
set -x
[[ $(uname) == Linux ]] && [[ $(hostname) != "porter" ]] && sudo apt-get update && sudo apt-get install -y openmpi-bin libopenmpi-dev
[[ $(uname) == Darwin ]] && ( brew upgrade || true; brew install mpich )
# This is only possible because actions run sequentially on porter
[[ $(hostname) == "porter" ]] && rm -rf /tmp/githubrunner/pocl-scratch && rm -rf /tmp/githubrunner/xdg-scratch
MIRGEDIR=$(pwd)
cat scripts/production-testing-env.sh
. scripts/production-testing-env.sh
cd ..
date
printf "Removing stale install ..."
rm -rf emirge.prod emirge.y1
printf "done.\n"
date
git clone https://github.com/illinois-ceesd/emirge emirge.prod
cd emirge.prod
. ../mirgecom/scripts/install-mirge-from-source.sh ${MIRGEDIR}/..
- name: Run production test
run: |
source ../config/activate_env.sh
# Temporary workaround for https://github.com/conda-forge/openvino-feedstock/pull/73
scripts/run-integrated-tests.sh --production