Skip to content

Commit 5f1e6ac

Browse files
authored
[doc] Embed CI graph generation in docs build (learning-process#832)
1 parent 8e2d73b commit 5f1e6ac

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

.github/workflows/pages.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,11 @@ jobs:
4444
- name: Install dependencies
4545
run: |
4646
python3 -m pip install -r docs/requirements.txt
47-
python3 -m pip install graphviz pyyaml
4847
- name: Download artifact
4948
uses: actions/download-artifact@v8
5049
with:
5150
name: doxygen-documentation-xml
5251
path: xml
53-
- name: Generate CI jobs graph
54-
run: |
55-
python3 scripts/jobs_graph.py --out docs/_static/ci_graph --format svg
5652
- name: Configure project
5753
run: >
5854
cmake -S . -B build -D USE_DOCS=ON -D PPC_BUILD_COMPONENTS=OFF

docs/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,22 @@ endif()
55
set(SOURCEDIR "${CMAKE_CURRENT_SOURCE_DIR}")
66
set(BUILDDIR "${CMAKE_CURRENT_BINARY_DIR}/_build/html")
77
set(GETTEXTDIR "${CMAKE_CURRENT_BINARY_DIR}/_build/gettext")
8+
set(CI_GRAPH_SOURCE "${CMAKE_SOURCE_DIR}/.github/workflows/main.yml")
9+
set(CI_GRAPH_OUTPUT "${SOURCEDIR}/_static/ci_graph.svg")
810

911
find_package(Python REQUIRED COMPONENTS Interpreter)
1012

13+
add_custom_command(
14+
OUTPUT "${CI_GRAPH_OUTPUT}"
15+
COMMAND
16+
${Python_EXECUTABLE} "${CMAKE_SOURCE_DIR}/scripts/jobs_graph.py" --workflow
17+
"${CI_GRAPH_SOURCE}" --out "${SOURCEDIR}/_static/ci_graph" --format svg
18+
DEPENDS "${CMAKE_SOURCE_DIR}/scripts/jobs_graph.py" "${CI_GRAPH_SOURCE}"
19+
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
20+
COMMENT "Generating CI jobs graph")
21+
22+
add_custom_target(docs_ci_graph DEPENDS "${CI_GRAPH_OUTPUT}")
23+
1124
add_custom_target(
1225
docs_help
1326
COMMAND ${SPHINXBUILD} -M help "${SOURCEDIR}" "${BUILDDIR}/en" ${SPHINXOPTS}
@@ -52,3 +65,4 @@ add_custom_target(
5265
${SPHINXOPTS}
5366
WORKING_DIRECTORY "${SOURCEDIR}"
5467
COMMENT "Building HTML documentation for English and Russian")
68+
add_dependencies(docs_html docs_ci_graph)

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ Sphinx==9.1.0
22
sphinx-rtd-theme==3.1.0
33
sphinx-intl==2.3.2
44
breathe==4.36.0
5+
PyYAML==6.0.3

0 commit comments

Comments
 (0)