Skip to content

Fix python examples fail #1

Fix python examples fail

Fix python examples fail #1

Workflow file for this run

# Copyright (C) 2025 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials,
# and your use of them is governed by the express license under which they
# were provided to you ("License"). Unless the License provides otherwise,
# you may not use, modify, copy, publish, distribute, disclose or transmit
# this software or the related documents without Intel's prior written
# permission.
#
# This software and the related documents are provided as is, with no
# express or implied warranties, other than those that are expressly stated
# in the License.
name: Python Test
run-name: ${{ github.event.inputs.run_name || github.event.pull_request.title }}
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
python-build:
name: ${{ matrix.cxx }}
runs-on: ubuntu-22.04
strategy:
matrix:
cxx:
- g++-11
- clang++-15
include:
- cxx: g++-11
cc: gcc-11
- cxx: clang++-15
cc: clang-15
steps:
- uses: actions/checkout@v4
- name: Install MKL
timeout-minutes: 5
run: |
.github/scripts/setup_apt_repo_linux.sh
sudo apt install intel-oneapi-mkl intel-oneapi-mkl-devel
# Setup environment variables for building against MKL.
# Persist the environment variables for use across multiple subsequent actions.
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
# Install inside the temporary working directory.
- name: Build Wheel
env:
CXX: ${{ matrix.cxx }}
CC: ${{ matrix.cc }}
TEMP_WORKSPACE: ${{ runner.temp }}/usr
run: |
cd ${GITHUB_WORKSPACE}/bindings/python
python setup.py bdist_wheel --cmake-executable="cmake" --build-type=RelWithDebugInfo -- -- -j$(nproc)
pip install ./dist/scalable_vs*.whl --target=${TEMP_WORKSPACE}
# Make sure to add the location of the generated wheel to the python path.
- name: Run tests
env:
PYTHONPATH: ${{ runner.temp }}/usr
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{ runner.temp }}
run: python -m unittest discover -s ${GITHUB_WORKSPACE}/bindings/python
- name: Run examples
env:
PYTHONPATH: ${{ runner.temp }}/usr
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{ runner.temp }}
run: python -m unittest discover -p "example*.py" -s ${GITHUB_WORKSPACE}/examples/python