Skip to content

Commit ec8cb09

Browse files
test_example job needs scikit-build
1 parent 093d057 commit ec8cb09

File tree

1 file changed

+42
-17
lines changed

1 file changed

+42
-17
lines changed

.github/workflows/conda-package.yml

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ jobs:
317317
runs-on: ${{ matrix.runner }}
318318
strategy:
319319
matrix:
320-
python: [3.8]
320+
python: [3.9]
321321
experimental: [false]
322322
runner: [ubuntu-latest]
323323
continue-on-error: ${{ matrix.experimental }}
@@ -363,39 +363,64 @@ jobs:
363363
restore-keys: |
364364
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
365365
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
366-
- name: Install dpctl
366+
- name: Install example requirements
367367
shell: bash -l {0}
368368
run: |
369+
CHANNELS="${{ env.CHANNELS }}"
369370
source $CONDA/etc/profile.d/conda.sh
370-
conda activate
371-
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
372-
conda install -y $PACKAGE_NAME pytest python=${{ matrix.python }} $CHANNELS
373-
# Test installed packages
374-
conda list
375-
- name: Install example requirements
371+
conda create -n examples -y pytest python=${{ matrix.python }} $CHANNELS
372+
conda install -n examples -y cmake">=3.22" $CHANNELS || exit 1
373+
conda install -n examples -y ninja $CHANNELS || exit 1
374+
conda install -n examples -y pybind11 cython scikit-build $CHANNELS || exit 1
375+
conda install -n examples -y mkl-dpcpp mkl-devel-dpcpp dpcpp_cpp_rt $CHANNELS || exit 1
376+
conda list -n examples
377+
conda create -y -n build_env -c intel dpcpp_linux-64
378+
- name: Install dpctl
376379
shell: bash -l {0}
377380
run: |
378381
source $CONDA/etc/profile.d/conda.sh
379-
conda install -y pybind11 cython
380-
conda install -y -c intel mkl-dpcpp mkl-devel-dpcpp numba-dppy
381-
conda create -y -n build_env -c intel dpcpp_linux-64
382+
conda activate
383+
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel --override-channels"
384+
conda install -n examples -y $CHANNELS numba-dppy dpctl || exit 1
385+
# Test installed packages
386+
conda list -n examples
382387
- name: Build and run examples with native extensions
383388
shell: bash -l {0}
384389
run: |
385390
source $CONDA/etc/profile.d/conda.sh
386391
export OCL_ICD_FILENAMES=libintelocl.so
387392
export SYCL_ENABLE_HOST_DEVICE=1
388-
conda activate
393+
conda activate examples
394+
conda list
389395
cd examples/pybind11
390-
export CC=dpcpp
391-
export CXX=dpcpp
392396
for d in $(ls)
393397
do
394398
pushd $d
399+
export MKLROOT=${CONDA_PREFIX}
400+
export TBBROOT=${CONDA_PREFIX}
395401
conda activate --stack build_env
396-
python setup.py build_ext --inplace || exit 1
402+
if [ -e CMakeLists.txt ]
403+
then
404+
python setup.py build_ext --inplace -- -G Ninja \
405+
-DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx \
406+
-DTBB_LIBRARY_DIR=${TBBROOT}/lib \
407+
-DMKL_LIBRARY_DIR=${MKLROOT}/lib \
408+
-DMKL_INCLUDE_DIR=${MKLROOT}/include \
409+
-DTBB_INCLUDE_DIR=${TBBROOT}/include || exit 1
410+
else
411+
CC=dpcpp CXX=dpcpp LD_SHARED="dpcpp -shared" \
412+
python setup.py build_ext --inplace || exit 1
413+
fi
397414
conda deactivate
398-
python example.py
415+
if [ -e tests ]
416+
then
417+
python -m pytest tests || exit 1
418+
else
419+
conda list dpcpp
420+
ls -l ${CONDA_PREFIX}/lib/libsycl*
421+
ldd external_usm_alloc*so
422+
python example.py || exit 1
423+
fi
399424
popd
400425
done
401426
cd ../cython
@@ -405,7 +430,7 @@ jobs:
405430
conda activate --stack build_env
406431
python setup.py build_ext --inplace || exit 1
407432
conda deactivate
408-
python run.py
433+
python run.py || exit 1
409434
popd
410435
done
411436
- name: Run Python examples

0 commit comments

Comments
 (0)