@@ -189,7 +189,7 @@ jobs:
189
189
id : install_dpnp
190
190
continue-on-error : true
191
191
run : |
192
- mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
192
+ mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest pytest-xdist python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
193
193
env :
194
194
TEST_CHANNELS : ' -c ${{ env.channel-path }} ${{ env.CHANNELS }}'
195
195
@@ -211,7 +211,7 @@ jobs:
211
211
- name : Run tests
212
212
if : env.RERUN_TESTS_ON_FAILURE != 'true'
213
213
run : |
214
- python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
214
+ python -m pytest -n auto - ra --pyargs ${{ env.PACKAGE_NAME }}.tests
215
215
216
216
- name : Run tests
217
217
if : env.RERUN_TESTS_ON_FAILURE == 'true'
@@ -226,7 +226,112 @@ jobs:
226
226
. $CONDA/etc/profile.d/mamba.sh
227
227
mamba activate ${{ env.TEST_ENV_NAME }}
228
228
229
- python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
229
+ python -m pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
230
+
231
+ test_linux_all_dtypes :
232
+ name : Test_All_dtypes
233
+
234
+ needs : build
235
+
236
+ runs-on : ${{ matrix.os }}
237
+
238
+ defaults :
239
+ run :
240
+ shell : bash -el {0}
241
+
242
+ strategy :
243
+ fail-fast : false
244
+ matrix :
245
+ python : ['3.12']
246
+ os : [ubuntu-latest]
247
+
248
+ env :
249
+ channel-path : ' ${{ github.workspace }}/channel/'
250
+ pkg-path-in-channel : ' ${{ github.workspace }}/channel/linux-64/'
251
+ ver-json-path : ' ${{ github.workspace }}/version.json'
252
+
253
+ steps :
254
+ - name : Download artifact
255
+ uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
256
+ with :
257
+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
258
+ path : ${{ env.pkg-path-in-channel }}
259
+
260
+ - name : Setup miniconda
261
+ id : setup_miniconda
262
+ continue-on-error : true
263
+ uses : conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
264
+ with :
265
+ miniforge-version : latest
266
+ use-mamba : ' true'
267
+ channels : conda-forge
268
+ conda-remove-defaults : ' true'
269
+ python-version : ${{ env.CONDA_BUILD_INDEX_ENV_PY_VER}}
270
+ activate-environment : ${{ env.TEST_ENV_NAME }}
271
+
272
+ - name : ReSetup miniconda
273
+ if : steps.setup_miniconda.outcome == 'failure'
274
+ uses : conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
275
+ with :
276
+ miniforge-version : latest
277
+ use-mamba : ' true'
278
+ channels : conda-forge
279
+ conda-remove-defaults : ' true'
280
+ python-version : ${{ env.CONDA_BUILD_INDEX_ENV_PY_VER}}
281
+ activate-environment : ${{ env.TEST_ENV_NAME }}
282
+
283
+ - name : Install conda-index
284
+ run : |
285
+ mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
286
+
287
+ - name : Create conda channel
288
+ run : |
289
+ python -m conda_index ${{ env.channel-path }}
290
+
291
+ - name : Test conda channel
292
+ run : |
293
+ conda search ${{ env.PACKAGE_NAME }} -c ${{ env.channel-path }} --override-channels --info --json > ${{ env.ver-json-path }}
294
+ cat ${{ env.ver-json-path }}
295
+
296
+ - name : Get package version
297
+ run : |
298
+ export PACKAGE_VERSION=$(python -c "${{ env.VER_SCRIPT1 }} ${{ env.VER_SCRIPT2 }}")
299
+
300
+ echo PACKAGE_VERSION=${PACKAGE_VERSION}
301
+ echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
302
+
303
+ # conda-index does not support python 3.13
304
+ - name : Remove conda-index
305
+ run : mamba remove conda-index
306
+
307
+ - name : Install dpnp
308
+ id : install_dpnp
309
+ continue-on-error : true
310
+ run : |
311
+ mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
312
+ env :
313
+ TEST_CHANNELS : ' -c ${{ env.channel-path }} ${{ env.CHANNELS }}'
314
+
315
+ - name : ReInstall dpnp
316
+ if : steps.install_dpnp.outcome == 'failure'
317
+ run : |
318
+ mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
319
+ env :
320
+ TEST_CHANNELS : ' -c ${{ env.channel-path }} ${{ env.CHANNELS }}'
321
+
322
+ - name : List installed packages
323
+ run : mamba list
324
+
325
+ - name : Smoke test
326
+ run : |
327
+ python -c "import dpctl; dpctl.lsplatform()"
328
+ python -c "import dpnp; print(dpnp.__version__)"
329
+
330
+ - name : Run tests for all dtypes
331
+ env :
332
+ DPNP_TEST_ALL_INT_TYPES : 1
333
+ run : |
334
+ python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
230
335
231
336
test_windows :
232
337
name : Test
@@ -319,7 +424,7 @@ jobs:
319
424
- name : Install dpnp
320
425
run : |
321
426
@echo on
322
- mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
427
+ mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest pytest-xdist python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
323
428
env :
324
429
TEST_CHANNELS : ' -c ${{ env.channel-path }} ${{ env.CHANNELS }}'
325
430
MAMBA_NO_LOW_SPEED_LIMIT : 1
@@ -348,7 +453,7 @@ jobs:
348
453
- name : Run tests
349
454
if : env.RERUN_TESTS_ON_FAILURE != 'true'
350
455
run : |
351
- pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
456
+ python -m pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
352
457
353
458
- name : Run tests
354
459
if : env.RERUN_TESTS_ON_FAILURE == 'true'
@@ -359,7 +464,130 @@ jobs:
359
464
max_attempts : ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
360
465
retry_on : any
361
466
command : |
362
- python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
467
+ python -m pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
468
+
469
+ test_windows_all_dtypes :
470
+ name : Test_All_dtypes
471
+
472
+ needs : build
473
+
474
+ runs-on : ${{ matrix.os }}
475
+
476
+ defaults :
477
+ run :
478
+ shell : cmd /C CALL {0}
479
+
480
+ strategy :
481
+ fail-fast : false
482
+ matrix :
483
+ python : ['3.12']
484
+ os : [windows-2019]
485
+
486
+ env :
487
+ channel-path : ' ${{ github.workspace }}\channel\'
488
+ pkg-path-in-channel : ' ${{ github.workspace }}\channel\win-64\'
489
+ ver-json-path : ' ${{ github.workspace }}\version.json'
490
+ workdir : ' ${{ github.workspace }}'
491
+
492
+ steps :
493
+ - name : Download artifact
494
+ uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
495
+ with :
496
+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
497
+ path : ${{ env.pkg-path-in-channel }}
498
+
499
+ - name : Store a path to package archive
500
+ run : |
501
+ @echo on
502
+
503
+ set SEARCH_SCRIPT="DIR ${{ env.pkg-path-in-channel }} /s/b | FINDSTR /r "dpnp-.*\.conda""
504
+ FOR /F "tokens=* USEBACKQ" %%F IN (`%SEARCH_SCRIPT%`) DO (
505
+ SET FULL_PACKAGE_PATH=%%F
506
+ )
507
+ echo FULL_PACKAGE_PATH: %FULL_PACKAGE_PATH%
508
+ (echo FULL_PACKAGE_PATH=%FULL_PACKAGE_PATH%) >> %GITHUB_ENV%
509
+
510
+ - name : Setup miniconda
511
+ uses : conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
512
+ with :
513
+ miniforge-version : latest
514
+ use-mamba : ' true'
515
+ channels : conda-forge
516
+ conda-remove-defaults : ' true'
517
+ python-version : ${{ env.CONDA_BUILD_INDEX_ENV_PY_VER}}
518
+ activate-environment : ${{ env.TEST_ENV_NAME }}
519
+
520
+ - name : Store conda paths as envs
521
+ run : |
522
+ @echo on
523
+ (echo CONDA_LIB_PATH=%CONDA_PREFIX%\Library\lib\) >> %GITHUB_ENV%
524
+ (echo CONDA_LIB_BIN_PATH=%CONDA_PREFIX%\Library\bin\) >> %GITHUB_ENV%
525
+
526
+ - name : Install conda-index
527
+ run : |
528
+ mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
529
+
530
+ - name : Create conda channel
531
+ run : |
532
+ @echo on
533
+ python -m conda_index ${{ env.channel-path }}
534
+
535
+ - name : Test conda channel
536
+ run : |
537
+ @echo on
538
+ conda search ${{ env.PACKAGE_NAME }} -c ${{ env.channel-path }} --override-channels --info --json > ${{ env.ver-json-path }}
539
+
540
+ - name : Dump version.json
541
+ run : more ${{ env.ver-json-path }}
542
+
543
+ - name : Get package version
544
+ run : |
545
+ @echo on
546
+ set "SCRIPT=${{ env.VER_SCRIPT1 }} ${{ env.VER_SCRIPT2 }}"
547
+ FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
548
+ set PACKAGE_VERSION=%%F
549
+ )
550
+ echo PACKAGE_VERSION: %PACKAGE_VERSION%
551
+ (echo PACKAGE_VERSION=%PACKAGE_VERSION%) >> %GITHUB_ENV%
552
+
553
+ # conda-index does not support python 3.13
554
+ - name : Remove conda-index
555
+ run : mamba remove conda-index
556
+
557
+ - name : Install dpnp
558
+ run : |
559
+ @echo on
560
+ mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
561
+ env :
562
+ TEST_CHANNELS : ' -c ${{ env.channel-path }} ${{ env.CHANNELS }}'
563
+ MAMBA_NO_LOW_SPEED_LIMIT : 1
564
+
565
+ - name : List installed packages
566
+ run : mamba list
567
+
568
+ - name : Activate OCL CPU RT
569
+ shell : pwsh
570
+ run : |
571
+ $script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
572
+ if (Test-Path $script_path) {
573
+ &$script_path
574
+ } else {
575
+ Write-Warning "File $script_path was NOT found!"
576
+ }
577
+ # Check the variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
578
+ $cl_cfg="$env:CONDA_PREFIX\Library\lib\cl.cfg"
579
+ Get-Content -Tail 5 -Path $cl_cfg
580
+
581
+ - name : Smoke test
582
+ run : |
583
+ python -c "import dpctl; dpctl.lsplatform()"
584
+ python -c "import dpnp; print(dpnp.__version__)"
585
+
586
+ - name : Run tests for all dtypes
587
+ env :
588
+ DPNP_TEST_ALL_INT_TYPES : 1
589
+ run : |
590
+ python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
363
591
364
592
upload :
365
593
name : Upload
0 commit comments