@@ -61,173 +61,13 @@ jobs:
6161 name : khiops-conda
6262 path : ./khiops-conda
6363 retention-days : 7
64- # Test Conda package on brand new environments
65- test :
66- needs : build
67- strategy :
68- fail-fast : false
69- matrix :
70- python-version : ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
71- env :
72- - {os: ubuntu-22.04, json-image: '{"image": "ubuntu:20.04"}'}
73- - {os: ubuntu-22.04, json-image: '{"image": null}'}
74- - {os: ubuntu-24.04, json-image: '{"image": null}'}
75- - {os: ubuntu-22.04, json-image: '{"image": "rockylinux:8"}'}
76- - {os: ubuntu-22.04, json-image: '{"image": "rockylinux:9"}'}
77- - {os: windows-2022, json-image: '{"image": null}'}
78- - {os: windows-2025, json-image: '{"image": null}'}
79- - {os: macos-13, json-image: '{"image": null}'}
80- - {os: macos-14, json-image: '{"image": null}'}
81- - {os: macos-15, json-image: '{"image": null}'}
82- runs-on : ${{ matrix.env.os }}
83- container : ${{ fromJSON(matrix.env.json-image) }}
84- steps :
85- - name : Install Miniforge
86- uses : conda-incubator/setup-miniconda@v3
87- with :
88- miniforge-version : 24.11.0-0
89- python-version : ${{ matrix.python-version }}
90- conda-remove-defaults : true
91- - name : Download Conda Package Artifact
92- uses : actions/download-artifact@v4
93- with :
94- name : khiops-conda
95- path : ./khiops-conda
96- - name : Put the khiops-core Version in the Environment
97- run : |
98- KHIOPS_CORE_VERSION="${{ inputs.khiops-core-version || env.DEFAULT_KHIOPS_CORE_VERSION }}"
99- echo "KHIOPS_CORE_VERSION=$KHIOPS_CORE_VERSION" >> "$GITHUB_ENV"
100- - name : Install the Khiops Conda package
101- run : |
102- # Add the Conda `rc` label for alpha or RC pre-releases
103- if [[ $(echo ${KHIOPS_CORE_VERSION} | grep -E ".*(a|rc)\.[0-9]+") ]]; then
104- RC_LABEL="conda-forge/label/rc::"
105- else
106- RC_LABEL=""
107- fi
108- conda install ${RC_LABEL}khiops-core=$KHIOPS_CORE_VERSION
109- conda install --channel ./khiops-conda/ khiops
110- - name : Install JQ test dependency (Linux / MacOS)
111- if : runner.os != 'Windows'
112- run : conda install jq
113- - name : Test Conda / Python Package Version Coherence
114- run : |
115- PACKAGE_VERSION=$(python -c "import khiops; print(khiops.__version__)")
116- CONDA_VERSION=$(conda list ^khiops$ --json | jq ".[].version")
117-
118- # Fail if CONDA_VERSION is not identical to $PACKAGE_VERSION
119- echo $CONDA_VERSION | grep -wq $PACKAGE_VERSION
120- if [[ $? -ne 0 ]]
121- then
122- echo "::error::Conda package version $CONDA_VERSION does not match Python package version $PYTHON_VERSION"
123- false
124- fi
125- - name : Test Khiops Installation Status
126- run : kh-status
127- - name : Test Khiops Installation Status (Conda-Based Environments)
128- run : |
129- # Set `python` to the current Conda Python executable
130- PYTHON="$(type -P python)"
131-
132- # Remove $CONDA_PREFIX/bin from PATH
133- PATH=$(echo $PATH | sed "s#$CONDA_PREFIX/bin:##g")
134-
135- # Unset *CONDA* environment variables
136- # As a corollary, CONDA_PREFIX is unset
137- # Note: There is no way to remove these variables from GITHUB_ENV
138- # (see https://github.com/actions/runner/issues/1126)
139- for CONDA_VAR in $(env | grep CONDA)
140- do
141- unset $(echo $CONDA_VAR | cut -d '=' -f 1)
142- done
143-
144- # Note: kh-status is not reachable as it is not in PATH
145- $PYTHON -c \
146- "import sys; import khiops.core as kh; return_code = kh.get_runner().print_status(); sys.exit(return_code)"
147- - name : Download Sample Datasets
148- run : |
149- kh-download-datasets \
150- --version ${{ inputs.khiops-samples-version || env.DEFAULT_SAMPLES_VERSION }}
151- - name : Run Samples
152- env :
153- # Force > 2 CPU cores to launch mpiexec
154- KHIOPS_PROC_NUMBER : 4
155- run : |
156- kh-samples core -i deploy_model -e
157- kh-samples core -i deploy_coclustering -e
158- kh-samples core -i train_predictor_error_handling -e
159- kh-samples sklearn -i khiops_classifier -e
160- kh-samples sklearn -i khiops_coclustering -e
161- - name : Run Samples (Conda-Based Environments)
162- env :
163- # Force > 2 CPU cores to launch mpiexec
164- KHIOPS_PROC_NUMBER : 4
165- run : |
166- # Set `python` to the current Conda Python executable
167- PYTHON="$(type -P python)"
168-
169- # Remove $CONDA_PREFIX/bin from PATH
170- PATH=$(echo $PATH | sed "s#$CONDA_PREFIX/bin:##g")
171-
172- # Unset *CONDA* environment variables
173- # As a corollary, CONDA_PREFIX is unset
174- # Note: There is no way to remove these variables from GITHUB_ENV
175- # (see https://github.com/actions/runner/issues/1126)
176- for CONDA_VAR in $(env | grep CONDA)
177- do
178- unset $(echo $CONDA_VAR | cut -d '=' -f 1)
179- done
180-
181- # Run samples
182- # Note: kh-samples is not reachable as it is not in PATH
183- $PYTHON -m khiops.samples.samples -i deploy_model -e
184- $PYTHON -m khiops.samples.samples -i deploy_coclustering -e
185- $PYTHON -m khiops.samples.samples -i train_predictor_error_handling -e
186- $PYTHON -m khiops.samples.samples_sklearn -i khiops_classifier -e
187- $PYTHON -m khiops.samples.samples_sklearn -i khiops_coclustering -e
188- # Checkout the sources to obtain the tests
189- # Note: The `sparse-checkout` option of this action is bugged so we checkout all the sources
190- # See https://github.com/actions/checkout/issues/1628
191- - name : Checkout Sources
192- uses : actions/checkout@v4
193- with :
194- fetch-depth : 1
195- # This is needed so python does not retrieve the khiops module from PWD
196- - name : Remove the khiops Module from the Sources
197- run : rm -rf khiops
198- - name : Install the Test Requirements
199- run : conda install -y --file test-requirements.txt
200- - name : Run the Runner Initialization Integration Test
201- run : |
202- python -m unittest -v \
203- tests.test_khiops_integrations.KhiopsRunnerEnvironmentTests.test_runner_environment_initialization
204- - name : Run the Runner Initialization Integration Test (Conda-Based Environments)
205- run : |
206- # Set `python` to the current Conda Python executable
207- PYTHON="$(type -P python)"
208-
209- # Remove $CONDA_PREFIX/bin from PATH
210- PATH=$(echo $PATH | sed "s#$CONDA_PREFIX/bin:##g")
211-
212- # Unset *CONDA* environment variables
213- # As a corolary, CONDA_PREFIX is unset
214- # Note: There is no way to remove these variables from GITHUB_ENV
215- # (see https://github.com/actions/runner/issues/1126)
216- for CONDA_VAR in $(env | grep CONDA)
217- do
218- unset $(echo $CONDA_VAR | cut -d '=' -f 1)
219- done
220-
221- # Execute the runner initialization integration test
222- $PYTHON -m unittest -v \
223- tests.test_khiops_integrations.KhiopsRunnerEnvironmentTests.test_runner_environment_initialization
22464
22565 # Release is only executed on tags
22666 # Note: For this job to work the secrets variables KHIOPS_ANACONDA_CHANNEL_TOKEN and
22767 # KHIOPS_DEV_ANACONDA_CHANNEL_TOKEN must be set with valid anaconda.org access tokens
22868 release :
22969 if : github.ref_type == 'tag'
230- needs : test
70+ needs : build
23171 runs-on : ubuntu-22.04
23272 permissions :
23373 contents : write
@@ -268,18 +108,3 @@ jobs:
268108 run : conda install -y anaconda-client conda-index
269109 - name : Reindex the package directory
270110 run : python -m conda_index ./khiops-conda
271- - name : Upload the Package to anaconda.org
272- run : |-
273- # Set the anaconda.org channel
274- ANACONDA_CHANNEL="${{ inputs.release-channel || 'khiops-dev' }}"
275-
276- # For the release channel: upload without forcing
277- if [[ "$ANACONDA_CHANNEL" == "khiops" ]]
278- then
279- anaconda --token "${{ secrets.KHIOPS_ANACONDA_CHANNEL_TOKEN }}" upload \
280- --user "$ANACONDA_CHANNEL" ./khiops-conda/noarch/*.conda
281- # For the dev channel: upload with forcing
282- else
283- anaconda --token "${{ secrets.KHIOPS_DEV_ANACONDA_CHANNEL_TOKEN }}" upload \
284- --user "$ANACONDA_CHANNEL" --force ./khiops-conda/noarch/*.conda
285- fi
0 commit comments