Skip to content

Commit a8ebfdc

Browse files
committed
use dedicated build environments in Windows workflow
1 parent 2bdd772 commit a8ebfdc

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

.github/workflows/conda-package-cf.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ jobs:
155155
156156
build_windows:
157157
runs-on: windows-latest
158-
158+
defaults:
159+
run:
160+
shell: cmd /C CALL {0}
159161
strategy:
160162
matrix:
161163
include:
@@ -182,12 +184,9 @@ jobs:
182184

183185
- uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
184186
with:
185-
miniforge-variant: Miniforge3
186187
miniforge-version: latest
187-
auto-activate: true
188-
activate-environment: base
188+
activate-environment: build
189189
channels: conda-forge
190-
conda-remove-defaults: true
191190
python-version: ${{ matrix.python }}
192191

193192
- name: Install conda-build
@@ -207,13 +206,12 @@ jobs:
207206
208207
- name: Build conda package with NumPy 2.x
209208
run: |
210-
conda activate
211209
conda build --no-test --python ${{ matrix.python }} --numpy ${{ matrix.numpy }} -c conda-forge --override-channels conda-recipe-cf
212210
213211
- name: Store conda paths as envs
214212
shell: bash -l {0}
215213
run: |
216-
echo "CONDA_BLD=$CONDA/conda-bld/win-64/" | tr "\\\\" '/' >> "$GITHUB_ENV"
214+
echo "CONDA_BLD=$CONDA_PREFIX/conda-bld/win-64/" | tr "\\\\" '/' >> "$GITHUB_ENV"
217215
218216
- name: Upload artifact
219217
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
@@ -249,7 +247,6 @@ jobs:
249247
with:
250248
miniforge-version: latest
251249
channels: conda-forge
252-
conda-remove-defaults: true
253250
activate-environment: ${{ env.TEST_ENV_NAME }}
254251
python-version: ${{ matrix.python }}
255252

.github/workflows/conda-package.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ jobs:
155155
156156
build_windows:
157157
runs-on: windows-latest
158-
158+
defaults:
159+
run:
160+
shell: cmd /C CALL {0}
159161
strategy:
160162
matrix:
161163
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
@@ -171,17 +173,13 @@ jobs:
171173

172174
- uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
173175
with:
174-
miniforge-variant: Miniforge3
175176
miniforge-version: latest
176-
auto-activate: true
177-
activate-environment: base
177+
activate-environment: build
178178
channels: conda-forge
179-
conda-remove-defaults: true
180179
python-version: ${{ matrix.python }}
181180

182181
- name: Install conda-build
183182
run: |
184-
conda activate
185183
conda install -n base conda-build
186184
187185
- name: Cache conda packages
@@ -198,13 +196,12 @@ jobs:
198196
199197
- name: Build conda package
200198
run: |
201-
conda activate
202199
conda build --no-test --python ${{ matrix.python }} -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels conda-recipe
203200
204201
- name: Store conda paths as envs
205202
shell: bash -l {0}
206203
run: |
207-
echo "CONDA_BLD=$CONDA/conda-bld/win-64/" | tr "\\\\" '/' >> "$GITHUB_ENV"
204+
echo "CONDA_BLD=$CONDA_PREFIX/conda-bld/win-64/" | tr "\\\\" '/' >> "$GITHUB_ENV"
208205
209206
- name: Upload artifact
210207
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
@@ -239,7 +236,6 @@ jobs:
239236
with:
240237
miniforge-version: latest
241238
channels: conda-forge
242-
conda-remove-defaults: true
243239
activate-environment: ${{ env.TEST_ENV_NAME }}
244240
python-version: ${{ matrix.python }}
245241

0 commit comments

Comments
 (0)