89
89
path : slycot-wheels
90
90
91
91
92
+ build-conda :
93
+ name : Build conda Py${{ matrix.python }}, ${{ matrix.os }}
94
+ runs-on : ${{ matrix.os }}-latest
95
+ strategy :
96
+ fail-fast : false
97
+ matrix :
98
+ os :
99
+ - ' ubuntu'
100
+ - ' macos'
101
+ - ' windows'
102
+ python :
103
+ - ' 3.9'
104
+ - ' 3.11'
105
+
106
+ steps :
107
+ - name : Checkout Slycot
108
+ uses : actions/checkout@v3
109
+ with :
110
+ repository : python-control/Slycot
111
+ fetch-depth : 0
112
+ submodules : ' recursive'
113
+ - name : Setup Conda
114
+ uses : conda-incubator/setup-miniconda@v2
115
+ with :
116
+ python-version : ${{ matrix.python }}
117
+ activate-environment : build-env
118
+ environment-file : .github/conda-env/build-env.yml
119
+ miniforge-version : latest
120
+ miniforge-variant : Mambaforge
121
+ channel-priority : strict
122
+ auto-update-conda : false
123
+ auto-activate-base : false
124
+ - name : Conda build
125
+ shell : bash -l {0}
126
+ run : |
127
+ set -e
128
+ numpyversion=$(python -c 'import numpy; print(numpy.version.version)')
129
+ conda mambabuild --python "${{ matrix.python }}" --numpy $numpyversion conda-recipe
130
+ # preserve directory structure for custom conda channel
131
+ find "${CONDA_PREFIX}/conda-bld" -maxdepth 2 -name 'slycot*.tar.bz2' | while read -r conda_pkg; do
132
+ conda_platform=$(basename $(dirname "${conda_pkg}"))
133
+ mkdir -p "slycot-conda-pkgs/${conda_platform}"
134
+ cp "${conda_pkg}" "slycot-conda-pkgs/${conda_platform}/"
135
+ done
136
+ - name : Save to local conda pkg channel
137
+ uses : actions/upload-artifact@v3
138
+ with :
139
+ name : slycot-conda-pkgs
140
+ path : slycot-conda-pkgs
141
+
142
+
92
143
create-wheel-test-matrix :
93
144
name : Create wheel test matrix
94
145
runs-on : ubuntu-latest
@@ -108,6 +159,25 @@ jobs:
108
159
run : echo "matrix=$(python3 .github/scripts/set-pip-test-matrix.py)" >> $GITHUB_OUTPUT
109
160
110
161
162
+ create-conda-test-matrix :
163
+ name : Create conda test matrix
164
+ runs-on : ubuntu-latest
165
+ needs : build-conda
166
+ if : always() # run tests for all successful builds, even if others failed
167
+ outputs :
168
+ matrix : ${{ steps.set-matrix.outputs.matrix }}
169
+ steps :
170
+ - name : Checkout python-control
171
+ uses : actions/checkout@v3
172
+ - name : Download conda packages
173
+ uses : actions/download-artifact@v3
174
+ with :
175
+ name : slycot-conda-pkgs
176
+ path : slycot-conda-pkgs
177
+ - id : set-matrix
178
+ run : echo "matrix=$(python3 .github/scripts/set-conda-test-matrix.py)" >> $GITHUB_OUTPUT
179
+
180
+
111
181
test-wheel :
112
182
name : Test wheel ${{ matrix.packagekey }}, ${{matrix.blas_lib}} BLAS lib ${{ matrix.failok }}
113
183
needs : create-wheel-test-matrix
@@ -174,3 +244,72 @@ jobs:
174
244
pip show slycot
175
245
- name : Test with pytest
176
246
run : pytest -v control/tests
247
+
248
+
249
+ test-conda :
250
+ name : Test conda ${{ matrix.packagekey }}, ${{matrix.blas_lib}} BLAS lib ${{ matrix.failok }}
251
+ needs : create-conda-test-matrix
252
+ runs-on : ${{ matrix.os }}-latest
253
+ continue-on-error : ${{ matrix.failok == 'FAILOK' }}
254
+
255
+ strategy :
256
+ fail-fast : false
257
+ matrix : ${{ fromJSON(needs.create-conda-test-matrix.outputs.matrix) }}
258
+
259
+ defaults :
260
+ run :
261
+ shell : bash -l {0}
262
+
263
+ steps :
264
+ - name : Checkout Slycot
265
+ uses : actions/checkout@v3
266
+ with :
267
+ repository : ' python-control/Slycot'
268
+ path : slycot-src
269
+ - name : Checkout python-control
270
+ uses : actions/checkout@v3
271
+ - name : Setup macOS
272
+ if : matrix.os == 'macos'
273
+ run : brew install coreutils
274
+ - name : Setup Conda
275
+ uses : conda-incubator/setup-miniconda@v2
276
+ with :
277
+ python-version : ${{ matrix.python }}
278
+ miniforge-version : latest
279
+ miniforge-variant : Mambaforge
280
+ activate-environment : test-env
281
+ environment-file : .github/conda-env/test-env.yml
282
+ channel-priority : strict
283
+ auto-activate-base : false
284
+ - name : Download conda packages
285
+ uses : actions/download-artifact@v3
286
+ with :
287
+ name : slycot-conda-pkgs
288
+ path : slycot-conda-pkgs
289
+ - name : Install Conda package
290
+ run : |
291
+ set -e
292
+ case ${{ matrix.blas_lib }} in
293
+ unset ) # the conda-forge default (os dependent)
294
+ mamba install libblas libcblas liblapack
295
+ ;;
296
+ Generic )
297
+ mamba install 'libblas=*=*netlib' 'libcblas=*=*netlib' 'liblapack=*=*netlib'
298
+ echo "libblas * *netlib" >> $CONDA_PREFIX/conda-meta/pinned
299
+ ;;
300
+ OpenBLAS )
301
+ mamba install 'libblas=*=*openblas' openblas
302
+ echo "libblas * *openblas" >> $CONDA_PREFIX/conda-meta/pinned
303
+ ;;
304
+ Intel10_64lp )
305
+ mamba install 'libblas=*=*mkl' mkl
306
+ echo "libblas * *mkl" >> $CONDA_PREFIX/conda-meta/pinned
307
+ ;;
308
+ esac
309
+ conda index --no-progress ./slycot-conda-pkgs
310
+ mamba install -c ./slycot-conda-pkgs slycot
311
+ conda list
312
+ - name : Test with pytest
313
+ run : JOBNAME=$JOBNAME pytest control/tests
314
+ env :
315
+ JOBNAME : ${{ matrix.packagekey }} ${{ matrix.blas_lib }}
0 commit comments