Skip to content

Improve the warning in case of versions mismatch between the khiops binaries and the khiops python library #1012

Improve the warning in case of versions mismatch between the khiops binaries and the khiops python library

Improve the warning in case of versions mismatch between the khiops binaries and the khiops python library #1012

Workflow file for this run

---
name: API Docs
env:
DEFAULT_KHIOPS_PYTHON_TUTORIAL_REVISION: 11.0.0.0-b.0
DEFAULT_KHIOPS_SAMPLES_REVISION: 11.0.0
on:
workflow_dispatch:
inputs:
khiops-python-tutorial-revision:
default: 11.0.0.0-b.0
description: khiops-python-tutorial repo revision
khiops-samples-revision:
default: 11.0.0
description: khiops-samples repo revision
image-tag:
default: 11.0.0-b.0.0
description: Development Docker Image Tag
pull_request:
paths:
- doc/**.rst
- doc/create-doc
- doc/clean-doc
- doc/*.py
- khiops/**.py
- .github/workflows/api-docs.yml
push:
tags: ['*']
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
id-token: write
packages: read
pages: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest
# queued. However, do NOT cancel in-progress runs as we want to allow these production deployments
# to complete.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-22.04
container:
# 'latest' default image tag cannot be set as an environment variable,
# because the `env` context is only accessible at the step level;
# hence, it is hard-coded
image: |-
ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04:${{ inputs.image-tag || '11.0.0-b.0.0' }}
# Use the 'runner' user (1001) from github so checkout actions work properly
# https://github.com/actions/runner/issues/2033#issuecomment-1598547465
options: --user 1001
steps:
- name: Checkout khiops-python
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add pip scripts directory to path
run: echo PATH="$PATH:/github/home/.local/bin" >> "$GITHUB_ENV"
- name: Install doc build requirements
run: |
# Install package itself to install the samples datasets
python -m pip install --upgrade pip
python -m pip install --user .
kh-download-datasets --force-overwrite --version ${{ inputs.khiops-samples-revision || env.DEFAULT_KHIOPS_SAMPLES_REVISION }}
kh-status
# Install the doc python requirements
cd doc
python -m pip install -U -r requirements.txt
# Clone the Khiops Python tutorial repository while building the documentation
- name: Build Sphinx Documentation
run: |
cd doc
./create-doc -t -d -g \
${{ inputs.khiops-python-tutorial-revision || env.DEFAULT_KHIOPS_PYTHON_TUTORIAL_REVISION }}
- name: Upload the docs as an artifact
uses: actions/upload-artifact@v4
with:
name: api-docs
path: ./doc/_build/html/
# Release on Git tag
release:
if: github.ref_type == 'tag'
needs: build
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Download docs artifact
uses: actions/download-artifact@v4
with:
name: api-docs
path: ./doc/_build/html/
- name: Create docs release zip archive
uses: thedoctor0/zip-release@0.7.6
with:
type: zip
path: ./doc/_build/html/
filename: khiops-api-docs-${{ github.ref_name }}.zip
- name: Release the docs zip archive
uses: ncipollo/release-action@v1.15.0
with:
allowUpdates: true
artifacts: ./khiops-api-docs-${{ github.ref_name }}.zip
body: '**For testing purposes only**'
draft: false
makeLatest: false
prerelease: true
updateOnlyUnreleased: true