Skip to content

Commit e7aa130

Browse files
committed
Add GH action to check build with oneMKL interfaces
1 parent 11771fb commit e7aa130

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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: dpcpp_${{ matrix.os == 'windows-2019' && 'win' || 'linux' }}-64
76+
77+
# - name: Conda info
78+
# run: |
79+
# mamba info
80+
# mamba list
81+
82+
- name: Conda list
83+
run: |
84+
mamba list
85+
86+
- name: Build and install DPNP package
87+
run: |
88+
python scripts/build_locally.py --onemkl-interfaces --verbose
89+
90+
- name: Smoke test
91+
run: |
92+
python -m dpctl -f
93+
python -c "import dpnp; print(dpnp.__version__)"
94+
95+
- name: Install pytest
96+
run: |
97+
mamba install pytest ${{ env.CHANNELS }}
98+
99+
- name: Run tests
100+
run: |
101+
python -m pytest -ra --pyargs dpnp.tests
102+
env:
103+
SYCL_CACHE_PERSISTENT: 1

0 commit comments

Comments
 (0)