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