|
| 1 | +--- |
| 2 | +applyTo: ".github/workflows/**" |
| 3 | +--- |
| 4 | + |
| 5 | +# CI Workflow Changes |
| 6 | + |
| 7 | +Use these rules for files under `.github/workflows/`. Apply the shared guidance |
| 8 | +from `.github/copilot-instructions.md` first, then this workflow-specific |
| 9 | +guidance. |
| 10 | + |
| 11 | +## Workflow Overview |
| 12 | + |
| 13 | +This repository has seven GitHub Actions workflows in `.github/workflows/`. Most |
| 14 | +workflows use concurrency groups to cancel in-progress runs when superseded, |
| 15 | +except `release.yml` (no concurrency group) and `api-docs.yml` (which uses a |
| 16 | +`pages` concurrency group that does not cancel in-progress runs). |
| 17 | + |
| 18 | +### `quick-checks.yml` |
| 19 | + |
| 20 | +Runs pre-commit hooks on every pull request and on `workflow_dispatch`. The |
| 21 | +hooks (configured in |
| 22 | +`.pre-commit-config.yaml`) are: Black, pylint, isort (with special no-sections |
| 23 | +config for sample files), yamlfix, shellcheck, GitHub workflow/action schema |
| 24 | +validation (`check-github-workflows`, `check-github-actions`), and a local |
| 25 | +`samples-generation` hook that regenerates reST samples when |
| 26 | +`khiops/samples/samples.py` or `khiops/samples/samples_sklearn.py` change. |
| 27 | + |
| 28 | +### `tests.yml` |
| 29 | + |
| 30 | +The main test suite. Triggers on PRs that touch `khiops/**/*.py`, |
| 31 | +`tests/**/*.py`, `tests/resources/**` (excluding `tests/resources/**/*.md`), or |
| 32 | +the workflow file itself. Also supports `workflow_dispatch`. |
| 33 | + |
| 34 | +Three job groups: |
| 35 | + |
| 36 | +- **`run`** (Linux matrix): Runs across Python 3.10–3.14 in custom Docker |
| 37 | + containers (`ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04`). Each |
| 38 | + Python version uses a dedicated Conda environment with native Khiops. |
| 39 | + Coverage is collected with `coverage` and reported as XML. Test results use |
| 40 | + JUnit XML via `unittest-xml-reporting`. |
| 41 | +- **`check-khiops-integration-on-linux`**: Runs integration tests on multiple |
| 42 | + Linux containers (ubuntu22.04, rocky8, rocky9, debian13). Validates Khiops |
| 43 | + status, runs samples, tests major-version mismatch detection with a |
| 44 | + `py3_khiops10_conda` environment, and runs the integration test suite. |
| 45 | +- **`check-khiops-integration-on-windows`**: Installs Khiops Desktop via NSIS |
| 46 | + installer on Windows 2022 with Python 3.12. Runs integration tests and |
| 47 | + samples outside a Python virtual environment, then installs khiops-python |
| 48 | + inside a venv and validates the installation status. |
| 49 | + |
| 50 | +**Expensive tests** (remote file access with S3/GCS/Azure): Skipped by default |
| 51 | +on feature branches. Enabled on `main`/`main-v10` branches or via the |
| 52 | +`run-expensive-tests` workflow dispatch input. These require GCP Workload |
| 53 | +Identity Federation, a local fake S3 server, and Azure storage credentials. |
| 54 | + |
| 55 | +**Environment variables**: `KHIOPS_SAMPLES_DIR` points to a checkout of |
| 56 | +`khiopsml/khiops-samples`. `KHIOPS_PROC_NUMBER=4` forces MPI multi-process |
| 57 | +execution. MPI oversubscribe flags are set for Open MPI 4.x and 5+. |
| 58 | + |
| 59 | +### `pip.yml` |
| 60 | + |
| 61 | +Builds an **sdist** package (no wheel) and tests it in Docker containers |
| 62 | +(ubuntu22.04, rocky9, debian13). Triggers on: |
| 63 | + |
| 64 | +- Tag pushes (any tag) — automatically publishes to GitHub Releases |
| 65 | +- PRs touching `pyproject.toml`, `LICENSE.md`, or the workflow file |
| 66 | +- `workflow_dispatch` with optional `pypi-target` choice (`None`, `testpypi`, |
| 67 | + `pypi`) |
| 68 | + |
| 69 | +Publishing to TestPyPI/PyPI uses OIDC Trusted Publishing and requires the |
| 70 | +corresponding GitHub environment (`testpypi` or `pypi`). Only runs for the |
| 71 | +`KhiopsML` org on tag pushes. |
| 72 | + |
| 73 | +### `release.yml` |
| 74 | + |
| 75 | +Manual workflow that merges `dev` into `main`, tags the merge commit with the |
| 76 | +provided version, and resets `dev` to `main`. Only triggered via |
| 77 | +`workflow_dispatch` with a `version` input. |
| 78 | + |
| 79 | +### `api-docs.yml` |
| 80 | + |
| 81 | +Builds Sphinx documentation inside a dev Docker container. Triggers on: |
| 82 | + |
| 83 | +- Tag pushes — builds docs and uploads a zip archive to GitHub Releases |
| 84 | +- PRs touching `doc/**/*.rst`, `doc/create-doc`, `doc/clean-doc`, `doc/*.py`, |
| 85 | + `khiops/**/*.py`, or the workflow file |
| 86 | +- `workflow_dispatch` with optional tutorial and samples revision inputs |
| 87 | + |
| 88 | +Uses the `khiopspydev-ubuntu22.04` Docker image and runs |
| 89 | +`./create-doc -t -d -g <revision>`. Uses a `pages` concurrency group that does |
| 90 | +**not** cancel in-progress runs (to avoid interrupting production deployments). |
| 91 | + |
| 92 | +### `dev-docker.yml` |
| 93 | + |
| 94 | +Builds development Docker images for multiple OS targets (ubuntu22.04, rocky8, |
| 95 | +rocky9, debian13) with configurable Khiops revision, server revision, Python |
| 96 | +versions (3.10–3.14), and remote file driver versions (GCS, S3, Azure). |
| 97 | +Triggers on PRs touching `packaging/docker/khiopspydev/Dockerfile.*` or the |
| 98 | +workflow file, and on `workflow_dispatch`. Images are pushed to |
| 99 | +`ghcr.io/khiopsml/khiops-python/khiopspydev-*` only when manually requested via |
| 100 | +`push: true`. The `set-latest` flag only works on the `main` or `main-v10` |
| 101 | +branches. |
| 102 | + |
| 103 | +### `test-conda-forge-package.yml` |
| 104 | + |
| 105 | +Manual-only workflow that tests the released `khiops` Conda package on the |
| 106 | +`conda-forge` channel across a broad matrix: Python 3.10–3.14 × multiple OS |
| 107 | +environments (Ubuntu 20.04/22.04/24.04, Rocky 8/9, Windows 2022/2025, macOS |
| 108 | +14/15/15-Intel). Tests both normal Conda environments and "Conda-based |
| 109 | +environments" (where `CONDA_PREFIX` is unset to simulate non-Conda invocation). |
| 110 | + |
| 111 | +## Editing Rules |
| 112 | + |
| 113 | +- Workflow YAML files are validated by pre-commit hooks |
| 114 | + (`check-github-workflows`, `check-github-actions`) and formatted by `yamlfix`. |
| 115 | +- The dev Docker images are the test environment for both `tests.yml` and |
| 116 | + `pip.yml`. If you need new system dependencies in CI, they go into the |
| 117 | + Dockerfiles under `packaging/docker/khiopspydev/`. |
| 118 | +- Test dependencies are in `test-requirements.txt` (`coverage`, `wrapt`). |
| 119 | + Package dependencies are extracted from `pyproject.toml` at CI time via |
| 120 | + `scripts/extract_dependencies_from_pyproject_toml.py`. |
0 commit comments