11---
2- name : Conda Packages
2+ name : Conda Package
33env :
4- DEFAULT_KHIOPS_REVISION : main
5- DEFAULT_SAMPLES_REVISION : main
4+ DEFAULT_SAMPLES_VERSION : 10.2.0
5+ # Note: The default Khiops version must never be an alpha release as they are
6+ # ephemeral. To test alpha versions run the workflow manually.
7+ DEFAULT_KHIOPS_CORE_VERSION : 10.2.2
68on :
79 workflow_dispatch :
810 inputs :
9- khiops-revision :
10- default : main
11- description : khiops repo revision
12- samples-revision :
13- default : main
14- description : khiops-samples repo revision
11+ khiops-core-version :
12+ default : 10.2.2
13+ description : khiops-core version for testing
14+ khiops- samples-version :
15+ default : 10.2.0
16+ description : khiops-samples version
1517 release-channel :
1618 type : choice
1719 default : khiops-dev
@@ -29,18 +31,7 @@ concurrency:
2931 cancel-in-progress : true
3032jobs :
3133 build :
32- strategy :
33- fail-fast : false
34- matrix :
35- # Use the oldest supported Mac OS and Ubuntu versions for GLIBC compatibility
36- include :
37- - os : ubuntu-20.04
38- os-family : linux
39- - os : windows-latest
40- os-family : windows
41- - os : macos-11
42- os-family : macos
43- runs-on : ${{ matrix.os }}
34+ runs-on : ubuntu-22.04
4435 steps :
4536 - name : Checkout Sources
4637 uses : actions/checkout@v4
@@ -52,34 +43,19 @@ jobs:
5243 uses : conda-incubator/setup-miniconda@v3
5344 with :
5445 miniconda-version : latest
55- python-version : ' 3.11 '
46+ python-version : ' 3.12 '
5647 - name : Install Dependency Requirements for Building Conda Packages
57- run : conda install conda-build=3.27.0 conda-verify
58- # We need MacOS SDK 10.10 to build on Big Sur
59- - name : Install Mac OS SDK 10.10
60- if : runner.os == 'macOS'
61- run : |
62- wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz
63- sudo tar -zxvf MacOSX10.10.sdk.tar.xz -C /opt
64- - name : Set KHIOPS_REVISION build input parameter
48+ run : conda install -y conda-build
49+ - name : Build the Conda Package
50+ # Note: The "khiops-dev" conda channel is needed to retrieve the "khiops-core" package.
51+ # The "test" part of the conda recipe needs this package.
6552 run : |
66- KHIOPS_REVISION="${{ inputs.khiops-revision || env.DEFAULT_KHIOPS_REVISION }}"
67- echo "KHIOPS_REVISION=$KHIOPS_REVISION" >> "$GITHUB_ENV"
68- - name : Build Khiops Conda Package (Windows)
69- if : runner.os == 'Windows'
70- run : |
71- mkdir khiops-conda
72- conda build --output-folder khiops-conda ./packaging/conda
73- # In Linux/macOS we need the conda-forge channel to install their pinned versions
74- - name : Build Khiops Conda Package (Linux/macOS)
75- if : runner.os != 'Windows'
76- run : |
77- mkdir khiops-conda
78- conda build --channel conda-forge --output-folder khiops-conda ./packaging/conda
79- - name : Upload Khiops Conda Package
53+ conda build --channel conda-forge --channel khiops-dev \
54+ --output-folder ./khiops-conda ./packaging/conda
55+ - name : Upload Conda Package Artifact
8056 uses : actions/upload-artifact@v4
8157 with :
82- name : khiops-conda-${{ matrix.os-family }}
58+ name : khiops-conda
8359 path : ./khiops-conda
8460 retention-days : 7
8561 # Test Conda package on brand new environments
@@ -88,26 +64,20 @@ jobs:
8864 strategy :
8965 fail-fast : false
9066 matrix :
91- env :
92- - {os: ubuntu-20.04, os-family: linux}
93- - {os: ubuntu-22.04, os-family: linux}
94- - {os: windows-2019, os-family: windows}
95- - {os: windows-2022, os-family: windows}
96- - {os: macos-11, os-family: macos}
97- - {os: macos-12, os-family: macos}
98- - {os: macos-13, os-family: macos}
9967 python-version : ['3.8', '3.9', '3.10', '3.11', '3.12']
68+ env :
69+ - {os: ubuntu-20.04, json-image: '{"image": null}'}
70+ - {os: ubuntu-22.04, json-image: '{"image": null}'}
71+ - {os: ubuntu-22.04, json-image: '{"image": "rockylinux:8"}'}
72+ - {os: ubuntu-22.04, json-image: '{"image": "rockylinux:9"}'}
73+ - {os: windows-2019, json-image: '{"image": null}'}
74+ - {os: windows-2022, json-image: '{"image": null}'}
75+ - {os: macos-12, json-image: '{"image": null}'}
76+ - {os: macos-13, json-image: '{"image": null}'}
77+ - {os: macos-14, json-image: '{"image": null}'}
10078 runs-on : ${{ matrix.env.os }}
101- env :
102- KHIOPS_SAMPLES_DIR : ./khiops-samples-repo
79+ container : ${{ fromJSON(matrix.env.json-image) }}
10380 steps :
104- - name : Checkout Khiops samples
105- uses : actions/checkout@v4
106- with :
107- repository : khiopsml/khiops-samples
108- ref : ${{ inputs.samples-revision || env.DEFAULT_SAMPLES_REVISION }}
109- token : ${{ secrets.GITHUB_TOKEN }}
110- path : ${{ env.KHIOPS_SAMPLES_DIR }}
11181 - name : Install Miniconda
11282 uses : conda-incubator/setup-miniconda@v3
11383 with :
@@ -116,18 +86,33 @@ jobs:
11686 - name : Download Conda Package Artifact
11787 uses : actions/download-artifact@v4
11888 with :
119- name : khiops-conda-${{ matrix.env.os-family }}
120- path : khiops-conda
121- - name : Install the Khiops Conda pagkage (Windows)
89+ name : khiops-conda
90+ path : ./khiops-conda
91+ - name : Put the khiops-core Version in the Environment
92+ run : |
93+ KHIOPS_CORE_VERSION="${{ inputs.khiops-core-version || env.DEFAULT_KHIOPS_CORE_VERSION }}"
94+ echo "KHIOPS_CORE_VERSION=$KHIOPS_CORE_VERSION" >> "$GITHUB_ENV"
95+ - name : Install the Khiops Conda package (Windows)
12296 if : runner.os == 'Windows'
123- run : conda install -c ./khiops-conda/ khiops
97+ run : |
98+ conda install --channel khiops-dev khiops-core=$KHIOPS_CORE_VERSION
99+ conda install --override-channels --channel conda-forge --channel ./khiops-conda/ khiops
124100 # In Linux/macOS we need the conda-forge channel to install their pinned versions
125101 - name : Install the Khiops Conda package (Linux/macOS)
126102 if : runner.os != 'Windows'
127- run : conda install -c conda-forge -c ./khiops-conda/ khiops
103+ run : |
104+ conda install --channel conda-forge --channel khiops-dev khiops-core=$KHIOPS_CORE_VERSION
105+ conda install --channel ./khiops-conda/ khiops
128106 - name : Test Khiops Installation Status
129107 run : kh-status
108+ - name : Download Sample Datasets
109+ run : |
110+ kh-download-datasets \
111+ --version ${{ inputs.khiops-samples-version || env.DEFAULT_SAMPLES_VERSION }}
130112 - name : Test Conda Package Installation on Samples
113+ env :
114+ # Force > 2 CPU cores to launch mpiexec
115+ KHIOPS_PROC_NUMBER : 4
131116 run : |
132117 kh-samples core -i train_predictor -e
133118 kh-samples core -i train_predictor_error_handling -e
@@ -140,66 +125,37 @@ jobs:
140125 release :
141126 if : github.ref_type == 'tag'
142127 needs : test
143- runs-on : ubuntu-latest
128+ runs-on : ubuntu-22.04
144129 permissions :
145130 contents : write
146131 steps :
147132 - name : Download package artifacts
148133 uses : actions/download-artifact@v4
149134 with :
150135 # See the upload-artifact step in the build job for the explanation of this pattern
136+ name : khiops-conda
151137 path : ./khiops-conda
152- pattern : khiops-conda-*
153- merge-multiple : true
154138 - name : Install Miniconda
155139 uses : conda-incubator/setup-miniconda@v3
156140 with :
157141 miniconda-version : latest
158- python-version : ' 3.11 '
159- - name : Install requirement packages
160- run : conda install -y anaconda-client conda-build=3.27.0
142+ python-version : ' 3.12 '
143+ - name : Install Requirement Packages
144+ run : conda install -y anaconda-client conda-index
161145 - name : Reindex the package directory
162- run : conda-index ./khiops-conda
163- - name : Upload the packages to anaconda.org
164- run : |
146+ run : python -m conda_index ./khiops-conda
147+ - name : Upload the Package to anaconda.org
148+ run : |-
165149 # Set the anaconda.org channel
166150 ANACONDA_CHANNEL="${{ inputs.release-channel || 'khiops-dev' }}"
167151
168152 # For the release channel: upload without forcing
169153 if [[ "$ANACONDA_CHANNEL" == "khiops" ]]
170154 then
171155 anaconda --token "${{ secrets.KHIOPS_ANACONDA_CHANNEL_TOKEN }}" upload \
172- --user "$ANACONDA_CHANNEL" ./khiops-conda/* /*.tar.bz2
156+ --user "$ANACONDA_CHANNEL" ./khiops-conda/noarch /*.tar.bz2
173157 # For the dev channel: upload with forcing
174158 else
175159 anaconda --token "${{ secrets.KHIOPS_DEV_ANACONDA_CHANNEL_TOKEN }}" upload \
176- --user "$ANACONDA_CHANNEL" --force ./khiops-conda/* /*.tar.bz2
160+ --user "$ANACONDA_CHANNEL" --force ./khiops-conda/noarch /*.tar.bz2
177161 fi
178- - name : Extract package version
179- run : |
180- PKG_VERSION=$(\
181- conda search --override-channels --channel ./khiops-conda/ khiops \
182- | awk '!/#|channels/ {print $2}' \
183- | sort -u \
184- )
185- echo "PKG_VERSION=$PKG_VERSION" >> "$GITHUB_ENV"
186- - name : Create the release zip archive
187- uses : thedoctor0/zip-release@0.7.6
188- with :
189- type : zip
190- path : ./khiops-conda/
191- filename : khiops-${{ env.PKG_VERSION }}-conda.zip
192- - name : Upload conda package artifacts for all platforms
193- uses : actions/upload-artifact@v4
194- with :
195- name : khiops-conda-all
196- path : ./khiops-${{ env.PKG_VERSION }}-conda.zip
197- - name : Release the zip archive
198- uses : ncipollo/release-action@v1
199- with :
200- allowUpdates : true
201- artifacts : ./khiops-${{ env.PKG_VERSION }}-conda.zip
202- draft : false
203- makeLatest : false
204- prerelease : true
205- updateOnlyUnreleased : true
0 commit comments