Skip to content

Commit b931ff0

Browse files
Fix for windows step of workflow
1 parent a90d6a8 commit b931ff0

File tree

2 files changed

+71
-23
lines changed

2 files changed

+71
-23
lines changed

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

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,23 @@ jobs:
126126
strategy:
127127
matrix:
128128
python: ['3.9', '3.10', '3.11', '3.12']
129-
env:
130-
conda-bld: C:\Miniconda\conda-bld\win-64\
131129
steps:
132130
- uses: actions/checkout@v4
133131
with:
134132
fetch-depth: 0
135133
- uses: conda-incubator/setup-miniconda@v3
136134
with:
135+
miniforge-version: latest
137136
auto-activate-base: true
138-
conda-build-version: "*"
139-
activate-environment: true
137+
activate-environment: build
140138
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
141146

142147
- name: Cache conda packages
143148
uses: actions/cache@v4
@@ -150,13 +155,22 @@ jobs:
150155
restore-keys: |
151156
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
152157
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
158+
153159
- 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+
155169
- name: Upload artifact
156170
uses: actions/upload-artifact@v4
157171
with:
158172
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
160174

161175
test_windows:
162176
needs: build_windows
@@ -180,20 +194,30 @@ jobs:
180194
uses: actions/download-artifact@v4
181195
with:
182196
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python_ver }}
197+
183198
- uses: conda-incubator/setup-miniconda@v3
184199
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: build
202+
python-version: ${{ matrix.python }}
203+
channels: conda-forge
204+
205+
- name: Remove defaults channel
206+
run: conda config --remove channels defaults
207+
190208
- name: Create conda channel with the artifact bit
191209
shell: cmd /C CALL {0}
192210
run: |
193211
echo ${{ env.workdir }}
212+
mkdir ${{ env.workdir }}\channel\
194213
mkdir ${{ env.workdir }}\channel\win-64
195214
move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.workdir }}\channel\win-64
196215
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+
197221
- name: Index the channel
198222
shell: cmd /C CALL {0}
199223
run: conda index ${{ env.workdir }}\channel

.github/workflows/conda-package.yml

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,24 @@ jobs:
125125
strategy:
126126
matrix:
127127
python: ['3.9', '3.10']
128-
env:
129-
conda-bld: C:\Miniconda\conda-bld\win-64\
130128
steps:
131-
- uses: actions/checkout@v4
129+
- uses: actions/checkout@v4.2.0
132130
with:
133131
fetch-depth: 0
134132
- uses: conda-incubator/setup-miniconda@v3
135133
with:
136-
auto-activate-base: true
137-
conda-build-version: "*"
138-
activate-environment: true
134+
miniforge-version: latest
135+
activate-environment: build
139136
python-version: ${{ matrix.python }}
137+
channels: conda-forge
138+
139+
- name: Remove defaults channel
140+
run: conda config --remove channels defaults
141+
142+
- name: Install conda-build
143+
run: |
144+
conda activate
145+
conda install -n base conda-build
140146
141147
- name: Cache conda packages
142148
uses: actions/cache@v4
@@ -149,13 +155,22 @@ jobs:
149155
restore-keys: |
150156
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
151157
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
158+
152159
- name: Build conda package
153-
run: conda build --no-test --python ${{ matrix.python }} -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels conda-recipe
160+
run: |
161+
conda activate
162+
conda build --no-test --python ${{ matrix.python }} -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels conda-recipe
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+
154169
- name: Upload artifact
155170
uses: actions/upload-artifact@v4
156171
with:
157172
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
158-
path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
173+
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
159174

160175
test_windows:
161176
needs: build_windows
@@ -180,18 +195,27 @@ jobs:
180195
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
181196
- uses: conda-incubator/setup-miniconda@v3
182197
with:
183-
auto-update-conda: true
184-
conda-build-version: '*'
185-
miniconda-version: 'latest'
186-
activate-environment: mkl_fft_test
198+
miniforge-version: latest
199+
activate-environment: build
187200
python-version: ${{ matrix.python }}
201+
channels: conda-forge
202+
203+
- name: Remove defaults channel
204+
run: conda config --remove channels defaults
205+
188206
- name: Create conda channel with the artifact bit
189207
shell: cmd /C CALL {0}
190208
run: |
191209
echo ${{ env.workdir }}
210+
mkdir ${{ env.workdir }}\channel\
192211
mkdir ${{ env.workdir }}\channel\win-64
193212
move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.workdir }}\channel\win-64
194213
dir ${{ env.workdir }}\channel\win-64
214+
215+
- name: Install conda index
216+
shell: cmd /C CALL {0}
217+
run: conda install -n base conda-index
218+
195219
- name: Index the channel
196220
shell: cmd /C CALL {0}
197221
run: conda index ${{ env.workdir }}\channel

0 commit comments

Comments
 (0)