7272 fetch-depth : 0
7373 - uses : conda-incubator/setup-miniconda@v2
7474 with :
75+ use-only-tar-bz2 : true
7576 auto-activate-base : true
7677 conda-build-version : " *"
77- activate-environment : " "
78+ activate-environment : true
79+ python-version : ${{ matrix.python }}
7880
7981 - name : Cache conda packages
8082 uses : actions/cache@v3
@@ -173,7 +175,9 @@ jobs:
173175 test_windows :
174176 needs : build_windows
175177 runs-on : ${{ matrix.runner }}
176-
178+ defaults :
179+ run :
180+ shell : cmd /C CALL {0}
177181 strategy :
178182 matrix :
179183 python : ['3.8', '3.9', '3.10']
@@ -195,7 +199,8 @@ jobs:
195199 auto-update-conda : true
196200 conda-build-version : ' *'
197201 miniconda-version : ' latest'
198- activate-environment : " dpctl_test"
202+ activate-environment : dpctl_test
203+ python-version : ${{ matrix.python }}
199204 - name : Create conda channel with the artifact bit
200205 shell : cmd /C CALL {0}
201206 run : |
@@ -212,6 +217,7 @@ jobs:
212217 run : |
213218 conda search ${{ env.PACKAGE_NAME }} -c ${{ env.workdir }}/channel --override-channels --info --json > ${{ env.workdir }}\ver.json
214219 - name : Output content of produced ver.json
220+ shell : pwsh
215221 run : Get-Content -Path ${{ env.workdir }}\ver.json
216222 - name : Collect dependencies
217223 shell : cmd /C CALL {0}
@@ -223,8 +229,9 @@ jobs:
223229 FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
224230 SET PACKAGE_VERSION=%%F
225231 )
226- conda install ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
232+ conda install -n dpctl_test ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
227233 - name : Display lockfile content
234+ shell : pwsh
228235 run : Get-Content -Path .\lockfile
229236 - name : Cache conda packages
230237 uses : actions/cache@v3
@@ -239,7 +246,7 @@ jobs:
239246 ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
240247 - name : Install opencl_rt
241248 shell : cmd /C CALL {0}
242- run : conda install opencl_rt -c intel --override-channels
249+ run : conda install -n dpctl_test opencl_rt -c intel --override-channels
243250 - name : Install dpctl
244251 shell : cmd /C CALL {0}
245252 run : |
@@ -252,14 +259,14 @@ jobs:
252259 SET PACKAGE_VERSION=%%F
253260 )
254261 SET "TEST_DEPENDENCIES=pytest pytest-cov cython"
255- conda install ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
262+ conda install -n dpctl_test ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
256263 - name : Report content of test environment
257264 shell : cmd /C CALL {0}
258265 run : |
259- pip install --no-cache-dir brotli
260266 echo "Value of CONDA enviroment variable was: " %CONDA%
261- conda list
262- - name : Add library
267+ echo "Value of CONDA_PREFIX enviroment variable was: " %CONDA_PREFIX%
268+ conda info && conda list -n dpctl_test
269+ - name : Configure Intel OpenCL CPU RT
263270 shell : pwsh
264271 run : |
265272 $conda_env_library = "$env:CONDA_PREFIX\Library"
@@ -278,35 +285,24 @@ jobs:
278285 New-ItemProperty -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors -Name $conda_env_library\lib\intelocl64.dll -Value 0
279286 try {$list = Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors | Select-Object -ExpandProperty Property } catch {$list=@()}
280287 Write-Output $(Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors)
281- # Now copy OpenCL.dll into system folder
282- $system_ocl_icd_loader="C:\Windows\System32\OpenCL.dll"
283- $python_ocl_icd_loader="$conda_env_library\bin\OpenCL.dll"
284- Copy-Item -Path $python_ocl_icd_loader -Destination $system_ocl_icd_loader
285- if (Test-Path -Path $system_ocl_icd_loader) {
286- Write-Output "$system_ocl_icd_loader has been copied"
287- $acl = Get-Acl $system_ocl_icd_loader
288- Write-Output $acl
289- } else {
290- Write-Output "OCL-ICD-Loader was not copied"
291- }
292288 # Variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
293289 $cl_cfg="$conda_env_library\lib\cl.cfg"
294290 Write-Output $cl_cfg
295291 (Get-Content $cl_cfg) -replace '^CL_CONFIG_TBB_DLL_PATH =', "CL_CONFIG_TBB_DLL_PATH = $conda_env_library\bin" | Set-Content $cl_cfg
296292 Get-Content -Tail 5 -Path $cl_cfg
297293 }
298- - name : Smoke test
294+ - name : Smoke test, step 1
299295 shell : cmd /C CALL {0}
300- run : |
301- python -c "import sys; print(sys.executable)"
302- python -c "import dpctl; dpctl.lsplatform()"
303- python -c "import dpctl; print(dpctl.get_devices(backend='opencl', device_type='gpu'))"
304- python -c "import dpctl; print(dpctl.get_num_devices(backend='opencl', device_type='gpu'))"
296+ run : >-
297+ conda activate dpctl_test && python -c "import sys; print(sys.executable)"
298+ - name : Smoke test, step 2
299+ shell : cmd /C CALL {0}
300+ run : >-
301+ conda activate dpctl_test && python -c "import dpctl; dpctl.lsplatform()"
305302 - name : Run tests
306303 shell : cmd /C CALL {0}
307- run : |
308- python -c "import sys; print(sys.executable)"
309- python -m pytest -p no:faulthandler --pyargs ${{ env.MODULE_NAME }}
304+ run : >-
305+ conda activate dpctl_test && python -m pytest -p no:faulthandler --pyargs ${{ env.MODULE_NAME }}
310306
311307 upload_linux :
312308 needs : test_linux
0 commit comments