Skip to content

Commit c1719eb

Browse files
authored
Add CI page in the documentation (#251)
- Briefly describe CI - Attach CI graph - Add CI graph automatic generation script to 'scripts' directory close #190
1 parent b57c5ac commit c1719eb

File tree

8 files changed

+409
-0
lines changed

8 files changed

+409
-0
lines changed

docs/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# from the environment for the first two.
66
SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
8+
SPHINXINTL ?= sphinx-intl
89
SOURCEDIR = .
910
BUILDDIR = _build/html
1011
SPHINXOPTS += -W --keep-going -n
@@ -18,5 +19,6 @@ help:
1819
# Catch-all target: route all unknown targets to Sphinx using the new
1920
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
2021
%: Makefile
22+
@$(SPHINXINTL) update -p _build/gettext -l en -l ru
2123
@$(SPHINXBUILD) -b html -D language=en "$(SOURCEDIR)" "$(BUILDDIR)/en" $(SPHINXOPTS) $(O)
2224
@$(SPHINXBUILD) -b html -D language=ru "$(SOURCEDIR)" "$(BUILDDIR)/ru" $(SPHINXOPTS) $(O)

docs/_static/.gitkeep

Whitespace-only changes.

docs/_static/ci_graph.svg

Lines changed: 252 additions & 0 deletions
Loading

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ Below is the table of contents for the Parallel Programming Course documentation
1111
user_guide/download
1212
user_guide/environment
1313
user_guide/submit_work
14+
user_guide/ci
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) 2025, Learning Process
3+
# This file is distributed under the same license as the Parallel
4+
# Programming Course package.
5+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
6+
#
7+
#, fuzzy
8+
msgid ""
9+
msgstr ""
10+
"Project-Id-Version: Parallel Programming Course \n"
11+
"Report-Msgid-Bugs-To: \n"
12+
"POT-Creation-Date: 2025-01-25 16:54+0100\n"
13+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
15+
"Language: en\n"
16+
"Language-Team: en <LL@li.org>\n"
17+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
18+
"MIME-Version: 1.0\n"
19+
"Content-Type: text/plain; charset=utf-8\n"
20+
"Content-Transfer-Encoding: 8bit\n"
21+
"Generated-By: Babel 2.16.0\n"
22+
23+
#: ../../user_guide/ci.rst:2
24+
msgid "Continuous Integration (CI)"
25+
msgstr ""
26+
27+
#: ../../user_guide/ci.rst:4
28+
msgid ""
29+
"Students need to pass all the checks in the CI pipeline before their work"
30+
" can be considered for submission. This includes successful code "
31+
"checkout, build ans testing stages. Each integration is verified by an "
32+
"automated build and automated tests."
33+
msgstr ""
34+
35+
#: ../../user_guide/ci.rst:9
36+
msgid "CI Pipeline"
37+
msgstr ""
38+
39+
#: ../../user_guide/ci.rst:11
40+
msgid "The CI pipeline for this project is illustrated in the following diagram:"
41+
msgstr ""
42+
43+
#: ../../user_guide/ci.rst:13
44+
msgid "CI Pipeline Diagram"
45+
msgstr ""
46+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) 2025, Learning Process
3+
# This file is distributed under the same license as the Parallel
4+
# Programming Course package.
5+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
6+
#
7+
#, fuzzy
8+
msgid ""
9+
msgstr ""
10+
"Project-Id-Version: Parallel Programming Course \n"
11+
"Report-Msgid-Bugs-To: \n"
12+
"POT-Creation-Date: 2025-01-25 16:54+0100\n"
13+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
15+
"Language: ru\n"
16+
"Language-Team: ru <LL@li.org>\n"
17+
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
18+
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
19+
"MIME-Version: 1.0\n"
20+
"Content-Type: text/plain; charset=utf-8\n"
21+
"Content-Transfer-Encoding: 8bit\n"
22+
"Generated-By: Babel 2.16.0\n"
23+
24+
#: ../../user_guide/ci.rst:2
25+
msgid "Continuous Integration (CI)"
26+
msgstr ""
27+
28+
#: ../../user_guide/ci.rst:4
29+
msgid ""
30+
"Students need to pass all the checks in the CI pipeline before their work"
31+
" can be considered for submission. This includes successful code "
32+
"checkout, build ans testing stages. Each integration is verified by an "
33+
"automated build and automated tests."
34+
msgstr ""
35+
36+
#: ../../user_guide/ci.rst:9
37+
msgid "CI Pipeline"
38+
msgstr ""
39+
40+
#: ../../user_guide/ci.rst:11
41+
msgid "The CI pipeline for this project is illustrated in the following diagram:"
42+
msgstr ""
43+
44+
#: ../../user_guide/ci.rst:13
45+
msgid "CI Pipeline Diagram"
46+
msgstr ""
47+

docs/user_guide/ci.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Continuous Integration (CI)
2+
============================
3+
4+
Students need to pass all the checks in the CI pipeline before their work can be considered for submission.
5+
This includes successful code checkout, build ans testing stages.
6+
Each integration is verified by an automated build and automated tests.
7+
8+
CI Pipeline
9+
------------
10+
11+
The CI pipeline for this project is illustrated in the following diagram:
12+
13+
.. image:: ../_static/ci_graph.svg
14+
:alt: CI Pipeline Diagram
15+
:align: center

scripts/jobs_graph.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import os
2+
3+
try:
4+
import yaml
5+
except ImportError:
6+
print("Please install pyyaml: pip install pyyaml")
7+
exit(1)
8+
9+
try:
10+
import graphviz
11+
except ImportError:
12+
print("Please install graphviz: pip install graphviz")
13+
exit(1)
14+
15+
16+
def parse_gha_yml(file_path):
17+
with open(file_path, "r") as file:
18+
gha_data = yaml.safe_load(file)
19+
return gha_data
20+
21+
22+
def build_jobs_graph(gha_data):
23+
jobs = gha_data.get("jobs", {})
24+
dot = graphviz.Digraph()
25+
26+
for job_name, job_data in jobs.items():
27+
dot.node(job_name)
28+
needs = job_data.get("needs", [])
29+
if isinstance(needs, str):
30+
needs = [needs]
31+
for dependency in needs:
32+
dot.edge(dependency, job_name)
33+
34+
return dot
35+
36+
37+
def save_graph(dot, filename, file_format):
38+
dot.render(filename, format=file_format, cleanup=True)
39+
40+
41+
if __name__ == "__main__":
42+
gha_file_path = os.path.join(".github", "workflows", "main.yml")
43+
svg_path = os.path.join("docs", "_static", "ci_graph")
44+
gha_data = parse_gha_yml(gha_file_path)
45+
jobs_graph = build_jobs_graph(gha_data)
46+
save_graph(jobs_graph, svg_path, "svg")

0 commit comments

Comments
 (0)