From 902c02a95b01dcd2ba8284b807c09a1e4d852cf8 Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Mon, 15 Jun 2026 05:39:52 +0200 Subject: [PATCH] [doc] Embed CI graph generation in docs build --- .github/workflows/pages.yml | 4 ---- docs/CMakeLists.txt | 14 ++++++++++++++ docs/requirements.txt | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 974d07654..2534d6cda 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -44,15 +44,11 @@ jobs: - name: Install dependencies run: | python3 -m pip install -r docs/requirements.txt - python3 -m pip install graphviz pyyaml - name: Download artifact uses: actions/download-artifact@v8 with: name: doxygen-documentation-xml path: xml - - name: Generate CI jobs graph - run: | - python3 scripts/jobs_graph.py --out docs/_static/ci_graph --format svg - name: Configure project run: > cmake -S . -B build -D USE_DOCS=ON -D PPC_BUILD_COMPONENTS=OFF diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 4350a4100..d1ba06a5c 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -5,9 +5,22 @@ endif() set(SOURCEDIR "${CMAKE_CURRENT_SOURCE_DIR}") set(BUILDDIR "${CMAKE_CURRENT_BINARY_DIR}/_build/html") set(GETTEXTDIR "${CMAKE_CURRENT_BINARY_DIR}/_build/gettext") +set(CI_GRAPH_SOURCE "${CMAKE_SOURCE_DIR}/.github/workflows/main.yml") +set(CI_GRAPH_OUTPUT "${SOURCEDIR}/_static/ci_graph.svg") find_package(Python REQUIRED COMPONENTS Interpreter) +add_custom_command( + OUTPUT "${CI_GRAPH_OUTPUT}" + COMMAND + ${Python_EXECUTABLE} "${CMAKE_SOURCE_DIR}/scripts/jobs_graph.py" --workflow + "${CI_GRAPH_SOURCE}" --out "${SOURCEDIR}/_static/ci_graph" --format svg + DEPENDS "${CMAKE_SOURCE_DIR}/scripts/jobs_graph.py" "${CI_GRAPH_SOURCE}" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + COMMENT "Generating CI jobs graph") + +add_custom_target(docs_ci_graph DEPENDS "${CI_GRAPH_OUTPUT}") + add_custom_target( docs_help COMMAND ${SPHINXBUILD} -M help "${SOURCEDIR}" "${BUILDDIR}/en" ${SPHINXOPTS} @@ -52,3 +65,4 @@ add_custom_target( ${SPHINXOPTS} WORKING_DIRECTORY "${SOURCEDIR}" COMMENT "Building HTML documentation for English and Russian") +add_dependencies(docs_html docs_ci_graph) diff --git a/docs/requirements.txt b/docs/requirements.txt index 03cc92589..29c3f853d 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,3 +2,4 @@ Sphinx==9.1.0 sphinx-rtd-theme==3.1.0 sphinx-intl==2.3.2 breathe==4.36.0 +PyYAML==6.0.3