@@ -126,18 +126,23 @@ jobs:
126
126
strategy :
127
127
matrix :
128
128
python : ['3.9', '3.10', '3.11', '3.12']
129
- env :
130
- conda-bld : C:\Miniconda\conda-bld\win-64\
131
129
steps :
132
130
- uses : actions/checkout@v4
133
131
with :
134
132
fetch-depth : 0
135
133
- uses : conda-incubator/setup-miniconda@v3
136
134
with :
135
+ miniforge-version : latest
137
136
auto-activate-base : true
138
- conda-build-version : " *"
139
- activate-environment : true
137
+ activate-environment : build
140
138
python-version : ${{ matrix.python }}
139
+ channels : conda-forge,nodefaults
140
+
141
+ - name : Remove defaults channel
142
+ run : conda config --remove channels defaults
143
+
144
+ - name : Install conda-build
145
+ run : conda install -n base conda-build
141
146
142
147
- name : Cache conda packages
143
148
uses : actions/cache@v4
@@ -150,13 +155,22 @@ jobs:
150
155
restore-keys : |
151
156
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
152
157
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
158
+
153
159
- name : Build conda package with NumPy 2.0
154
- run : conda build --no-test --python ${{ matrix.python }} --numpy 2 -c conda-forge --override-channels conda-recipe-cf
160
+ run : |
161
+ conda activate
162
+ conda build --no-test --python ${{ matrix.python }} --numpy 2 -c conda-forge --override-channels conda-recipe-cf
163
+
164
+ - name : Store conda paths as envs
165
+ shell : bash -l {0}
166
+ run : |
167
+ echo "CONDA_BLD=$CONDA/conda-bld/win-64/" | tr "\\\\" '/' >> $GITHUB_ENV
168
+
155
169
- name : Upload artifact
156
170
uses : actions/upload-artifact@v4
157
171
with :
158
172
name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
159
- path : ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
173
+ path : ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
160
174
161
175
test_windows :
162
176
needs : build_windows
@@ -180,20 +194,30 @@ jobs:
180
194
uses : actions/download-artifact@v4
181
195
with :
182
196
name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python_ver }}
197
+
183
198
- uses : conda-incubator/setup-miniconda@v3
184
199
with :
185
- auto-update-conda : true
186
- conda-build-version : ' *'
187
- miniconda-version : ' latest'
188
- activate-environment : mkl_fft_test
189
- python-version : ${{ matrix.python_ver }}
200
+ miniforge-version : latest
201
+ activate-environment : ${{ env.TEST_ENV_NAME }}
202
+ python-version : ${{ matrix.python }}
203
+ channels : conda-forge
204
+
205
+ - name : Remove defaults channel
206
+ run : conda config --remove channels defaults
207
+
190
208
- name : Create conda channel with the artifact bit
191
209
shell : cmd /C CALL {0}
192
210
run : |
193
211
echo ${{ env.workdir }}
212
+ mkdir ${{ env.workdir }}\channel\
194
213
mkdir ${{ env.workdir }}\channel\win-64
195
214
move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.workdir }}\channel\win-64
196
215
dir ${{ env.workdir }}\channel\win-64
216
+
217
+ - name : Install conda index
218
+ shell : cmd /C CALL {0}
219
+ run : conda install -n base conda-index
220
+
197
221
- name : Index the channel
198
222
shell : cmd /C CALL {0}
199
223
run : conda index ${{ env.workdir }}\channel
@@ -215,7 +239,7 @@ jobs:
215
239
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
216
240
SET PACKAGE_VERSION=%%F
217
241
)
218
- conda install -n mkl_fft_test ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python_ver }} ${{ matrix.numpy }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
242
+ conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python_ver }} ${{ matrix.numpy }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
219
243
- name : Display lockfile content
220
244
shell : pwsh
221
245
run : Get-Content -Path .\lockfile
@@ -242,15 +266,15 @@ jobs:
242
266
SET PACKAGE_VERSION=%%F
243
267
)
244
268
SET "TEST_DEPENDENCIES=pytest pytest-cov"
245
- conda install -n mkl_fft_test ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} ${{ matrix.numpy }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
269
+ conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} ${{ matrix.numpy }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
246
270
- name : Report content of test environment
247
271
shell : cmd /C CALL {0}
248
272
run : |
249
273
echo "Value of CONDA enviroment variable was: " %CONDA%
250
274
echo "Value of CONDA_PREFIX enviroment variable was: " %CONDA_PREFIX%
251
- conda info && conda list -n mkl_fft_test
275
+ conda info && conda list -n ${{ env.TEST_ENV_NAME }}
252
276
- name : Run tests
253
277
shell : cmd /C CALL {0}
254
278
run : >-
255
- conda activate mkl_fft_test && python -m pytest -v -s --pyargs ${{ env.MODULE_NAME }}
279
+ conda activate ${{ env.TEST_ENV_NAME }} && python -m pytest -v -s --pyargs ${{ env.MODULE_NAME }}
256
280
0 commit comments