@@ -11,6 +11,7 @@ permissions: read-all
11
11
env :
12
12
PACKAGE_NAME : dpctl
13
13
MODULE_NAME : dpctl
14
+ TEST_ENV_NAME : test_dpctl
14
15
VER_SCRIPT1 : " import json; f = open('ver.json', 'r'); j = json.load(f); f.close(); "
15
16
VER_SCRIPT2 : " d = j['dpctl'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
16
17
@@ -155,7 +156,7 @@ jobs:
155
156
run : |
156
157
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
157
158
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
158
- conda create -n test_dpctl $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
159
+ conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
159
160
cat lockfile
160
161
- name : Set pkgs_dirs
161
162
run : |
@@ -176,13 +177,13 @@ jobs:
176
177
export CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
177
178
export TEST_DEPENDENCIES="pytest pytest-cov cython"
178
179
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
179
- conda create -n test_dpctl $PACKAGE_NAME=${PACKAGE_VERSION} ${TEST_DEPENDENCIES} python=${{ matrix.python }} ${CHANNELS}
180
+ conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} ${TEST_DEPENDENCIES} python=${{ matrix.python }} ${CHANNELS}
180
181
# Test installed packages
181
- conda list -n test_dpctl
182
+ conda list -n ${{ env.TEST_ENV_NAME }}
182
183
- name : Smoke test
183
184
run : |
184
185
. $CONDA/etc/profile.d/conda.sh
185
- conda activate test_dpctl
186
+ conda activate ${{ env.TEST_ENV_NAME }}
186
187
python -c "import dpctl; dpctl.lsplatform(verbosity=2)"
187
188
- name : Install gdb
188
189
run : |
@@ -191,14 +192,19 @@ jobs:
191
192
- name : Run test_elementwise under gdb
192
193
run : |
193
194
. $CONDA/etc/profile.d/conda.sh
194
- conda activate test_dpctl
195
+ conda activate ${{ env.TEST_ENV_NAME }}
195
196
gdb --batch -ex r -ex 'info sharedlibrary' -ex 'set print elements 1000' -ex bt --args ${CONDA_PREFIX}/bin/python -m pytest -q -ra --disable-warnings --pyargs dpctl.tests.elementwise.test_trigonometric::test_trig_order -vv || true
197
+ - name : Create test temp dir
198
+ # create temporary empty folder to runs tests from
199
+ # https://github.com/pytest-dev/pytest/issues/11904
200
+ run : mkdir -p ${GITHUB_WORKSPACE}/test_tmp
196
201
- name : Run tests
202
+ working-directory : ${{ github.workspace }}/test_tmp
197
203
env :
198
204
SYCL_CACHE_PERSISTENT : 1
199
205
run : |
200
206
. $CONDA/etc/profile.d/conda.sh
201
- conda activate test_dpctl
207
+ conda activate ${{ env.TEST_ENV_NAME }}
202
208
python -m pytest -v --pyargs $MODULE_NAME
203
209
204
210
test_windows :
@@ -227,7 +233,7 @@ jobs:
227
233
auto-update-conda : true
228
234
conda-build-version : ' *'
229
235
miniconda-version : ' latest'
230
- activate-environment : dpctl_test
236
+ activate-environment : ${{ env.TEST_ENV_NAME }}
231
237
python-version : ${{ matrix.python }}
232
238
- name : Create conda channel with the artifact bit
233
239
shell : cmd /C CALL {0}
@@ -257,7 +263,7 @@ jobs:
257
263
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
258
264
SET PACKAGE_VERSION=%%F
259
265
)
260
- conda install -n dpctl_test ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
266
+ 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
261
267
- name : Display lockfile content
262
268
shell : pwsh
263
269
run : Get-Content -Path .\lockfile
@@ -274,7 +280,7 @@ jobs:
274
280
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
275
281
- name : Install opencl_rt
276
282
shell : cmd /C CALL {0}
277
- run : conda install -n dpctl_test opencl_rt -c intel --override-channels
283
+ run : conda install -n ${{ env.TEST_ENV_NAME }} opencl_rt -c intel --override-channels
278
284
- name : Install dpctl
279
285
shell : cmd /C CALL {0}
280
286
run : |
@@ -286,14 +292,14 @@ jobs:
286
292
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
287
293
SET PACKAGE_VERSION=%%F
288
294
)
289
- SET " TEST_DEPENDENCIES=pytest pytest-cov cython"
290
- conda install -n dpctl_test ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
295
+ SET TEST_DEPENDENCIES=pytest"<8" pytest-cov cython
296
+ conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
291
297
- name : Report content of test environment
292
298
shell : cmd /C CALL {0}
293
299
run : |
294
300
echo "Value of CONDA enviroment variable was: " %CONDA%
295
301
echo "Value of CONDA_PREFIX enviroment variable was: " %CONDA_PREFIX%
296
- conda info && conda list -n dpctl_test
302
+ conda info && conda list -n ${{ env.TEST_ENV_NAME }}
297
303
- name : Configure Intel OpenCL CPU RT
298
304
shell : pwsh
299
305
run : |
@@ -305,17 +311,27 @@ jobs:
305
311
- name : Smoke test, step 1
306
312
shell : cmd /C CALL {0}
307
313
run : >-
308
- conda activate dpctl_test && python -c "import sys; print(sys.executable)"
314
+ conda activate ${{ env.TEST_ENV_NAME }} && python -c "import sys; print(sys.executable)"
309
315
- name : Smoke test, step 2
310
316
shell : cmd /C CALL {0}
311
317
run : >-
312
- conda activate dpctl_test && python -m dpctl -f
318
+ conda activate ${{ env.TEST_ENV_NAME }} && python -m dpctl -f
319
+ - name : Create empty temporary directory to run tests from
320
+ shell : cmd /C CALL {0}
321
+ # create temporary empty folder to runs tests from
322
+ # https://github.com/pytest-dev/pytest/issues/11904
323
+ run : >-
324
+ mkdir "${{ env.workdir }}\test_tmp"
325
+ - name : List content of workdir folder
326
+ shell : cmd /C CALL {0}
327
+ run : dir "${{ env.workdir }}"
313
328
- name : Run tests
314
329
shell : cmd /C CALL {0}
315
330
env :
316
331
SYCL_CACHE_PERSISTENT : 1
332
+ working-directory : ${{ env.workdir }}\test_tmp
317
333
run : >-
318
- conda activate dpctl_test && python -m pytest -v -s --pyargs ${{ env.MODULE_NAME }}
334
+ conda activate ${{ env.TEST_ENV_NAME }} && python -m pytest -v -s --pyargs ${{ env.MODULE_NAME }}
319
335
320
336
upload_linux :
321
337
needs : test_linux
@@ -405,6 +421,8 @@ jobs:
405
421
continue-on-error : ${{ matrix.experimental }}
406
422
env :
407
423
CHANNELS : -c intel -c conda-forge --override-channels
424
+ EXAMPLES_ENV_NAME : examples
425
+ BUILD_ENV_NAME : build_env
408
426
409
427
steps :
410
428
- name : Install conda-build
@@ -454,24 +472,24 @@ jobs:
454
472
run : |
455
473
CHANNELS="${{ env.CHANNELS }}"
456
474
. $CONDA/etc/profile.d/conda.sh
457
- conda create -n examples -y pytest python=${{ matrix.python }} $CHANNELS
458
- conda install -n examples -y cmake">=3.22" $CHANNELS || exit 1
459
- conda install -n examples -y ninja $CHANNELS || exit 1
460
- conda install -n examples -y pybind11 cython scikit-build $CHANNELS || exit 1
461
- conda install -n examples -y mkl-dpcpp mkl-devel-dpcpp dpcpp_cpp_rt $CHANNELS || exit 1
462
- conda create -y -n build_env $CHANNELS gcc_linux-64 gxx_linux-64 ${{ env.DPCPP_CMPLR }} sysroot_linux-64">=2.28"
475
+ conda create -n ${{ env.EXAMPLES_ENV_NAME }} -y pytest python=${{ matrix.python }} $CHANNELS
476
+ conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y cmake">=3.22" $CHANNELS || exit 1
477
+ conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y ninja $CHANNELS || exit 1
478
+ conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y pybind11 cython scikit-build $CHANNELS || exit 1
479
+ conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y mkl-dpcpp mkl-devel-dpcpp dpcpp_cpp_rt $CHANNELS || exit 1
480
+ conda create -y -n ${{ env.BUILD_ENV_NAME }} $CHANNELS gcc_linux-64 gxx_linux-64 ${{ env.DPCPP_CMPLR }} sysroot_linux-64">=2.28"
463
481
- name : Install dpctl
464
482
shell : bash -l {0}
465
483
run : |
466
484
source $CONDA/etc/profile.d/conda.sh
467
485
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c conda-forge --override-channels"
468
486
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
469
- conda install -n examples -y ${CHANNELS} dpctl=${PACKAGE_VERSION} dpnp">=0.10.1" || exit 1
487
+ conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y ${CHANNELS} dpctl=${PACKAGE_VERSION} dpnp || exit 1
470
488
- name : Build and run examples of pybind11 extensions
471
489
shell : bash -l {0}
472
490
run : |
473
491
source $CONDA/etc/profile.d/conda.sh
474
- conda activate examples
492
+ conda activate ${{ env.EXAMPLES_ENV_NAME }}
475
493
conda list
476
494
cd examples/pybind11
477
495
for d in $(find . -maxdepth 1 -type d -not -path ".")
@@ -498,13 +516,13 @@ jobs:
498
516
shell : bash -l {0}
499
517
run : |
500
518
source $CONDA/etc/profile.d/conda.sh
501
- conda activate examples
519
+ conda activate ${{ env.EXAMPLES_ENV_NAME }}
502
520
conda list
503
521
cd examples/cython
504
522
for d in $(find . -maxdepth 1 -type d -not -path ".")
505
523
do
506
524
pushd $d
507
- conda activate --stack build_env
525
+ conda activate --stack ${{ env.BUILD_ENV_NAME }}
508
526
python setup.py build_ext --inplace || exit 1
509
527
conda deactivate
510
528
python -m pytest tests || exit 1
@@ -514,13 +532,13 @@ jobs:
514
532
shell : bash -l {0}
515
533
run : |
516
534
source $CONDA/etc/profile.d/conda.sh
517
- conda activate examples
535
+ conda activate ${{ env.EXAMPLES_ENV_NAME }}
518
536
conda list
519
537
cd examples/c
520
538
for d in $(find . -maxdepth 1 -type d -not -path ".")
521
539
do
522
540
pushd $d
523
- conda activate --stack build_env
541
+ conda activate --stack ${{ env.BUILD_ENV_NAME }}
524
542
python setup.py build_ext --inplace || exit 1
525
543
conda deactivate
526
544
python -m pytest tests || exit 1
@@ -531,7 +549,7 @@ jobs:
531
549
run : |
532
550
cd examples/python
533
551
source $CONDA/etc/profile.d/conda.sh
534
- conda activate examples
552
+ conda activate ${{ env.EXAMPLES_ENV_NAME }}
535
553
for script in $(find . \( -not -name "_*" -and -name "*.py" \))
536
554
do
537
555
echo "Executing ${script}"
@@ -599,7 +617,7 @@ jobs:
599
617
run : |
600
618
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
601
619
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
602
- conda create -n test_dpctl $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
620
+ conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
603
621
cat lockfile
604
622
- name : Set pkgs_dirs
605
623
run : |
@@ -619,14 +637,14 @@ jobs:
619
637
run : |
620
638
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
621
639
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
622
- conda create -n test_dpctl $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
640
+ conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
623
641
# Test installed packages
624
642
conda list
625
643
- name : Install array API test dependencies
626
644
shell : bash -l {0}
627
645
run : |
628
646
. $CONDA/etc/profile.d/conda.sh
629
- conda activate test_dpctl
647
+ conda activate ${{ env.TEST_ENV_NAME }}
630
648
cd /home/runner/work/array-api-tests
631
649
pip install -r requirements.txt
632
650
- name : Install jq
@@ -641,7 +659,7 @@ jobs:
641
659
run : |
642
660
FILE=/home/runner/work/.report.json
643
661
. $CONDA/etc/profile.d/conda.sh
644
- conda activate test_dpctl
662
+ conda activate ${{ env.TEST_ENV_NAME }}
645
663
cd /home/runner/work/array-api-tests
646
664
${CONDA_PREFIX}/bin/python -c "import dpctl; dpctl.lsplatform()"
647
665
export ARRAY_API_TESTS_MODULE=dpctl.tensor
0 commit comments