Skip to content

Commit 057600e

Browse files
Fix issue with Windows build/test steps
1 parent 826a330 commit 057600e

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

.github/workflows/conda-package.yml

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
uses: actions/upload-artifact@v3
5252
with:
5353
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
54-
path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2
54+
path: $CONDA/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2
5555

5656
test:
5757
needs: build
@@ -128,11 +128,13 @@ jobs:
128128
- uses: actions/checkout@v3
129129
with:
130130
fetch-depth: 0
131-
- uses: conda-incubator/setup-miniconda@v2
131+
132+
- uses: conda-incubator/setup-miniconda@v3
132133
with:
133-
auto-activate-base: true
134-
conda-build-version: "*"
135-
activate-environment: true
134+
miniforge-variant: Miniforge3
135+
miniforge-version: latest
136+
activate-environment: build
137+
channels: conda-forge
136138
python-version: ${{ matrix.python }}
137139

138140
- name: Cache conda packages
@@ -146,8 +148,23 @@ jobs:
146148
restore-keys: |
147149
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
148150
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
151+
152+
- name: Store conda paths as envs
153+
shell: bash -l {0}
154+
run: |
155+
echo "CONDA_BLD=$CONDA/conda-bld/win-64/" | tr "\\\\" '/' >> $GITHUB_ENV
156+
157+
- name: Install conda build
158+
run: |
159+
conda activate
160+
conda install -y conda-build
161+
conda list -n base
162+
149163
- name: Build conda package
150-
run: conda build --no-test --python ${{ matrix.python }} -c conda-forge -c https://software.repos.intel.com/python/conda --override-channels conda-recipe-cf
164+
run: |
165+
conda activate
166+
conda build --no-test --python ${{ matrix.python }} -c conda-forge -c https://software.repos.intel.com/python/conda --override-channels conda-recipe-cf
167+
151168
- name: Upload artifact
152169
uses: actions/upload-artifact@v3
153170
with:
@@ -175,27 +192,32 @@ jobs:
175192
uses: actions/download-artifact@v3
176193
with:
177194
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
178-
- uses: conda-incubator/setup-miniconda@v2
195+
- uses: conda-incubator/setup-miniconda@v3
179196
with:
180-
auto-update-conda: true
181-
conda-build-version: '*'
182-
miniconda-version: 'latest'
183-
activate-environment: mkl_umath_test
197+
miniforge-variant: Miniforge3
198+
miniforge-version: latest
199+
activate-environment: build
200+
channels: conda-forge
184201
python-version: ${{ matrix.python }}
202+
185203
- name: Create conda channel with the artifact bit
186204
shell: cmd /C CALL {0}
187205
run: |
188206
echo ${{ env.workdir }}
189207
mkdir ${{ env.workdir }}\channel\win-64
190208
move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.workdir }}\channel\win-64
191209
dir ${{ env.workdir }}\channel\win-64
210+
192211
- name: Index the channel
193212
shell: cmd /C CALL {0}
194-
run: conda index ${{ env.workdir }}\channel
213+
run: |
214+
conda activate
215+
conda index ${{ env.workdir }}\channel
195216
196217
- name: Dump mkl_umath version info from created channel into ver.json
197218
shell: cmd /C CALL {0}
198219
run: |
220+
conda activate
199221
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.workdir }}/channel --override-channels --info --json > ${{ env.workdir }}\ver.json
200222
- name: Output content of produced ver.json
201223
shell: pwsh
@@ -210,6 +232,7 @@ jobs:
210232
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
211233
SET PACKAGE_VERSION=%%F
212234
)
235+
conda activate
213236
conda install -n mkl_umath_test ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
214237
- name: Display lockfile content
215238
shell: pwsh
@@ -241,6 +264,7 @@ jobs:
241264
- name: Report content of test environment
242265
shell: cmd /C CALL {0}
243266
run: |
267+
conda activate
244268
echo "Value of CONDA enviroment variable was: " %CONDA%
245269
echo "Value of CONDA_PREFIX enviroment variable was: " %CONDA_PREFIX%
246270
conda info && conda list -n mkl_umath_test

0 commit comments

Comments
 (0)