|
16 | 16 | CONDA_BUILD_INDEX_ENV_PY_VER: '3.12' # conda does not support python 3.13 |
17 | 17 | CONDA_BUILD_VERSION: '25.1.1' |
18 | 18 | CONDA_INDEX_VERSION: '0.5.0' |
| 19 | + LATEST_PYTHON: '3.13' |
19 | 20 | RERUN_TESTS_ON_FAILURE: 'true' |
20 | 21 | RUN_TESTS_MAX_ATTEMPTS: 2 |
21 | 22 | TEST_ENV_NAME: 'test' |
@@ -211,127 +212,32 @@ jobs: |
211 | 212 | - name: Run tests |
212 | 213 | if: env.RERUN_TESTS_ON_FAILURE != 'true' |
213 | 214 | run: | |
214 | | - python -m pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests |
| 215 | + if [[ ${{ matrix.python }} == ${{ env.LATEST_PYTHON }} ]]; then |
| 216 | + export DPNP_TEST_ALL_INT_TYPES=1 |
| 217 | + python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests |
| 218 | + else |
| 219 | + python -m pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests |
| 220 | + fi |
215 | 221 |
|
216 | 222 | - name: Run tests |
217 | 223 | if: env.RERUN_TESTS_ON_FAILURE == 'true' |
218 | 224 | id: run_tests_linux |
219 | 225 | uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0 |
220 | 226 | with: |
221 | | - timeout_minutes: 15 |
| 227 | + timeout_minutes: 25 |
222 | 228 | max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }} |
223 | 229 | retry_on: any |
224 | 230 | command: | |
225 | 231 | . $CONDA/etc/profile.d/conda.sh |
226 | 232 | . $CONDA/etc/profile.d/mamba.sh |
227 | 233 | mamba activate ${{ env.TEST_ENV_NAME }} |
228 | 234 |
|
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 |
| 235 | + if [[ ${{ matrix.python }} == ${{ env.LATEST_PYTHON }} ]]; then |
| 236 | + export DPNP_TEST_ALL_INT_TYPES=1 |
| 237 | + python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests |
| 238 | + else |
| 239 | + python -m pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests |
| 240 | + fi |
335 | 241 |
|
336 | 242 | test_windows: |
337 | 243 | name: Test |
@@ -453,141 +359,28 @@ jobs: |
453 | 359 | - name: Run tests |
454 | 360 | if: env.RERUN_TESTS_ON_FAILURE != 'true' |
455 | 361 | run: | |
456 | | - python -m pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests |
| 362 | + if [[ ${{ matrix.python }} == ${{ env.LATEST_PYTHON }} ]]; then |
| 363 | + set DPNP_TEST_ALL_INT_TYPES=1 |
| 364 | + python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests |
| 365 | + else |
| 366 | + python -m pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests |
| 367 | + fi |
457 | 368 |
|
458 | 369 | - name: Run tests |
459 | 370 | if: env.RERUN_TESTS_ON_FAILURE == 'true' |
460 | 371 | id: run_tests_win |
461 | 372 | uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0 |
462 | 373 | with: |
463 | | - timeout_minutes: 17 |
| 374 | + timeout_minutes: 35 |
464 | 375 | max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }} |
465 | 376 | retry_on: any |
466 | 377 | command: | |
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 |
| 378 | + if [[ ${{ matrix.python }} == ${{ env.LATEST_PYTHON }} ]]; then |
| 379 | + set DPNP_TEST_ALL_INT_TYPES=1 |
| 380 | + python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests |
| 381 | + else |
| 382 | + python -m pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests |
| 383 | + fi |
591 | 384 |
|
592 | 385 | upload: |
593 | 386 | name: Upload |
|
0 commit comments