Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 42 additions & 12 deletions .github/actions/run-standard-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ inputs:
running-mode:
description: Running mode (parallel or serial)
required: true
test-khiops:
description: Test the MODL binary
required: false
default: 'true'
test-coclustering:
description: Test the MODL_Coclustering binary
required: false
default: 'true'
test-kni:
description: Test the KhiopsNativeInterface library via KNITransfer
required: false
default: 'true'
config:
description: Build configuration (debug or release)
required: true
Expand Down Expand Up @@ -69,17 +81,27 @@ runs:
run: |
if [[ "${{ inputs.running-mode }}" == "parallel" ]] ; then
export PARALLEL_ARG="-p 4"
else
export PARALLEL_ARG="-p 1"
fi
if [[ "${{ inputs.config }}" == "release" ]] ; then
$PYTHON $TEST_PY test/LearningTest/TestKhiops/Standard "${{ inputs.binary-path }}" ${PARALLEL_ARG}
$PYTHON $TEST_PY test/LearningTest/TestCoclustering/Standard "${{ inputs.binary-path }}" ${PARALLEL_ARG}
if [[ "${{ inputs.running-mode }}" != "parallel" ]] ; then
if [[ "${{ inputs.test-khiops }}" == "true" ]] ; then
$PYTHON $TEST_PY test/LearningTest/TestKhiops/Standard "${{ inputs.binary-path }}" ${PARALLEL_ARG}
fi
if [[ "${{ inputs.test-coclustering }}" == "true" ]] ; then
$PYTHON $TEST_PY test/LearningTest/TestCoclustering/Standard "${{ inputs.binary-path }}" ${PARALLEL_ARG}
fi
if [[ "${{ inputs.test-kni }}" == "true" && "${{ inputs.running-mode }}" != "parallel" ]] ; then
$PYTHON $TEST_PY test/LearningTest/TestKNI/Standard "${{ inputs.binary-path }}"
fi
else
$PYTHON $TEST_PY test/LearningTest/TestKhiops/Standard/IrisLight "${{ inputs.binary-path }}" ${PARALLEL_ARG}
$PYTHON $TEST_PY test/LearningTest/TestCoclustering/Standard/Iris "${{ inputs.binary-path }}" ${PARALLEL_ARG}
if [[ "${{ inputs.running-mode }}" != "parallel" ]] ; then
if [[ "${{ inputs.test-khiops }}" == "true" ]] ; then
$PYTHON $TEST_PY test/LearningTest/TestKhiops/Standard/IrisLight "${{ inputs.binary-path }}" ${PARALLEL_ARG}
fi
if [[ "${{ inputs.test-coclustering }}" == "true" ]] ; then
$PYTHON $TEST_PY test/LearningTest/TestCoclustering/Standard/Iris "${{ inputs.binary-path }}" ${PARALLEL_ARG}
fi
if [[ "${{ inputs.test-kni }}" == "true" && "${{ inputs.running-mode }}" != "parallel" ]] ; then
$PYTHON $TEST_PY test/LearningTest/TestKNI/Standard/Iris "${{ inputs.binary-path }}"
fi
fi
Expand All @@ -89,15 +111,23 @@ runs:
run: |
mkdir -p results
if [[ "${{ inputs.config }}" == "release" ]] ; then
$PYTHON $APPLY_PY test/LearningTest/TestKhiops/Standard errors | tee -a results/errors.txt
$PYTHON $APPLY_PY test/LearningTest/TestCoclustering/Standard errors | tee -a results/errors.txt
if [[ "${{ inputs.running-mode }}" != "parallel" ]] ; then
if [[ "${{ inputs.test-khiops }}" == "true" ]] ; then
$PYTHON $APPLY_PY test/LearningTest/TestKhiops/Standard errors | tee -a results/errors.txt
fi
if [[ "${{ inputs.test-coclustering }}" == "true" ]] ; then
$PYTHON $APPLY_PY test/LearningTest/TestCoclustering/Standard errors | tee -a results/errors.txt
fi
if [[ "${{ inputs.test-kni }}" == "true" && "${{ inputs.running-mode }}" != "parallel" ]] ; then
$PYTHON $APPLY_PY test/LearningTest/TestKNI/Standard errors | tee -a results/errors.txt
fi
else
$PYTHON $APPLY_PY test/LearningTest/TestKhiops/Standard/IrisLight errors | tee -a results/errors.txt
$PYTHON $APPLY_PY test/LearningTest/TestCoclustering/Standard/Iris errors | tee -a results/errors.txt
if [[ "${{ inputs.running-mode }}" != "parallel" ]] ; then
if [[ "${{ inputs.test-khiops }}" == "true" ]] ; then
$PYTHON $APPLY_PY test/LearningTest/TestKhiops/Standard/IrisLight errors | tee -a results/errors.txt
fi
if [[ "${{ inputs.test-coclustering }}" == "true" ]] ; then
$PYTHON $APPLY_PY test/LearningTest/TestCoclustering/Standard/Iris errors | tee -a results/errors.txt
fi
if [[ "${{ inputs.test-kni }}" == "true" && "${{ inputs.running-mode }}" != "parallel" ]] ; then
$PYTHON $APPLY_PY test/LearningTest/TestKNI/Standard/Iris errors | tee -a results/errors.txt
fi
fi
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/pack-pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ jobs:
name: pkg-wheel-windows-2025-vs2026
path: wheelhouse/*.whl
if-no-files-found: error
test-khiops-core-wheel:
test-khiops-core-and-kni-wheels:
strategy:
matrix:
setup:
Expand All @@ -171,7 +171,7 @@ jobs:
- {os: macos-15-intel, image: ''}
runs-on: ${{ matrix.setup.os }}
container: ${{ matrix.setup.image }}
name: Test wheel
name: Test Khiops Core and KNI wheels with LearningTestTool
needs: [build-wheel, sign-wheel-windows]
steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
fi
$PYTHON -m pip install --find-links=wheelhouse khiops-core
$PYTHON -m pip show -f khiops-core
- name: Run standard tests
- name: Run standard tests on the Core package
uses: ./.github/actions/run-standard-tests
with:
warning_as_error: true
Expand All @@ -227,6 +227,17 @@ jobs:
binary-path: ${{ steps.install_khiops_core.outputs.BIN_DIR }}
testing-context-description: pip-test-${{ matrix.setup.os }}-${{ matrix.setup.image
}}
- name: Run standard tests on the KNI package
uses: ./.github/actions/run-standard-tests
with:
warning_as_error: true
running-mode: serial
test-khiops: false
test-coclustering: false
config: release
binary-path: ${{ steps.install_khiops_core.outputs.BIN_DIR }}
testing-context-description: pip-test-${{ matrix.setup.os }}-${{ matrix.setup.image
}}
test-kni:
name: Test KNI Python wheel
needs: [build-wheel, sign-wheel-windows]
Expand Down Expand Up @@ -300,7 +311,7 @@ jobs:
if: github.ref_type == 'tag' && github.repository_owner == 'KhiopsML' && inputs.python_repository
== 'testpypi'
name: Publish to Test.PyPI.org
needs: [build-wheel, test-khiops-core-wheel, test-kni]
needs: [build-wheel, test-khiops-core-and-kni-wheels, test-kni]
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -321,7 +332,7 @@ jobs:
name: Publish to PyPI.org
if: github.ref_type == 'tag' && github.repository_owner == 'KhiopsML' && inputs.python_repository
== 'pypi'
needs: [build-wheel, test-khiops-core-wheel, test-kni]
needs: [build-wheel, test-khiops-core-and-kni-wheels, test-kni]
runs-on: ubuntu-latest
permissions:
id-token: write
Expand Down
16 changes: 16 additions & 0 deletions src/Learning/KNITransfer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,19 @@ add_executable(KNITransfer ${cppfiles})
set_khiops_options(KNITransfer)

target_link_libraries(KNITransfer PUBLIC KhiopsNativeInterface KWLearningProblem DTForest PLParallelTask)

# On Pip installations the KNI library is installed into `bin/`, in the same directory as KNITransfer, not into `lib/`.
# Hence, append the binary's own directory to the rpath so that it is found at runtime on MacOS and Linux.
if(IS_PIP AND NOT MSVC)
if(APPLE)
set_property(
TARGET KNITransfer
APPEND
PROPERTY INSTALL_RPATH "@loader_path")
else()
set_property(
TARGET KNITransfer
APPEND
PROPERTY INSTALL_RPATH "$ORIGIN")
endif()
endif()
Loading