@@ -10,6 +10,8 @@ permissions: read-all
1010
1111env :
1212 PACKAGE_NAME : mkl_umath
13+ MODULE_NAME : mkl_umath
14+ TEST_ENV_NAME : test_mkl_umath
1315 VER_SCRIPT1 : " import json; f = open('ver.json', 'r'); j = json.load(f); f.close(); d = j['mkl_umath'][0];"
1416 VER_SCRIPT2 : " print('='.join((d[s] for s in ('version', 'build'))))"
1517
@@ -102,7 +104,7 @@ jobs:
102104 - name : Collect dependencies
103105 run : |
104106 CHANNELS=(-c "$GITHUB_WORKSPACE/channel" -c "https://software.repos.intel.com/python/conda" -c "conda-forge" --override-channels)
105- conda create -n test_mkl_umath "$PACKAGE_NAME" "python=${{ matrix.python }}" "${CHANNELS[@]}" --only-deps --dry-run > lockfile
107+ conda create -n "${{ env.TEST_ENV_NAME }}" "$PACKAGE_NAME" "python=${{ matrix.python }}" "${CHANNELS[@]}" --only-deps --dry-run > lockfile
106108 - name : Display lockfile
107109 run : cat lockfile
108110
@@ -125,25 +127,27 @@ jobs:
125127 - name : Install mkl_umath
126128 run : |
127129 CHANNELS=(-c "$GITHUB_WORKSPACE/channel" -c "https://software.repos.intel.com/python/conda" -c "conda-forge" --override-channels)
128- conda create -n test_mkl_umath "python=${{ matrix.python }}" "$PACKAGE_NAME" pytest "${CHANNELS[@]}"
130+ conda create -n "${{ env.TEST_ENV_NAME }}" "python=${{ matrix.python }}" "$PACKAGE_NAME" pytest "${CHANNELS[@]}"
129131 # Test installed packages
130- conda list -n test_mkl_umath
132+ conda list -n "${{ env.TEST_ENV_NAME }}"
131133
132134 - name : Smoke test
133135 run : |
134136 source "$CONDA/etc/profile.d/conda.sh"
135- conda activate test_mkl_umath
137+ conda activate "${{ env.TEST_ENV_NAME }}"
136138 python -c "import mkl_umath, numpy as np; mkl_umath.use_in_numpy(); np.sin(np.linspace(0, 1, num=10**6));"
137139
138140 - name : Run tests
139141 run : |
140142 source "$CONDA/etc/profile.d/conda.sh"
141- conda activate test_mkl_umath
143+ conda activate "${{ env.TEST_ENV_NAME }}"
142144 pytest -v --pyargs ${{ env.PACKAGE_NAME }}
143145
144146 build_windows :
145147 runs-on : windows-latest
146-
148+ defaults :
149+ run :
150+ shell : cmd /C CALL {0}
147151 strategy :
148152 matrix :
149153 python : ["3.10", "3.11", "3.12", "3.13", "3.14"]
@@ -160,11 +164,9 @@ jobs:
160164
161165 - uses : conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
162166 with :
163- miniforge-variant : Miniforge3
164167 miniforge-version : latest
165168 activate-environment : build
166169 channels : conda-forge
167- conda-remove-defaults : " true"
168170 python-version : ${{ matrix.python }}
169171
170172 - name : Cache conda packages
@@ -186,13 +188,11 @@ jobs:
186188
187189 - name : Install conda build
188190 run : |
189- conda activate
190- conda install -y conda-build
191+ conda install -n base -y conda-build
191192 conda list -n base
192193
193194 - name : Build conda package
194195 run : |
195- conda activate
196196 conda build --no-test --python ${{ matrix.python }} -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels conda-recipe
197197
198198 - name : Upload artifact
@@ -225,11 +225,9 @@ jobs:
225225
226226 - uses : conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
227227 with :
228- miniforge-variant : Miniforge3
229228 miniforge-version : latest
230- activate-environment : mkl_umath_test
231229 channels : conda-forge
232- conda-remove-defaults : " true "
230+ activate-environment : ${{ env.TEST_ENV_NAME }}
233231 python-version : ${{ matrix.python }}
234232
235233 - name : Install conda-index
@@ -279,7 +277,7 @@ jobs:
279277 FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
280278 SET PACKAGE_VERSION=%%F
281279 )
282- 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
280+ conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
283281
284282 - name : Display lockfile content
285283 shell : pwsh
@@ -313,25 +311,25 @@ jobs:
313311 SET "TEST_DEPENDENCIES=pytest pytest-cov"
314312 SET "WORKAROUND_DEPENDENCIES=intel-openmp"
315313 SET "DEPENDENCIES=%TEST_DEPENDENCIES% %WORKAROUND_DEPENDENCIES%"
316- conda install -n mkl_umath_test ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %DEPENDENCIES% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
314+ conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %DEPENDENCIES% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
317315
318316 - name : Report content of test environment
319317 shell : cmd /C CALL {0}
320318 run : |
321319 conda activate
322320 echo "Value of CONDA environment variable was: " %CONDA%
323321 echo "Value of CONDA_PREFIX environment variable was: " %CONDA_PREFIX%
324- conda info && conda list -n mkl_umath_test
322+ conda info && conda list -n ${{ env.TEST_ENV_NAME }}
325323
326324 - name : Smoke test
327325 shell : cmd /C CALL {0}
328326 run : |
329327 @ECHO ON
330- conda activate mkl_umath_test
328+ conda activate ${{ env.TEST_ENV_NAME }}
331329 python -c "import mkl_umath, numpy as np; mkl_umath.use_in_numpy(); np.sin(np.linspace(0, 1, num=10**6));"
332330
333331 - name : Run tests
334332 shell : cmd /C CALL {0}
335333 run : |
336- conda activate mkl_umath_test
337- python -m pytest -v -s --pyargs ${{ env.PACKAGE_NAME }}
334+ conda activate ${{ env.TEST_ENV_NAME }}
335+ python -m pytest -v -s --pyargs ${{ env.MODULE_NAME }}
0 commit comments