@@ -210,7 +210,7 @@ jobs:
210210
211211 - name : Smoke test
212212 run : |
213- python -c "import dpnp, dpctl; dpctl.lsplatform()"
213+ python -c "import dpctl; dpctl.lsplatform()"
214214 python -c "import dpnp; print(dpnp.__version__)"
215215
216216 - name : Run tests
@@ -350,7 +350,7 @@ jobs:
350350
351351 - name : Smoke test
352352 run : |
353- python -c "import dpnp, dpctl; dpctl.lsplatform()"
353+ python -c "import dpctl; dpctl.lsplatform()"
354354 python -c "import dpnp; print(dpnp.__version__)"
355355
356356 - name : Run tests
@@ -432,6 +432,190 @@ jobs:
432432 env :
433433 ANACONDA_TOKEN : ${{ secrets.ANACONDA_TOKEN }}
434434
435+ array-api-conformity :
436+ name : Array API conformity
437+
438+ needs : build
439+
440+ permissions :
441+ # Needed to add a comment to a pull request's issue
442+ pull-requests : write
443+
444+ strategy :
445+ matrix :
446+ python : ['3.12']
447+ os : [ubuntu-22.04]
448+
449+ runs-on : ${{ matrix.os }}
450+
451+ defaults :
452+ run :
453+ shell : bash -el {0}
454+
455+ continue-on-error : true
456+
457+ env :
458+ array-api-tests-path : ' ${{ github.workspace }}/array-api-tests/'
459+ json-report-file : ' ${{ github.workspace }}/.report.json'
460+ dpnp-repo-path : ' ${{ github.workspace }}/dpnp/'
461+ array-api-skips-file : ' ${{ github.workspace }}/dpnp/.github/workflows/array-api-skips.txt'
462+ channel-path : ' ${{ github.workspace }}/channel/'
463+ pkg-path-in-channel : ' ${{ github.workspace }}/channel/linux-64/'
464+ extracted-pkg-path : ' ${{ github.workspace }}/pkg/'
465+ ver-json-path : ' ${{ github.workspace }}/version.json'
466+
467+ steps :
468+ - name : Download artifact
469+ uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
470+ with :
471+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
472+ path : ${{ env.pkg-path-in-channel }}
473+
474+ - name : Extract package archive
475+ run : |
476+ mkdir -p ${{ env.extracted-pkg-path }}
477+ tar -xvf ${{ env.pkg-path-in-channel }}/${{ env.PACKAGE_NAME }}-*.tar.bz2 -C ${{ env.extracted-pkg-path }}
478+
479+ - name : Setup miniconda
480+ id : setup_miniconda
481+ continue-on-error : true
482+ uses : conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
483+ with :
484+ miniforge-version : latest
485+ use-mamba : ' true'
486+ channels : conda-forge
487+ conda-remove-defaults : ' true'
488+ python-version : ${{ matrix.python }}
489+ activate-environment : ' array-api-conformity'
490+
491+ - name : ReSetup miniconda
492+ if : steps.setup_miniconda.outcome == 'failure'
493+ uses : conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
494+ with :
495+ miniforge-version : latest
496+ use-mamba : ' true'
497+ channels : conda-forge
498+ conda-remove-defaults : ' true'
499+ python-version : ${{ matrix.python }}
500+ activate-environment : ' array-api-conformity'
501+
502+ - name : Install conda-index
503+ id : install_conda_index
504+ continue-on-error : true
505+ run : mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
506+
507+ - name : ReInstall conda-index
508+ if : steps.install_conda_index.outcome == 'failure'
509+ run : mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
510+
511+ - name : Create conda channel
512+ run : |
513+ python -m conda_index ${{ env.channel-path }}
514+
515+ - name : Test conda channel
516+ run : |
517+ conda search ${{ env.PACKAGE_NAME }} -c ${{ env.channel-path }} --override-channels --info --json > ${{ env.ver-json-path }}
518+ cat ${{ env.ver-json-path }}
519+
520+ - name : Get package version
521+ run : |
522+ export PACKAGE_VERSION=$(python -c "${{ env.VER_SCRIPT1 }} ${{ env.VER_SCRIPT2 }}")
523+
524+ echo PACKAGE_VERSION=${PACKAGE_VERSION}
525+ echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
526+
527+ - name : Install dpnp
528+ id : install_dpnp
529+ continue-on-error : true
530+ run : |
531+ mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
532+ env :
533+ TEST_CHANNELS : ' -c ${{ env.channel-path }} ${{ env.CHANNELS }}'
534+
535+ - name : ReInstall dpnp
536+ if : steps.install_dpnp.outcome == 'failure'
537+ run : |
538+ mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
539+ env :
540+ TEST_CHANNELS : ' -c ${{ env.channel-path }} ${{ env.CHANNELS }}'
541+
542+ - name : List installed packages
543+ run : mamba list
544+
545+ - name : Smoke test
546+ run : |
547+ python -c "import dpctl; dpctl.lsplatform()"
548+ python -c "import dpnp; print(dpnp.__version__)"
549+
550+ - name : Clone array API tests repo
551+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
552+ with :
553+ repository : ' data-apis/array-api-tests'
554+ path : ${{ env.array-api-tests-path }}
555+ fetch-depth : 0
556+ submodules : ' recursive'
557+
558+ - name : Install array API test dependencies
559+ run : |
560+ pip install -r requirements.txt
561+ working-directory : ${{ env.array-api-tests-path }}
562+
563+ - name : Install jq
564+ run : |
565+ sudo apt-get install jq
566+
567+ - name : List installed packages
568+ run : mamba list
569+
570+ - name : Smoke test
571+ run : |
572+ python -c "import dpctl; dpctl.lsplatform()"
573+ python -c "import dpnp; print(dpnp.__version__)"
574+
575+ # need to fetch array-api-skips.txt
576+ - name : Checkout DPNP repo
577+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
578+ with :
579+ path : ${{ env.dpnp-repo-path }}
580+
581+ - name : Run array API conformance tests
582+ run : |
583+ python -m pytest --json-report --json-report-file=${{ env.json-report-file }} --disable-deadline --skips-file ${{ env.array-api-skips-file }} array_api_tests || true
584+ env :
585+ ARRAY_API_TESTS_MODULE : ' dpnp'
586+ SYCL_CACHE_PERSISTENT : 1
587+ working-directory : ${{ env.array-api-tests-path }}
588+
589+ - name : Set Github environment variables
590+ run : |
591+ FILE=${{ env.json-report-file }}
592+ if test -f "$FILE"; then
593+ PASSED_TESTS=$(jq '.summary | .passed // 0' $FILE)
594+ FAILED_TESTS=$(jq '.summary | .failed // 0' $FILE)
595+ SKIPPED_TESTS=$(jq '.summary | .skipped // 0' $FILE)
596+ MESSAGE="Array API standard conformance tests for dpnp=$PACKAGE_VERSION ran successfully.
597+ Passed: $PASSED_TESTS
598+ Failed: $FAILED_TESTS
599+ Skipped: $SKIPPED_TESTS"
600+ echo "MESSAGE<<EOF" >> $GITHUB_ENV
601+ echo "$MESSAGE" >> $GITHUB_ENV
602+ echo "EOF" >> $GITHUB_ENV
603+ else
604+ echo "Array API standard conformance tests failed to run for dpnp=$PACKAGE_VERSION."
605+ exit 1
606+ fi
607+
608+ - name : Output API summary
609+ run : echo "::notice ${{ env.MESSAGE }}"
610+
611+ - name : Post result to PR
612+ if : ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork }}
613+ uses : mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2
614+ with :
615+ message : |
616+ ${{ env.MESSAGE }}
617+ refresh-message-position : true
618+
435619 cleanup_packages :
436620 name : Clean up anaconda packages
437621
0 commit comments