Repository navigation
Fix dpnp.__all__ missing ndarray and __array_namespace_info__
#8578
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Generate coverage data for dpnp | |
| on: | |
| pull_request: | |
| push: | |
| branches: [master] | |
| permissions: read-all | |
| jobs: | |
| generate-coverage: | |
| name: Generate coverage and push to Coveralls.io | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 180 | |
| permissions: | |
| # Needed to cancel any previous runs that are not completed for a given workflow | |
| actions: write | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| env: | |
| environment-file: 'environments/environment.yml' | |
| build-with-oneapi-env: 'environments/build_with_oneapi.yml' | |
| coverage-env: 'environments/coverage.yml' | |
| test-pkg-env: 'environments/test.yml' | |
| oneapi-pkgs-env: '' | |
| # Enable env when it's required to use only conda packages without OneAPI installation | |
| # oneapi-pkgs-env: '${{ github.workspace }}/environments/oneapi_pkgs.yml' | |
| dpctl-pkg-txt: 'environments/dpctl_pkg.txt' | |
| steps: | |
| - name: Cancel Previous Runs | |
| uses: styfle/cancel-workflow-action@d07a454dad7609a92316b57b23c9ccfd4f59af66 # 0.13.1 | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: Add Intel repository | |
| if: env.oneapi-pkgs-env == '' | |
| run: | | |
| wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
| < GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null | |
| rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
| echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | |
| sudo apt update | |
| - name: Install latest Intel OneAPI | |
| if: env.oneapi-pkgs-env == '' | |
| run: | | |
| sudo apt install hwloc \ | |
| intel-oneapi-mkl \ | |
| intel-oneapi-umf \ | |
| intel-oneapi-mkl-devel \ | |
| intel-oneapi-tbb-devel \ | |
| intel-oneapi-libdpstd-devel \ | |
| intel-oneapi-compiler-dpcpp-cpp | |
| - name: Checkout repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Install conda-merge tool | |
| uses: BSFishy/pip-action@8f2d471d809dc20b6ada98c91910b6ae6243f318 # v1 | |
| with: | |
| packages: conda-merge | |
| - name: Merge conda env files | |
| run: | | |
| conda-merge ${{ env.build-with-oneapi-env }} \ | |
| ${{ env.coverage-env }} \ | |
| ${{ env.oneapi-pkgs-env }} \ | |
| ${{ env.test-pkg-env }} > ${{ env.environment-file }} | |
| cat ${{ env.environment-file }} | |
| - name: Setup miniconda | |
| id: setup_miniconda | |
| continue-on-error: true | |
| uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0 | |
| with: | |
| miniforge-version: latest | |
| use-mamba: 'true' | |
| conda-remove-defaults: 'true' | |
| environment-file: ${{ env.environment-file }} | |
| activate-environment: 'coverage' | |
| - name: ReSetup miniconda | |
| if: steps.setup_miniconda.outcome == 'failure' | |
| uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0 | |
| with: | |
| miniforge-version: latest | |
| use-mamba: 'true' | |
| conda-remove-defaults: 'true' | |
| environment-file: ${{ env.environment-file }} | |
| activate-environment: 'coverage' | |
| # We can't install dpctl as a conda package when the environment is created through | |
| # installing of Intel OneAPI packages because the dpctl conda package has a runtime | |
| # dependency on DPC++ RT one. Whereas the DPC++ RT package has beedn already installed | |
| # by the apt command above and its version has been matched with the DPC++ compiler. | |
| # In case where we install the DPC++ compiler with the apt (including DPC++ RT) and | |
| # install the DPC++ RT conda package while resolving dependencies, this can lead | |
| # to a versioning error, i.e. compatibility issue as the DPC++ compiler only guarantees | |
| # backwards compatibility, not forward compatibility (DPC++ RT may not run a binary built | |
| # with a newer version of the DPC++ compiler). | |
| # Installing dpctl via the pip manager has no such limitation, as the package has no | |
| # run dependency on the DPC++ RT pip package, so this is why the step is necessary here. | |
| - name: Install dpctl | |
| if: env.oneapi-pkgs-env == '' | |
| run: | | |
| pip install -r ${{ env.dpctl-pkg-txt }} | |
| - name: Conda info | |
| run: | | |
| mamba info | |
| mamba list | |
| - name: Build dpnp with coverage | |
| timeout-minutes: 60 | |
| run: | | |
| [ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh | |
| python scripts/gen_coverage.py --stage build | |
| - name: Run dpnp tests with coverage | |
| id: dpnp_tests | |
| uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 | |
| with: | |
| shell: bash | |
| timeout_minutes: 90 | |
| max_attempts: 2 | |
| retry_on: error | |
| command: | | |
| . $CONDA/etc/profile.d/conda.sh | |
| conda activate coverage | |
| [ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh | |
| python scripts/gen_coverage.py --stage dpnp-tests | |
| - name: Run dpnp.tensor tests with coverage | |
| id: tensor_tests | |
| uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 | |
| with: | |
| shell: bash | |
| timeout_minutes: 30 | |
| max_attempts: 3 | |
| # also retry on timeout, the tests may hang | |
| retry_on: any | |
| command: | | |
| . $CONDA/etc/profile.d/conda.sh | |
| conda activate coverage | |
| [ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh | |
| python scripts/gen_coverage.py --stage tensor-tests | |
| - name: Total number of coverage attempts | |
| if: ${{ !cancelled() }} | |
| run: | | |
| echo "dpnp tests attempts: ${{ steps.dpnp_tests.outputs.total_attempts }}" | |
| echo "dpnp.tensor tests attempts: ${{ steps.tensor_tests.outputs.total_attempts }}" | |
| - name: Generate coverage reports | |
| run: | | |
| [ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh | |
| python scripts/gen_coverage.py --stage report | |
| - name: Upload coverage data to coveralls.io | |
| uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} |