@@ -159,7 +159,7 @@ jobs:
159
159
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
160
160
161
161
- name : Install dpnp
162
- run : mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
162
+ run : mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest pytest-xdist python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
163
163
env :
164
164
TEST_CHANNELS : ' -c ${{ env.channel-path }} ${{ env.CHANNELS }}'
165
165
MAMBA_NO_LOW_SPEED_LIMIT : 1
@@ -175,7 +175,7 @@ jobs:
175
175
- name : Run tests
176
176
if : env.RERUN_TESTS_ON_FAILURE != 'true'
177
177
run : |
178
- python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
178
+ python -m pytest -n auto - ra --pyargs ${{ env.PACKAGE_NAME }}.tests
179
179
180
180
- name : Run tests
181
181
if : env.RERUN_TESTS_ON_FAILURE == 'true'
@@ -190,7 +190,91 @@ jobs:
190
190
. $CONDA/etc/profile.d/mamba.sh
191
191
mamba activate ${{ env.TEST_ENV_NAME }}
192
192
193
- python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
193
+ python -m pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
194
+
195
+ test_linux_all_dtypes :
196
+ name : Test ['ubuntu-latest', python='${{ matrix.python }}']
197
+
198
+ needs : build
199
+
200
+ runs-on : ubuntu-latest
201
+
202
+ defaults :
203
+ run :
204
+ shell : bash -el {0}
205
+
206
+ strategy :
207
+ matrix :
208
+ python : ['3.12']
209
+
210
+ continue-on-error : true
211
+
212
+ env :
213
+ channel-path : ' ${{ github.workspace }}/channel/'
214
+ pkg-path-in-channel : ' ${{ github.workspace }}/channel/linux-64/'
215
+ extracted-pkg-path : ' ${{ github.workspace }}/pkg/'
216
+ ver-json-path : ' ${{ github.workspace }}/version.json'
217
+
218
+ steps :
219
+ - name : Download artifact
220
+ uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
221
+ with :
222
+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
223
+ path : ${{ env.pkg-path-in-channel }}
224
+
225
+ - name : Extract package archive
226
+ run : |
227
+ mkdir -p ${{ env.extracted-pkg-path }}
228
+ tar -xvf ${{ env.pkg-path-in-channel }}/${{ env.PACKAGE_NAME }}-*.tar.bz2 -C ${{ env.extracted-pkg-path }}
229
+
230
+ - name : Setup miniconda
231
+ uses : conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
232
+ with :
233
+ miniforge-version : latest
234
+ use-mamba : ' true'
235
+ channels : conda-forge
236
+ conda-remove-defaults : ' true'
237
+ python-version : ${{ matrix.python }}
238
+ activate-environment : ${{ env.TEST_ENV_NAME }}
239
+
240
+ - name : Install conda-index
241
+ run : mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
242
+
243
+ - name : Create conda channel
244
+ run : |
245
+ python -m conda_index ${{ env.channel-path }}
246
+
247
+ - name : Test conda channel
248
+ run : |
249
+ mamba search ${{ env.PACKAGE_NAME }} -c ${{ env.channel-path }} --override-channels --info --json > ${{ env.ver-json-path }}
250
+ cat ${{ env.ver-json-path }}
251
+
252
+ - name : Get package version
253
+ run : |
254
+ export PACKAGE_VERSION=$(python -c "${{ env.VER_SCRIPT1 }} ${{ env.VER_SCRIPT2 }}")
255
+
256
+ echo PACKAGE_VERSION=${PACKAGE_VERSION}
257
+ echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
258
+
259
+ - name : Install dpnp
260
+ run : mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest pytest-xdist python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
261
+ env :
262
+ TEST_CHANNELS : ' -c ${{ env.channel-path }} ${{ env.CHANNELS }}'
263
+ MAMBA_NO_LOW_SPEED_LIMIT : 1
264
+
265
+ - name : List installed packages
266
+ run : mamba list
267
+
268
+ - name : Smoke test
269
+ run : |
270
+ python -c "import dpnp, dpctl; dpctl.lsplatform()"
271
+ python -c "import dpnp; print(dpnp.__version__)"
272
+
273
+ - name : Run full tests
274
+ env :
275
+ DPNP_TEST_ALL_INT_TYPES : 1
276
+ run : |
277
+ pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
194
278
195
279
test_windows :
196
280
name : Test ['windows-2019', python='${{ matrix.python }}']
@@ -282,7 +366,7 @@ jobs:
282
366
- name : Install dpnp
283
367
run : |
284
368
@echo on
285
- mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
369
+ mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest pytest-xdist python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
286
370
env :
287
371
TEST_CHANNELS : ' -c ${{ env.channel-path }} ${{ env.CHANNELS }}'
288
372
MAMBA_NO_LOW_SPEED_LIMIT : 1
@@ -311,7 +395,7 @@ jobs:
311
395
- name : Run tests
312
396
if : env.RERUN_TESTS_ON_FAILURE != 'true'
313
397
run : |
314
- pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
398
+ pytest -n auto - ra --pyargs ${{ env.PACKAGE_NAME }}.tests
315
399
316
400
- name : Run tests
317
401
if : env.RERUN_TESTS_ON_FAILURE == 'true'
@@ -322,7 +406,130 @@ jobs:
322
406
max_attempts : ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
323
407
retry_on : any
324
408
command : |
325
- python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
409
+ python -m pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
410
+
411
+ test_windows_all_dtypes :
412
+ name : Test ['windows-2019', python='${{ matrix.python }}']
413
+
414
+ needs : build
415
+
416
+ runs-on : windows-2019
417
+
418
+ defaults :
419
+ run :
420
+ shell : cmd /C CALL {0}
421
+
422
+ strategy :
423
+ matrix :
424
+ python : ['3.12']
425
+
426
+ continue-on-error : true
427
+
428
+ env :
429
+ channel-path : ' ${{ github.workspace }}\channel\'
430
+ pkg-path-in-channel : ' ${{ github.workspace }}\channel\win-64\'
431
+ extracted-pkg-path : ' ${{ github.workspace }}\pkg'
432
+ ver-json-path : ' ${{ github.workspace }}\version.json'
433
+ workdir : ' ${{ github.workspace }}'
434
+
435
+ steps :
436
+ - name : Download artifact
437
+ uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
438
+ with :
439
+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
440
+ path : ${{ env.pkg-path-in-channel }}
441
+
442
+ - name : Extract package archive
443
+ run : |
444
+ @echo on
445
+ mkdir -p ${{ env.extracted-pkg-path }}
446
+
447
+ set SEARCH_SCRIPT="DIR ${{ env.pkg-path-in-channel }} /s/b | FINDSTR /r "dpnp-.*\.tar\.bz2""
448
+ FOR /F "tokens=* USEBACKQ" %%F IN (`%SEARCH_SCRIPT%`) DO (
449
+ SET FULL_PACKAGE_PATH=%%F
450
+ )
451
+ echo FULL_PACKAGE_PATH: %FULL_PACKAGE_PATH%
452
+
453
+ python -c "import shutil; shutil.unpack_archive(r\"%FULL_PACKAGE_PATH%\", extract_dir=r\"${{ env.extracted-pkg-path }}\")"
454
+ dir ${{ env.extracted-pkg-path }}
455
+
456
+ - name : Setup miniconda
457
+ uses : conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
458
+ with :
459
+ miniforge-version : latest
460
+ use-mamba : ' true'
461
+ channels : conda-forge
462
+ conda-remove-defaults : ' true'
463
+ python-version : ${{ matrix.python }}
464
+ activate-environment : ${{ env.TEST_ENV_NAME }}
465
+
466
+ - name : Store conda paths as envs
467
+ run : |
468
+ @echo on
469
+ (echo CONDA_LIB_PATH=%CONDA_PREFIX%\Library\lib\) >> %GITHUB_ENV%
470
+ (echo CONDA_LIB_BIN_PATH=%CONDA_PREFIX%\Library\bin\) >> %GITHUB_ENV%
471
+
472
+ - name : Install conda-index
473
+ run : mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
474
+
475
+ - name : Create conda channel
476
+ run : |
477
+ @echo on
478
+ python -m conda_index ${{ env.channel-path }}
479
+
480
+ - name : Test conda channel
481
+ run : |
482
+ @echo on
483
+ mamba search ${{ env.PACKAGE_NAME }} -c ${{ env.channel-path }} --override-channels --info --json > ${{ env.ver-json-path }}
484
+
485
+ - name : Dump version.json
486
+ run : more ${{ env.ver-json-path }}
487
+
488
+ - name : Get package version
489
+ run : |
490
+ @echo on
491
+ set "SCRIPT=${{ env.VER_SCRIPT1 }} ${{ env.VER_SCRIPT2 }}"
492
+ FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
493
+ set PACKAGE_VERSION=%%F
494
+ )
495
+ echo PACKAGE_VERSION: %PACKAGE_VERSION%
496
+ (echo PACKAGE_VERSION=%PACKAGE_VERSION%) >> %GITHUB_ENV%
497
+
498
+ - name : Install dpnp
499
+ run : |
500
+ @echo on
501
+ mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest pytest-xdist python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
502
+ env :
503
+ TEST_CHANNELS : ' -c ${{ env.channel-path }} ${{ env.CHANNELS }}'
504
+ MAMBA_NO_LOW_SPEED_LIMIT : 1
505
+
506
+ - name : List installed packages
507
+ run : mamba list
508
+
509
+ - name : Activate OCL CPU RT
510
+ shell : pwsh
511
+ run : |
512
+ $script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
513
+ if (Test-Path $script_path) {
514
+ &$script_path
515
+ } else {
516
+ Write-Warning "File $script_path was NOT found!"
517
+ }
518
+ # Check the variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
519
+ $cl_cfg="$env:CONDA_PREFIX\Library\lib\cl.cfg"
520
+ Get-Content -Tail 5 -Path $cl_cfg
521
+
522
+ - name : Smoke test
523
+ run : |
524
+ python -c "import dpnp, dpctl; dpctl.lsplatform()"
525
+ python -c "import dpnp; print(dpnp.__version__)"
526
+
527
+ - name : Run full tests
528
+ if : matrix.python == '3.12'
529
+ env :
530
+ DPNP_TEST_ALL_INT_TYPES : 1
531
+ run : |
532
+ pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
326
533
327
534
upload :
328
535
name : Upload ['${{ matrix.os }}', python='${{ matrix.python }}']
0 commit comments