Skip to content

Commit 5f428fd

Browse files
test_example job needs scikit-build
1 parent afc8821 commit 5f428fd

File tree

1 file changed

+40
-18
lines changed

1 file changed

+40
-18
lines changed

.github/workflows/conda-package.yml

Lines changed: 40 additions & 18 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,57 +363,79 @@ 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 create -y -n build_env -c intel dpcpp_linux-64
377+
- name: Install dpctl
376378
shell: bash -l {0}
377379
run: |
378380
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
381+
conda activate
382+
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel --override-channels"
383+
conda install -n examples -y $CHANNELS numba-dppy numpy dpctl || exit 1
382384
- name: Build and run examples with native extensions
383385
shell: bash -l {0}
384386
run: |
385387
source $CONDA/etc/profile.d/conda.sh
386388
export OCL_ICD_FILENAMES=libintelocl.so
387389
export SYCL_ENABLE_HOST_DEVICE=1
388-
conda activate
390+
conda activate examples
391+
conda list
389392
cd examples/pybind11
390-
export CC=dpcpp
391-
export CXX=dpcpp
392393
for d in $(ls)
393394
do
394395
pushd $d
396+
export MKLROOT=${CONDA_PREFIX}
397+
export TBBROOT=${CONDA_PREFIX}
395398
conda activate --stack build_env
396-
python setup.py build_ext --inplace || exit 1
399+
if [ -e CMakeLists.txt ]
400+
then
401+
python setup.py build_ext --inplace -- -G Ninja \
402+
-DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx \
403+
-DTBB_LIBRARY_DIR=${TBBROOT}/lib \
404+
-DMKL_LIBRARY_DIR=${MKLROOT}/lib \
405+
-DMKL_INCLUDE_DIR=${MKLROOT}/include \
406+
-DTBB_INCLUDE_DIR=${TBBROOT}/include || exit 1
407+
else
408+
CC=dpcpp CXX=dpcpp LD_SHARED="dpcpp -shared" \
409+
python setup.py build_ext --inplace || exit 1
410+
fi
397411
conda deactivate
398-
python example.py
412+
if [ -e tests ]
413+
then
414+
LD_LIBRARY_PATH=${CONDA_PREFIX}/lib python -m pytest tests || exit 1
415+
else
416+
LD_LIBRARY_PATH=${CONDA_PREFIX}/lib python example.py || exit 1
417+
fi
399418
popd
400419
done
401420
cd ../cython
402421
for d in $(ls)
403422
do
404423
pushd $d
405424
conda activate --stack build_env
406-
python setup.py build_ext --inplace || exit 1
425+
CC=dpcpp CXX=dpcpp LD_SHARED="dpcpp -shared" \
426+
python setup.py build_ext --inplace || exit 1
407427
conda deactivate
408-
python run.py
428+
LD_LIBRARY_PATH=${CONDA_PREFIX}/lib python run.py || exit 1
409429
popd
410430
done
411431
- name: Run Python examples
412432
shell: bash -l {0}
413433
run: |
414434
cd examples/python
435+
source $CONDA/etc/profile.d/conda.sh
415436
export OCL_ICD_FILENAMES=libintelocl.so
416437
export SYCL_ENABLE_HOST_DEVICE=1
438+
conda activate examples
417439
for script in $(find . \( -not -name "_*" -and -name "*.py" \))
418440
do
419441
echo "Executing ${script}"

0 commit comments

Comments
 (0)