Skip to content

Commit 3185976

Browse files
committed
use dedicated build environments in Windows conda workflows
1 parent 7a1d8ab commit 3185976

File tree

2 files changed

+27
-23
lines changed

2 files changed

+27
-23
lines changed

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ jobs:
7878

7979
build_windows:
8080
runs-on: windows-latest
81-
81+
defaults:
82+
run:
83+
shell: cmd /C CALL {0}
8284
strategy:
8385
matrix:
8486
include:
@@ -103,12 +105,9 @@ jobs:
103105

104106
- uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
105107
with:
106-
miniforge-variant: Miniforge3
107108
miniforge-version: latest
108-
auto-activate: true
109-
activate-environment: base
109+
activate-environment: build
110110
channels: conda-forge
111-
conda-remove-defaults: true
112111
python-version: ${{ matrix.python }}
113112

114113
- name: Cache conda packages
@@ -123,13 +122,15 @@ jobs:
123122
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
124123
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
125124
126-
- name: Install conda-build
127-
run: conda install -n base -y conda-build
128-
129125
- name: Store conda paths as envs
130-
shell: bash -el {0}
126+
shell: bash -l {0}
131127
run: |
132-
echo "CONDA_BLD=${CONDA_PREFIX}\\conda-bld\\win-64\\" >> "$GITHUB_ENV"
128+
echo "CONDA_BLD=$CONDA/conda-bld/win-64/" | tr "\\\\" '/' >> "$GITHUB_ENV"
129+
130+
- name: Install conda build
131+
run: |
132+
conda install -n base -y conda-build
133+
conda list -n base
133134
134135
- name: Build conda package
135136
run: conda build --no-test --python ${{ matrix.python }} --numpy ${{ matrix.numpy }} -c conda-forge --override-channels conda-recipe-cf
@@ -225,7 +226,9 @@ jobs:
225226
test_windows:
226227
needs: build_windows
227228
runs-on: windows-latest
228-
229+
defaults:
230+
run:
231+
shell: cmd /C CALL {0}
229232
strategy:
230233
matrix:
231234
include:
@@ -253,7 +256,6 @@ jobs:
253256
with:
254257
miniforge-version: latest
255258
channels: conda-forge
256-
conda-remove-defaults: true
257259
activate-environment: ${{ env.TEST_ENV_NAME }}
258260
python-version: ${{ matrix.python }}
259261

.github/workflows/conda-package.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ jobs:
7979

8080
build_windows:
8181
runs-on: windows-latest
82-
82+
defaults:
83+
run:
84+
shell: cmd /C CALL {0}
8385
strategy:
8486
matrix:
8587
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
@@ -97,10 +99,9 @@ jobs:
9799
- uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
98100
with:
99101
miniforge-version: latest
100-
use-mamba: 'true'
101-
conda-remove-defaults: 'true'
102-
activate-environment: 'build'
103-
python-version: '3.13' # no python 3.14 support by conda-build
102+
activate-environment: build
103+
channels: conda-forge
104+
python-version: ${{ matrix.python }}
104105

105106
- name: Cache conda packages
106107
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
@@ -114,13 +115,15 @@ jobs:
114115
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
115116
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
116117
117-
- name: Install conda-build
118-
run: conda install conda-build
119-
120118
- name: Store conda paths as envs
121-
shell: bash -el {0}
119+
shell: bash -l {0}
120+
run: |
121+
echo "CONDA_BLD=$CONDA/conda-bld/win-64/" | tr "\\\\" '/' >> "$GITHUB_ENV"
122+
123+
- name: Install conda build
122124
run: |
123-
echo "CONDA_BLD=${CONDA_PREFIX}\\conda-bld\\win-64\\" >> "$GITHUB_ENV"
125+
conda install -n base -y conda-build
126+
conda list -n base
124127
125128
- name: Build conda package
126129
run: conda build --no-test --python "${{ matrix.python }}" -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels conda-recipe
@@ -248,7 +251,6 @@ jobs:
248251
with:
249252
miniforge-version: latest
250253
channels: conda-forge
251-
conda-remove-defaults: true
252254
activate-environment: ${{ env.TEST_ENV_NAME }}
253255
python-version: ${{ matrix.python }}
254256

0 commit comments

Comments
 (0)