|
| 1 | +name: Test oneMKL interfaces |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + |
| 9 | +permissions: read-all |
| 10 | + |
| 11 | +env: |
| 12 | + CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels' |
| 13 | + BUILD_DEP_PKGS: >- |
| 14 | + mkl-devel-dpcpp |
| 15 | + tbb-devel |
| 16 | + dpctl |
| 17 | + onedpl-devel |
| 18 | + setuptools |
| 19 | + numpy">=2.0" |
| 20 | + cython |
| 21 | + cmake |
| 22 | + ninja |
| 23 | + scikit-build |
| 24 | +
|
| 25 | +jobs: |
| 26 | + build_and_test: |
| 27 | + name: Run on ['${{ matrix.os }}', python='${{ matrix.python }}'] |
| 28 | + |
| 29 | + strategy: |
| 30 | + matrix: |
| 31 | + python: ['3.12'] |
| 32 | + os: [ubuntu-22.04, windows-2019] |
| 33 | + |
| 34 | + permissions: |
| 35 | + # Needed to cancel any previous runs that are not completed for a given workflow |
| 36 | + actions: write |
| 37 | + |
| 38 | + runs-on: ${{ matrix.os }} |
| 39 | + |
| 40 | + defaults: |
| 41 | + run: |
| 42 | + shell: ${{ matrix.os == 'windows-2019' && 'cmd /C CALL {0}' || 'bash -el {0}' }} |
| 43 | + |
| 44 | + continue-on-error: true |
| 45 | + |
| 46 | + steps: |
| 47 | + - name: Cancel Previous Runs |
| 48 | + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1 |
| 49 | + with: |
| 50 | + access_token: ${{ github.token }} |
| 51 | + |
| 52 | + - name: Checkout DPNP repo |
| 53 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 54 | + with: |
| 55 | + fetch-depth: 0 |
| 56 | + |
| 57 | + - name: Setup miniconda |
| 58 | + uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0 |
| 59 | + with: |
| 60 | + miniforge-version: latest |
| 61 | + use-mamba: 'true' |
| 62 | + channels: conda-forge |
| 63 | + conda-remove-defaults: 'true' |
| 64 | + python-version: ${{ matrix.python }} |
| 65 | + activate-environment: 'test_onemkl_interfaces' |
| 66 | + |
| 67 | + # Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba |
| 68 | + - name: Disable speed limit check in mamba |
| 69 | + run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV |
| 70 | + |
| 71 | + - name: Install dpnp build dependencies |
| 72 | + run: | |
| 73 | + mamba install ${{ env.DPCPP_PKG }} ${{ env.BUILD_DEP_PKGS }} ${{ env.CHANNELS }} |
| 74 | + env: |
| 75 | + DPCPP_PKG: ${{ matrix.os == 'windows-2019' && 'dpcpp_win-64 vs_win-64=2017.9' || 'dpcpp_linux-64' }} |
| 76 | + # DPCPP_PKG: dpcpp_${{ matrix.os == 'windows-2019' && 'win' || 'linux' }}-64 |
| 77 | + |
| 78 | + # - name: Conda info |
| 79 | + # run: | |
| 80 | + # mamba info |
| 81 | + # mamba list |
| 82 | + |
| 83 | + - name: Conda list |
| 84 | + run: | |
| 85 | + mamba list |
| 86 | +
|
| 87 | + - name: Build and install DPNP package |
| 88 | + run: | |
| 89 | + python scripts/build_locally.py --onemkl-interfaces --verbose |
| 90 | +
|
| 91 | + - name: Smoke test |
| 92 | + run: | |
| 93 | + python -m dpctl -f |
| 94 | + python -c "import dpnp; print(dpnp.__version__)" |
| 95 | +
|
| 96 | + - name: Install pytest |
| 97 | + run: | |
| 98 | + mamba install pytest ${{ env.CHANNELS }} |
| 99 | +
|
| 100 | + - name: Run tests |
| 101 | + run: | |
| 102 | + python -m pytest -ra --pyargs dpnp.tests |
| 103 | + env: |
| 104 | + SYCL_CACHE_PERSISTENT: 1 |
0 commit comments