-
Notifications
You must be signed in to change notification settings - Fork 73
217 lines (189 loc) · 7.42 KB
/
ci.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
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
name: CI
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '17 3 * * 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: "Main Script"
run: |
curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/prepare-and-run-flake8.sh
. ./prepare-and-run-flake8.sh "$(basename $GITHUB_REPOSITORY)" ./test examples proto-tests contrib
pylint:
name: Pylint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Main Script"
run: |
sed 's/python=3/python=3.7/' .test-conda-env-py3.yml > .test-conda-env.yml
USE_CONDA_BUILD=1
curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/prepare-and-run-pylint.sh
. ./prepare-and-run-pylint.sh "$(basename $GITHUB_REPOSITORY)" test/test_*.py
mypy:
name: Mypy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Main Script"
run: |
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
build_py_project_in_conda_env
python -m pip install mypy
./run-mypy.sh
pytest:
name: Conda Pytest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: "Main Script"
run: |
curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project-within-miniconda.sh
# Pytest gripes about ImportPathMismatchError if 'loopy.xyz'
# is importable both from a venv and the subdirectory.
# -AK, 2023-11-01
PROJECT_INSTALL_FLAGS="--editable"
. ./build-and-test-py-project-within-miniconda.sh
pytest_intel:
name: Conda Pytest with Intel CL
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Main Script"
run: |
curl -L -O https://raw.githubusercontent.com/illinois-scicomp/machine-shop-maintenance/main/install-intel-icd.sh
sudo bash ./install-intel-icd.sh
CONDA_ENVIRONMENT=.test-conda-env-py3.yml
echo "- ocl-icd-system" >> "$CONDA_ENVIRONMENT"
sed -i "/pocl/ d" "$CONDA_ENVIRONMENT"
export PYOPENCL_TEST=intel
source /opt/enable-intel-cl.sh
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
# Pytest gripes about ImportPathMismatchError if 'loopy.xyz'
# is importable both from a venv and the subdirectory.
# -AK, 2023-11-01
PROJECT_INSTALL_FLAGS="--editable"
build_py_project_in_conda_env
test_py_project
pytest_no_arg_check:
name: Conda Pytest without arg check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Main Script"
run: |
curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project-within-miniconda.sh
export _LOOPY_SKIP_ARG_CHECKS=1
# Pytest gripes about ImportPathMismatchError if 'loopy.xyz'
# is importable both from a venv and the subdirectory.
# -AK, 2023-11-01
PROJECT_INSTALL_FLAGS="--editable"
. ./build-and-test-py-project-within-miniconda.sh
pytest_twice:
name: Conda Pytest Twice (for cache behavior)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Main Script"
run: |
curl -L -O https://tiker.net/ci-support-v0
# Pytest gripes about ImportPathMismatchError if 'loopy.xyz'
# is importable both from a venv and the subdirectory.
# -AK, 2023-11-01
PROJECT_INSTALL_FLAGS="--editable"
. ./ci-support-v0
build_py_project_in_conda_env
( test_py_project )
( test_py_project )
examples:
name: Conda Examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Main Script"
run: |
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
build_py_project_in_conda_env
rewrite_pyopencl_test
. ./.ci/examples-funcs.sh
install_example_prereqs
run_py_examples
run_ipynb_examples
run_floopy_examples
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
-
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: "Main Script"
run: |
curl -L -O https://tiker.net/ci-support-v0
. ci-support-v0
build_py_project_in_conda_env
build_docs
downstream_tests:
strategy:
matrix:
downstream_project: [arraycontext, meshmode, grudge, pytential, pytato]
fail-fast: false
name: Tests for downstream project ${{ matrix.downstream_project }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Main Script"
env:
DOWNSTREAM_PROJECT: ${{ matrix.downstream_project }}
run: |
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
test_downstream "$DOWNSTREAM_PROJECT"
downstream_firedrake:
name: Tests for downstream project Firedrake
runs-on: ubuntu-latest
container:
image: 'firedrakeproject/firedrake'
steps:
- name: "Main script"
run: |
cd /home/firedrake
export HOME="$(pwd)"
mkdir loopy
cd loopy
git init
git remote add origin "https://github.com/$GITHUB_REPOSITORY.git"
git fetch origin "$GITHUB_REF"
git checkout FETCH_HEAD
git submodule update --init
. /home/firedrake/firedrake/bin/activate
pip install --editable .
pip uninstall -y pytools
pip uninstall -y pymbolic
pip install "git+https://github.com/inducer/pytools.git#egg=pytools"
pip install "git+https://github.com/inducer/pymbolic.git#egg=pymbolic"
cd /home/firedrake/firedrake/src/firedrake
# patch so exception messages get shown
curl -L https://gist.githubusercontent.com/inducer/17d7134ace215f0df1f3627eac4195c7/raw/63edfaf2ec8bf06987896569a4f24264df490e9e/firedrake-debug-patch.diff | patch -p1
pytest --tb=native -rsxw --durations=10 -m 'not parallel' tests/multigrid/
# vim: sw=4