-
Notifications
You must be signed in to change notification settings - Fork 19
213 lines (190 loc) · 6.59 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
name: CI
on:
pull_request:
push:
branches: main
schedule:
- cron: '5 0 * * *'
jobs:
flake8:
name: Flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
-
uses: actions/setup-python@v4
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@v3
-
uses: actions/setup-python@v4
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@v3
-
uses: actions/setup-python@v4
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@v3
-
uses: actions/setup-python@v4
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@v3
- 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 --cov=mirgecom --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@v3
- name: Install
run: |
. .ci-support/install.sh
- name: Test lazy accuracy
run: |
MINIFORGE_INSTALL_DIR=.miniforge3
. "$MINIFORGE_INSTALL_DIR/bin/activate" testing
conda install vtk # needed for the accuracy comparison
export XDG_CACHE_HOME=/tmp
[[ $(hostname) == "porter" ]] && export PYOPENCL_TEST="port:nv" && unset XDG_CACHE_HOME && conda install pocl-cuda
# && export POCL_DEBUG=cuda
scripts/run-integrated-tests.sh --lazy-accuracy
- name: Run examples
run: |
MINIFORGE_INSTALL_DIR=.miniforge3
. "$MINIFORGE_INSTALL_DIR/bin/activate" testing
export XDG_CACHE_HOME=/tmp
[[ $(hostname) == "porter" ]] && export PYOPENCL_TEST="port:nv" && unset XDG_CACHE_HOME && conda install pocl-cuda
# && export POCL_DEBUG=cuda
scripts/run-integrated-tests.sh --examples
doc:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install
run: |
. .ci-support/install.sh
- name: Build docs
run: |
MINIFORGE_INSTALL_DIR=.miniforge3
. "$MINIFORGE_INSTALL_DIR/bin/activate" testing
sudo apt-get update
sudo apt-get install texlive-latex-extra latexmk
conda install sphinx graphviz 'docutils>=0.16'
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@v3
- name: Install emirge
run: |
[[ $(uname) == Linux ]] && sudo apt-get update && sudo apt-get install -y openmpi-bin libopenmpi-dev
[[ $(uname) == Darwin ]] && brew upgrade && 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-mpi.py
y1:
name: Production testing
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, porter]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Prepare production environment
run: |
[[ $(uname) == Linux ]] && [[ $(hostname) != "porter" ]] && sudo apt-get update && sudo apt-get install -y openmpi-bin libopenmpi-dev
[[ $(uname) == Darwin ]] && brew upgrade && brew install mpich
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
scripts/run-integrated-tests.sh --production