cikit 0.1.0__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cikit-0.1.0/src/cikit.egg-info → cikit-0.2.0}/PKG-INFO +4 -2
- {cikit-0.1.0 → cikit-0.2.0}/README.md +3 -1
- {cikit-0.1.0 → cikit-0.2.0}/ci_commands/coverage.py +2 -1
- {cikit-0.1.0 → cikit-0.2.0}/ci_commands/pylint.py +2 -1
- {cikit-0.1.0 → cikit-0.2.0}/ci_commands/ruff.py +2 -1
- {cikit-0.1.0 → cikit-0.2.0}/docs/concepts/cikit_data.rst +0 -1
- {cikit-0.1.0 → cikit-0.2.0}/docs/guides/builds.rst +37 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/guides/macros.rst +31 -3
- {cikit-0.1.0 → cikit-0.2.0}/pyproject.toml +1 -1
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/factory.py +2 -2
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/macros/cmake.py +121 -7
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/macros/coverage.py +0 -1
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/macros/reports.py +5 -5
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/timeline/timeline_chart.py +28 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/xml_tools.py +2 -4
- {cikit-0.1.0 → cikit-0.2.0/src/cikit.egg-info}/PKG-INFO +4 -2
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/test_ci_cli.py +42 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/test_cmake.py +5 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_factory.py +22 -18
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_macros/test_cmake.py +172 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_macros/test_coverage.py +1 -2
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_macros/test_reports.py +0 -2
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_timeline/test_timeline_chart.py +36 -8
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_xml_tools.py +2 -4
- {cikit-0.1.0 → cikit-0.2.0}/uv.lock +1 -1
- {cikit-0.1.0 → cikit-0.2.0}/.gitignore +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/.gitlab-ci.yml +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/.project +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/.pydevproject +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/.pylintrc +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/.repomixignore +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/LICENSE +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/ci_commands/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/ci_commands/all_.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/ci_commands/init.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/ci_commands/sphinx.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/ci_commands/test.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/Makefile +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/_static/logo/cikit-logo-192.png +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/_static/logo/cikit-logo.png +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/_static/logo/favicon.ico +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/build_reports/index.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/build_reports/lint.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/build_reports/tests.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/concepts/artifacts.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/concepts/environment.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/concepts/index.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/concepts/metadata.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/concepts/providers.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/conf.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/getting_started.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/guides/azure_devops.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/guides/ci_commands.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/guides/gitlab_ci.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/guides/index.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/guides/local_pipeline.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/guides/sphinx_build.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/guides/sphinx_extensions.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/guides/timelines.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/index.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/docs/roadmap.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/setup.cfg +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/artifacts.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/badge.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/ci/README.md +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/ci/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/ci/loader.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/ci/main.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/ci/runner.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/command.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/data/README.md +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/data/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/data/api.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/data/cli.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/data/client.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/data/common.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/env/README.md +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/env/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/env/api.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/env/cli.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/env/common.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/env/env_vars.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/env/provider.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/errors.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/json_utils.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/lint_to_rst.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/logging_utils.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/macros/README.md +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/macros/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/macros/bundle.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/macros/common.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/macros/platformio.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/macros/pylint.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/macros/pytest.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/macros/ruff.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/macros/sphinx.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/project_meta.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/resources/php/cikit_data/.htaccess +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/resources/php/cikit_data/README.md +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/resources/php/cikit_data/cikit_data_common.php +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/resources/php/cikit_data/cikit_data_create.php +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/resources/php/cikit_data/cikit_data_latest.php +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/resources/php/cikit_data/cikit_data_timeline.php +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/resources/php/cikit_data/cikit_data_update.php +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/resources/php/cikit_data/config.php +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/resources/php/cikit_data/config.php.example +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/resources/php/cikit_data/generate_secrets.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/resources/sql/cikit_data/README.md +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/resources/sql/cikit_data/db_init.sql +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/resources/sql/cikit_data/db_reset.sql +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/rst_tools.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/sphinx_ext/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/sphinx_ext/chart.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/sphinx_ext/hash.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/sphinx_ext/log.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/sphinx_ext/metrics.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/status.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/systemtest/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/systemtest/fixtures.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/timeline/README.md +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/timeline/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/timeline/__main__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/timeline/charts.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/timeline/presets.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit/timeline/preview.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit.egg-info/SOURCES.txt +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit.egg-info/dependency_links.txt +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit.egg-info/entry_points.txt +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit.egg-info/requires.txt +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/src/cikit.egg-info/top_level.txt +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/conftest.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/cmake_error/CMakeLists.txt +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/cmake_error/main.c +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/cmake_native/CMakeLists.txt +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/cmake_native/linker.ld +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/cmake_native/main.c +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/cmake_warning/CMakeLists.txt +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/cmake_warning/main.c +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/platformio_error/platformio.ini +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/platformio_error/src/main.c +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/platformio_native/platformio.ini +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/platformio_native/src/main.cpp +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/sphinx/docs/conf.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/sphinx/docs/index.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/sphinx_invalid/docs/ index.rst +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/projects/sphinx_invalid/docs/conf.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/test_data_cli.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/test_env_cli.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/test_platformio.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/systemtests/test_sphinx.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_ci_commands/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_ci_commands/test_all.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_ci_commands/test_sphinx.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_artifacts.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_badge.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_command.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_data/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_data/test_api.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_data/test_cli.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_data/test_client.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_data/test_common.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_env/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_env/test_api.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_env/test_common.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_env/test_env_vars.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_env/test_provider.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_errors.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_json_utils.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_lint_to_rst.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_logging_utils.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_macros/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_macros/test_bundle.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_macros/test_common.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_macros/test_platformio.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_macros/test_pylint.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_macros/test_pytest.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_macros/test_ruff.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_macros/test_sphinx.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_project_meta.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_rst_tools.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_sphinx_ext/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_sphinx_ext/test_chart.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_sphinx_ext/test_hash.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_sphinx_ext/test_init.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_sphinx_ext/test_log.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_sphinx_ext/test_metrics.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_status.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_timeline/__init__.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_timeline/test_charts.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_timeline/test_presets.py +0 -0
- {cikit-0.1.0 → cikit-0.2.0}/tests/unittests/test_cikit/test_timeline/test_preview.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cikit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: CI helper toolkit
|
|
5
5
|
Author-email: Sven Schlender <svesch@gmx.de>
|
|
6
6
|
License-Expression: GPL-3.0-or-later
|
|
@@ -176,7 +176,7 @@ mainly parse arguments, open CI sections, and compose these macros.
|
|
|
176
176
|
| `pylint` | Pylint execution, reports, badges, timelines, and rule-specific reports |
|
|
177
177
|
| `pytest` | pytest execution, JUnit XML, and optional parallel coverage collection |
|
|
178
178
|
| `coverage` | Python/gcovr coverage, Cobertura XML, HTML reports, badges, and timelines |
|
|
179
|
-
| `cmake` | CMake configure/build, CTest, build metrics, memory parsing, logs, and reports |
|
|
179
|
+
| `cmake` | CMake configure/build, CTest, compiler metadata, build metrics, memory parsing, logs, and reports |
|
|
180
180
|
| `platformio` | PlatformIO builds, compiler metadata, build metrics, memory parsing, logs, and reports |
|
|
181
181
|
| `reports` | Shared test and build report generation |
|
|
182
182
|
| `sphinx` | Documentation preparation, build, and artifact integration |
|
|
@@ -190,6 +190,7 @@ well-defined logical run.
|
|
|
190
190
|
CMake and PlatformIO builds can collect data such as:
|
|
191
191
|
|
|
192
192
|
* configure, build, and total build time
|
|
193
|
+
* compiler name, version, and type
|
|
193
194
|
* compiled file counts
|
|
194
195
|
* compiler warning and error counts
|
|
195
196
|
* memory usage where the toolchain exposes it
|
|
@@ -215,6 +216,7 @@ cmake.cmake_configure(
|
|
|
215
216
|
generator="Ninja",
|
|
216
217
|
clean=True,
|
|
217
218
|
)
|
|
219
|
+
cmake.gather_compiler_meta(env, build_dir, "CXX")
|
|
218
220
|
cmake.cmake_build(env, build_dir)
|
|
219
221
|
cmake.write_rst(env)
|
|
220
222
|
```
|
|
@@ -156,7 +156,7 @@ mainly parse arguments, open CI sections, and compose these macros.
|
|
|
156
156
|
| `pylint` | Pylint execution, reports, badges, timelines, and rule-specific reports |
|
|
157
157
|
| `pytest` | pytest execution, JUnit XML, and optional parallel coverage collection |
|
|
158
158
|
| `coverage` | Python/gcovr coverage, Cobertura XML, HTML reports, badges, and timelines |
|
|
159
|
-
| `cmake` | CMake configure/build, CTest, build metrics, memory parsing, logs, and reports |
|
|
159
|
+
| `cmake` | CMake configure/build, CTest, compiler metadata, build metrics, memory parsing, logs, and reports |
|
|
160
160
|
| `platformio` | PlatformIO builds, compiler metadata, build metrics, memory parsing, logs, and reports |
|
|
161
161
|
| `reports` | Shared test and build report generation |
|
|
162
162
|
| `sphinx` | Documentation preparation, build, and artifact integration |
|
|
@@ -170,6 +170,7 @@ well-defined logical run.
|
|
|
170
170
|
CMake and PlatformIO builds can collect data such as:
|
|
171
171
|
|
|
172
172
|
* configure, build, and total build time
|
|
173
|
+
* compiler name, version, and type
|
|
173
174
|
* compiled file counts
|
|
174
175
|
* compiler warning and error counts
|
|
175
176
|
* memory usage where the toolchain exposes it
|
|
@@ -195,6 +196,7 @@ cmake.cmake_configure(
|
|
|
195
196
|
generator="Ninja",
|
|
196
197
|
clean=True,
|
|
197
198
|
)
|
|
199
|
+
cmake.gather_compiler_meta(env, build_dir, "CXX")
|
|
198
200
|
cmake.cmake_build(env, build_dir)
|
|
199
201
|
cmake.write_rst(env)
|
|
200
202
|
```
|
|
@@ -35,7 +35,8 @@ def run(env, status, args: argparse.Namespace):
|
|
|
35
35
|
raise CiRecoverableError("Coverage is below level!")
|
|
36
36
|
|
|
37
37
|
with CiOptionalSection("Create timeline chart", status=status):
|
|
38
|
-
timeline = chart_timeline(env, keys=["coverage"], title="Coverage %"
|
|
38
|
+
timeline = chart_timeline(env, keys=["coverage"], title="Coverage %")
|
|
39
|
+
timeline.set_min_y_range(0, 100)
|
|
39
40
|
timeline.create(env, "coverage")
|
|
40
41
|
|
|
41
42
|
with CiSection("Generating coverage rst", status=status):
|
|
@@ -36,7 +36,8 @@ def run(env, status, args: argparse.Namespace):
|
|
|
36
36
|
|
|
37
37
|
with CiOptionalSection("Create timeline chart", status=status):
|
|
38
38
|
timeline = chart_timeline(env, keys=["error", "warning", "refactoring", "convention"],
|
|
39
|
-
title="Pylint messages"
|
|
39
|
+
title="Pylint messages")
|
|
40
|
+
timeline.set_min_y_range(0, 50)
|
|
40
41
|
timeline.create(env, "pylint")
|
|
41
42
|
|
|
42
43
|
with CiSection("Generating pylint badge", status=status):
|
|
@@ -35,7 +35,8 @@ def run(env, status, args: argparse.Namespace):
|
|
|
35
35
|
ruff.gitlab_code_quality(env, args.paths)
|
|
36
36
|
|
|
37
37
|
with CiOptionalSection("Create timeline chart", status=status):
|
|
38
|
-
timeline = chart_timeline(env, keys=["violations"], title="Ruff violations"
|
|
38
|
+
timeline = chart_timeline(env, keys=["violations"], title="Ruff violations")
|
|
39
|
+
timeline.set_min_y_range(0, 10)
|
|
39
40
|
timeline.create(env, "ruff")
|
|
40
41
|
|
|
41
42
|
with CiSection("Generating ruff badge", status=status):
|
|
@@ -91,6 +91,12 @@ The build report understands a common set of run data keys.
|
|
|
91
91
|
- Total bytes for one detected memory region.
|
|
92
92
|
* - ``memory_<region>_percent``
|
|
93
93
|
- Percentage used for one detected memory region.
|
|
94
|
+
* - ``compiler``
|
|
95
|
+
- Compiler executable used by the build.
|
|
96
|
+
* - ``compiler_version``
|
|
97
|
+
- Detected compiler version.
|
|
98
|
+
* - ``compiler_type``
|
|
99
|
+
- Compiler type or tool-specific compiler identifier.
|
|
94
100
|
|
|
95
101
|
Not every build tool provides every metric.
|
|
96
102
|
|
|
@@ -120,6 +126,7 @@ Typical usage:
|
|
|
120
126
|
clean=True,
|
|
121
127
|
)
|
|
122
128
|
|
|
129
|
+
cmake.gather_compiler_meta(env, build_dir, "CXX")
|
|
123
130
|
cmake.cmake_build(env, build_dir)
|
|
124
131
|
cmake.write_rst(env)
|
|
125
132
|
|
|
@@ -219,6 +226,33 @@ and automatically registered as a ``LOG`` artifact.
|
|
|
219
226
|
The log is written even when configuration fails. The configure return code is
|
|
220
227
|
checked only after the log and ``configure_time`` have been persisted.
|
|
221
228
|
|
|
229
|
+
Compiler Metadata
|
|
230
|
+
^^^^^^^^^^^^^^^^^
|
|
231
|
+
|
|
232
|
+
After configuration, compiler metadata can be collected for a CMake language:
|
|
233
|
+
|
|
234
|
+
.. code-block:: python
|
|
235
|
+
|
|
236
|
+
cmake.gather_compiler_meta(env, build_dir, "CXX")
|
|
237
|
+
|
|
238
|
+
The language must match a language enabled by the configured CMake project, for
|
|
239
|
+
example ``C`` or ``CXX``.
|
|
240
|
+
|
|
241
|
+
cikit uses the CMake File API ``toolchains-v1`` reply generated during
|
|
242
|
+
``cmake_configure()`` and stores:
|
|
243
|
+
|
|
244
|
+
.. code-block:: text
|
|
245
|
+
|
|
246
|
+
compiler
|
|
247
|
+
compiler_version
|
|
248
|
+
compiler_type
|
|
249
|
+
|
|
250
|
+
``compiler_type`` contains the compiler ID reported by CMake, for example
|
|
251
|
+
``GNU`` or ``Clang``.
|
|
252
|
+
|
|
253
|
+
Missing, invalid, or unavailable toolchain metadata is reported as a
|
|
254
|
+
``CiToolsError``.
|
|
255
|
+
|
|
222
256
|
CMake Build
|
|
223
257
|
^^^^^^^^^^^
|
|
224
258
|
|
|
@@ -637,6 +671,7 @@ A project-specific CMake command can combine the complete workflow:
|
|
|
637
671
|
clean=True,
|
|
638
672
|
)
|
|
639
673
|
|
|
674
|
+
cmake.gather_compiler_meta(env, build_dir, "CXX")
|
|
640
675
|
cmake.cmake_build(env, build_dir)
|
|
641
676
|
|
|
642
677
|
env.copy_artifact(
|
|
@@ -658,6 +693,8 @@ The important order is:
|
|
|
658
693
|
|
|
659
694
|
configure
|
|
660
695
|
|
|
|
696
|
+
gather compiler metadata
|
|
697
|
+
|
|
|
661
698
|
build
|
|
662
699
|
|
|
|
663
700
|
register outputs
|
|
@@ -61,8 +61,8 @@ The current macro dependencies are:
|
|
|
61
61
|
- ``gcovr`` and a compatible ``gcov`` tool
|
|
62
62
|
- Required by ``ccoverage()``. The coverage tool must match the compiler used to build the instrumented code, e.g. ``gcov`` for GCC or ``llvm-cov gcov`` for Clang.
|
|
63
63
|
* - ``cmake``
|
|
64
|
-
- ``cmake`` / ``ctest``
|
|
65
|
-
- Required for CMake builds and CTest execution.
|
|
64
|
+
- ``cmake >= 3.20`` / ``ctest``
|
|
65
|
+
- Required for CMake builds, File API compiler metadata, and CTest execution.
|
|
66
66
|
* - ``cmake``
|
|
67
67
|
- Selected generator
|
|
68
68
|
- For example, ``generator="Ninja"`` requires ``ninja``.
|
|
@@ -324,7 +324,7 @@ The ``cmake`` macro supports CMake configuration, builds, and CTest execution.
|
|
|
324
324
|
Dependencies
|
|
325
325
|
^^^^^^^^^^^^
|
|
326
326
|
|
|
327
|
-
|
|
327
|
+
CMake 3.20 or newer providing ``cmake`` and ``ctest`` is required.
|
|
328
328
|
|
|
329
329
|
The selected CMake generator and project toolchain must also be available. For example,
|
|
330
330
|
using ``generator="Ninja"`` requires the ``ninja`` executable. Compilers and linkers are
|
|
@@ -336,6 +336,7 @@ Features
|
|
|
336
336
|
* CMake configuration
|
|
337
337
|
* optional clean configuration
|
|
338
338
|
* CMake build execution
|
|
339
|
+
* compiler metadata collection through the CMake File API
|
|
339
340
|
* CTest execution
|
|
340
341
|
* parallel execution
|
|
341
342
|
* configure, build, and total build time metrics
|
|
@@ -367,6 +368,7 @@ Typical build usage
|
|
|
367
368
|
clean=True,
|
|
368
369
|
)
|
|
369
370
|
|
|
371
|
+
cmake.gather_compiler_meta(env, build_dir, "CXX")
|
|
370
372
|
cmake.cmake_build(env, build_dir)
|
|
371
373
|
cmake.write_rst(env)
|
|
372
374
|
|
|
@@ -383,6 +385,31 @@ CTest can also be executed independently on an already configured build director
|
|
|
383
385
|
Build reports include the metrics and artifacts available for the current run. See
|
|
384
386
|
:doc:`builds` for the wider build and report workflow.
|
|
385
387
|
|
|
388
|
+
Compiler Metadata
|
|
389
|
+
^^^^^^^^^^^^^^^^^
|
|
390
|
+
|
|
391
|
+
After configuration, compiler metadata can be collected for a CMake language:
|
|
392
|
+
|
|
393
|
+
.. code-block:: python
|
|
394
|
+
|
|
395
|
+
cmake.gather_compiler_meta(env, build_dir, "CXX")
|
|
396
|
+
|
|
397
|
+
The language must match a language enabled by the configured CMake project, for
|
|
398
|
+
example ``C`` or ``CXX``.
|
|
399
|
+
|
|
400
|
+
cikit uses the CMake File API ``toolchains-v1`` reply generated during
|
|
401
|
+
``cmake_configure()`` and stores:
|
|
402
|
+
|
|
403
|
+
* ``compiler``
|
|
404
|
+
* ``compiler_version``
|
|
405
|
+
* ``compiler_type``
|
|
406
|
+
|
|
407
|
+
``compiler_type`` contains the compiler ID reported by CMake, for example
|
|
408
|
+
``GNU`` or ``Clang``.
|
|
409
|
+
|
|
410
|
+
Missing, invalid, or unavailable toolchain metadata is reported as a
|
|
411
|
+
``CiToolsError``.
|
|
412
|
+
|
|
386
413
|
PlatformIO
|
|
387
414
|
----------
|
|
388
415
|
|
|
@@ -629,6 +656,7 @@ A CMake build command can compose several build helpers:
|
|
|
629
656
|
generator="Ninja",
|
|
630
657
|
clean=True,
|
|
631
658
|
)
|
|
659
|
+
cmake.gather_compiler_meta(env, build_dir, "CXX")
|
|
632
660
|
cmake.cmake_build(env, build_dir)
|
|
633
661
|
cmake.write_rst(env)
|
|
634
662
|
|
|
@@ -42,11 +42,11 @@ def _resolve_cikit_data_project(env) -> str:
|
|
|
42
42
|
if addressing != "provider":
|
|
43
43
|
raise CiToolsError(f"Unsupported CIKIT_DATA_ADDRESSING value: {addressing!r}")
|
|
44
44
|
|
|
45
|
-
provider_project = env.provider_project
|
|
45
|
+
provider_project = env.provider.provider_project
|
|
46
46
|
if not provider_project:
|
|
47
47
|
return env["PROJECT_NAME"]
|
|
48
48
|
|
|
49
|
-
provider_scope = env.provider_scope
|
|
49
|
+
provider_scope = env.provider.provider_scope
|
|
50
50
|
if not provider_scope:
|
|
51
51
|
return provider_project
|
|
52
52
|
|
|
@@ -21,6 +21,7 @@ from tempfile import TemporaryDirectory
|
|
|
21
21
|
from cikit.artifacts import Artifact, ArtifactType
|
|
22
22
|
from cikit.command import Command, run_command
|
|
23
23
|
from cikit.errors import CiToolsError
|
|
24
|
+
from cikit.json_utils import load_json_file
|
|
24
25
|
|
|
25
26
|
from .reports import write_build_report, process_test_result
|
|
26
27
|
|
|
@@ -29,6 +30,8 @@ CMAKE_COMPILE_COMMANDS = "compile_commands.json"
|
|
|
29
30
|
|
|
30
31
|
CMAKE_CONFIGURE_LOG = "cmake-configure.log"
|
|
31
32
|
CMAKE_BUILD_LOG = "cmake-build.log"
|
|
33
|
+
CMAKE_FILE_API_QUERY_DIR = Path(".cmake/api/v1/query/client-cikit")
|
|
34
|
+
CMAKE_TOOLCHAINS_QUERY = "toolchains-v1"
|
|
32
35
|
|
|
33
36
|
BUILD_OBJECT_PATTERN = re.compile(r"\bBuilding\s+.+?\s+object\b")
|
|
34
37
|
MEMORY_PATTERN = re.compile(
|
|
@@ -37,17 +40,86 @@ MEMORY_PATTERN = re.compile(
|
|
|
37
40
|
r"(?P<total>[\d.]+)\s*(?P<total_unit>[KMGT]?B)\s+"
|
|
38
41
|
r"(?P<percent>[\d.]+)%\s*$"
|
|
39
42
|
)
|
|
40
|
-
MEMORY_FACTORS = {
|
|
41
|
-
"B": 1,
|
|
42
|
-
"KB": 1024,
|
|
43
|
-
"MB": 1024**2,
|
|
44
|
-
"GB": 1024**3,
|
|
45
|
-
"TB": 1024**4,
|
|
46
|
-
}
|
|
43
|
+
MEMORY_FACTORS = {"B": 1, "KB": 1024, "MB": 1024**2, "GB": 1024**3, "TB": 1024**4}
|
|
47
44
|
WARNING_PATTERN = re.compile(r"\bwarning:\s", re.IGNORECASE)
|
|
48
45
|
ERROR_PATTERN = re.compile(r"\berror:\s", re.IGNORECASE)
|
|
49
46
|
|
|
50
47
|
|
|
48
|
+
def _prepare_file_api_query(build_dir: Path):
|
|
49
|
+
"""Prepare the CMake File API query for toolchain metadata.
|
|
50
|
+
|
|
51
|
+
The query requests normalized compiler information for all languages
|
|
52
|
+
enabled by the CMake project. CMake generates the corresponding reply
|
|
53
|
+
during configuration.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
build_dir: CMake build directory.
|
|
57
|
+
"""
|
|
58
|
+
query_dir = build_dir / CMAKE_FILE_API_QUERY_DIR
|
|
59
|
+
query_dir.mkdir(parents=True, exist_ok=True)
|
|
60
|
+
(query_dir / CMAKE_TOOLCHAINS_QUERY).touch()
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def _load_toolchains_reply(build_dir: Path) -> dict:
|
|
64
|
+
"""Load the CMake File API toolchains reply.
|
|
65
|
+
|
|
66
|
+
The newest reply index generated by CMake is resolved and the toolchains
|
|
67
|
+
reply belonging to the cikit client query is loaded from it.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
build_dir: Configured CMake build directory.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
Parsed toolchains reply.
|
|
74
|
+
|
|
75
|
+
Raises:
|
|
76
|
+
CiToolsError: If the File API reply is missing or invalid.
|
|
77
|
+
"""
|
|
78
|
+
reply_dir = build_dir / ".cmake" / "api" / "v1" / "reply"
|
|
79
|
+
index_files = sorted(reply_dir.glob("index-*.json"))
|
|
80
|
+
|
|
81
|
+
if not index_files:
|
|
82
|
+
raise CiToolsError("CMake File API reply index not found")
|
|
83
|
+
|
|
84
|
+
index = load_json_file(index_files[-1], description="CMake File API index")
|
|
85
|
+
|
|
86
|
+
try:
|
|
87
|
+
reply = index["reply"]["client-cikit"]["toolchains-v1"]
|
|
88
|
+
reply_file = reply_dir / reply["jsonFile"]
|
|
89
|
+
except (KeyError, TypeError) as exp:
|
|
90
|
+
raise CiToolsError("CMake File API toolchains reply not found") from exp
|
|
91
|
+
|
|
92
|
+
toolchains = load_json_file(reply_file, description="CMake File API toolchains reply")
|
|
93
|
+
|
|
94
|
+
if not toolchains:
|
|
95
|
+
raise CiToolsError("CMake File API toolchains reply not found")
|
|
96
|
+
|
|
97
|
+
return toolchains
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _get_toolchain(build_dir: Path, language: str) -> dict:
|
|
101
|
+
"""Return CMake toolchain metadata for one language.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
build_dir: Configured CMake build directory.
|
|
105
|
+
language: CMake language name, for example ``C`` or ``CXX``.
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
Toolchain metadata for the requested language.
|
|
109
|
+
|
|
110
|
+
Raises:
|
|
111
|
+
CiToolsError: If the toolchain metadata cannot be loaded or the
|
|
112
|
+
requested language is unavailable.
|
|
113
|
+
"""
|
|
114
|
+
data = _load_toolchains_reply(build_dir)
|
|
115
|
+
|
|
116
|
+
for toolchain in data.get("toolchains", []):
|
|
117
|
+
if toolchain.get("language") == language:
|
|
118
|
+
return toolchain
|
|
119
|
+
|
|
120
|
+
raise CiToolsError(f"CMake toolchain for language '{language}' not found")
|
|
121
|
+
|
|
122
|
+
|
|
51
123
|
def _extract_diagnostics(output: str) -> dict:
|
|
52
124
|
"""Extract warning and error counts from Ninja build output.
|
|
53
125
|
|
|
@@ -221,6 +293,8 @@ def cmake_configure(env, source_dir: Path, build_dir: Path, *, defines: list[str
|
|
|
221
293
|
if clean:
|
|
222
294
|
shutil.rmtree(build_dir, ignore_errors=True)
|
|
223
295
|
|
|
296
|
+
_prepare_file_api_query(build_dir)
|
|
297
|
+
|
|
224
298
|
args = []
|
|
225
299
|
if generator:
|
|
226
300
|
args.extend(["-G", generator])
|
|
@@ -255,6 +329,46 @@ def cmake_configure(env, source_dir: Path, build_dir: Path, *, defines: list[str
|
|
|
255
329
|
env.copy_artifact(compile_commands_file, ArtifactType.METADATA)
|
|
256
330
|
|
|
257
331
|
|
|
332
|
+
def gather_compiler_meta(env, build_dir: Path, language: str):
|
|
333
|
+
"""Gather compiler metadata from a configured CMake project.
|
|
334
|
+
|
|
335
|
+
CMake File API toolchain metadata is used to determine the compiler selected
|
|
336
|
+
for the requested language. This requires CMake 3.20 or newer.
|
|
337
|
+
|
|
338
|
+
Detected compiler metadata is stored directly in the run data. Missing or
|
|
339
|
+
invalid metadata is reported as a ``CiToolsError``.
|
|
340
|
+
|
|
341
|
+
Args:
|
|
342
|
+
env: Resolved CI run environment.
|
|
343
|
+
build_dir: Configured CMake build directory.
|
|
344
|
+
language: CMake language name, for example ``C`` or ``CXX``.
|
|
345
|
+
|
|
346
|
+
Raises:
|
|
347
|
+
CiToolsError: If the CMake File API data is missing, invalid, or does
|
|
348
|
+
not contain compiler metadata for the requested language.
|
|
349
|
+
"""
|
|
350
|
+
toolchain = _get_toolchain(build_dir, language)
|
|
351
|
+
|
|
352
|
+
compiler = toolchain.get("compiler", {})
|
|
353
|
+
compiler_path = compiler.get("path")
|
|
354
|
+
compiler_version = compiler.get("version")
|
|
355
|
+
|
|
356
|
+
if not compiler_path:
|
|
357
|
+
raise CiToolsError(f"CMake compiler path for language '{language}' not found")
|
|
358
|
+
|
|
359
|
+
if not compiler_version:
|
|
360
|
+
raise CiToolsError(f"CMake compiler version for language '{language}' not found")
|
|
361
|
+
|
|
362
|
+
compiler_meta = {"compiler": Path(compiler_path).name.removesuffix(".exe"),
|
|
363
|
+
"compiler_version": compiler_version}
|
|
364
|
+
|
|
365
|
+
compiler_type = compiler.get("id")
|
|
366
|
+
if compiler_type:
|
|
367
|
+
compiler_meta["compiler_type"] = compiler_type
|
|
368
|
+
|
|
369
|
+
env.data_update(compiler_meta)
|
|
370
|
+
|
|
371
|
+
|
|
258
372
|
def cmake_build(env, build_dir: Path, jobs: int = 0):
|
|
259
373
|
"""Build a configured CMake project and store extracted build metrics.
|
|
260
374
|
|
|
@@ -157,7 +157,6 @@ def write_rst(env, report_title: str = None) -> Artifact:
|
|
|
157
157
|
summary = RstBlock("Summary")
|
|
158
158
|
summary.extend([
|
|
159
159
|
f"- Coverage: {env.data.get('coverage')}",
|
|
160
|
-
f"- Line rate: {env.data.get('line_rate')}",
|
|
161
160
|
f"- Lines covered: {env.data.get('lines_covered')}",
|
|
162
161
|
f"- Lines valid: {env.data.get('lines_valid')}",
|
|
163
162
|
"",
|
|
@@ -157,9 +157,10 @@ def write_build_report(env, name: str = None, report_title: str = None) -> Artif
|
|
|
157
157
|
def process_test_result(env, test_alias: str, report_file: Path, returncode: int):
|
|
158
158
|
"""Process and persist a JUnit-compatible test result.
|
|
159
159
|
|
|
160
|
-
The JUnit report is parsed
|
|
161
|
-
the
|
|
162
|
-
available result data has
|
|
160
|
+
The JUnit report is parsed and registered as an XUnit artifact. Extracted
|
|
161
|
+
test metrics and the process exit code are stored in the current run data.
|
|
162
|
+
Failed test execution is reported only after all available result data has
|
|
163
|
+
been persisted.
|
|
163
164
|
|
|
164
165
|
Args:
|
|
165
166
|
env: Resolved CI run environment.
|
|
@@ -173,8 +174,7 @@ def process_test_result(env, test_alias: str, report_file: Path, returncode: int
|
|
|
173
174
|
result = read_junit_totals(test_alias, report_file)
|
|
174
175
|
result["exit_code"] = returncode
|
|
175
176
|
|
|
176
|
-
|
|
177
|
-
result["xml_file"] = artifact.target_name
|
|
177
|
+
env.copy_artifact(report_file, ArtifactType.XUNIT)
|
|
178
178
|
|
|
179
179
|
env.data_update(result)
|
|
180
180
|
|
|
@@ -219,3 +219,31 @@ class TimelineChart:
|
|
|
219
219
|
output_file = Path(temp_dir) / filename
|
|
220
220
|
self.render(output_file)
|
|
221
221
|
return env.copy_artifact(output_file, ArtifactType.TIMELINE)
|
|
222
|
+
|
|
223
|
+
def set_min_y_range(self, minimum: float, maximum: float):
|
|
224
|
+
"""Set a minimum visible range for the Y axis.
|
|
225
|
+
|
|
226
|
+
The configured range is expanded when timeline values exceed either
|
|
227
|
+
boundary.
|
|
228
|
+
|
|
229
|
+
Args:
|
|
230
|
+
minimum: Minimum lower Y-axis boundary.
|
|
231
|
+
maximum: Minimum upper Y-axis boundary.
|
|
232
|
+
|
|
233
|
+
Raises:
|
|
234
|
+
CiToolsError: If minimum is not smaller than maximum.
|
|
235
|
+
"""
|
|
236
|
+
if minimum >= maximum:
|
|
237
|
+
raise CiToolsError("Minimum Y range must have minimum < maximum.")
|
|
238
|
+
|
|
239
|
+
values = []
|
|
240
|
+
for series in self._series_map.values():
|
|
241
|
+
for value in series:
|
|
242
|
+
if isinstance(value, (int, float)):
|
|
243
|
+
values.append(value)
|
|
244
|
+
|
|
245
|
+
if values:
|
|
246
|
+
minimum = min(minimum, *values)
|
|
247
|
+
maximum = max(maximum, *values)
|
|
248
|
+
|
|
249
|
+
self._chart_options["range"] = (minimum, maximum)
|
|
@@ -85,8 +85,7 @@ def read_cobertura_coverage(xml_file: Path) -> dict:
|
|
|
85
85
|
|
|
86
86
|
Returns:
|
|
87
87
|
Dict containing:
|
|
88
|
-
|
|
89
|
-
coverage: Rounded coverage percentage (0 .. 100).
|
|
88
|
+
coverage: Coverage percentage rounded to one decimal place (0.0 .. 100.0).
|
|
90
89
|
lines_covered: Number of executed lines.
|
|
91
90
|
lines_valid: Total number of executable lines.
|
|
92
91
|
|
|
@@ -121,8 +120,7 @@ def read_cobertura_coverage(xml_file: Path) -> dict:
|
|
|
121
120
|
raise CiToolsError(f"Invalid line counters in XML file: {xml_file}") from exp
|
|
122
121
|
|
|
123
122
|
return {
|
|
124
|
-
"
|
|
125
|
-
"coverage": round(line_rate * 100),
|
|
123
|
+
"coverage": round(line_rate * 100, 1),
|
|
126
124
|
"lines_covered": lines_covered,
|
|
127
125
|
"lines_valid": lines_valid,
|
|
128
126
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cikit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: CI helper toolkit
|
|
5
5
|
Author-email: Sven Schlender <svesch@gmx.de>
|
|
6
6
|
License-Expression: GPL-3.0-or-later
|
|
@@ -176,7 +176,7 @@ mainly parse arguments, open CI sections, and compose these macros.
|
|
|
176
176
|
| `pylint` | Pylint execution, reports, badges, timelines, and rule-specific reports |
|
|
177
177
|
| `pytest` | pytest execution, JUnit XML, and optional parallel coverage collection |
|
|
178
178
|
| `coverage` | Python/gcovr coverage, Cobertura XML, HTML reports, badges, and timelines |
|
|
179
|
-
| `cmake` | CMake configure/build, CTest, build metrics, memory parsing, logs, and reports |
|
|
179
|
+
| `cmake` | CMake configure/build, CTest, compiler metadata, build metrics, memory parsing, logs, and reports |
|
|
180
180
|
| `platformio` | PlatformIO builds, compiler metadata, build metrics, memory parsing, logs, and reports |
|
|
181
181
|
| `reports` | Shared test and build report generation |
|
|
182
182
|
| `sphinx` | Documentation preparation, build, and artifact integration |
|
|
@@ -190,6 +190,7 @@ well-defined logical run.
|
|
|
190
190
|
CMake and PlatformIO builds can collect data such as:
|
|
191
191
|
|
|
192
192
|
* configure, build, and total build time
|
|
193
|
+
* compiler name, version, and type
|
|
193
194
|
* compiled file counts
|
|
194
195
|
* compiler warning and error counts
|
|
195
196
|
* memory usage where the toolchain exposes it
|
|
@@ -215,6 +216,7 @@ cmake.cmake_configure(
|
|
|
215
216
|
generator="Ninja",
|
|
216
217
|
clean=True,
|
|
217
218
|
)
|
|
219
|
+
cmake.gather_compiler_meta(env, build_dir, "CXX")
|
|
218
220
|
cmake.cmake_build(env, build_dir)
|
|
219
221
|
cmake.write_rst(env)
|
|
220
222
|
```
|
|
@@ -7,10 +7,17 @@ Date:
|
|
|
7
7
|
2026-06-16
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
+
import pytest
|
|
11
|
+
|
|
10
12
|
from cikit.command import run_command
|
|
11
13
|
from cikit.macros.pytest import build_coverage_command
|
|
12
14
|
|
|
13
15
|
|
|
16
|
+
_PROVIDER_ENV_KEYS = ("GITLAB_CI", "TF_BUILD", "CI_PROJECT_NAMESPACE", "CI_PROJECT_NAME",
|
|
17
|
+
"CI_PIPELINE_ID", "SYSTEM_TEAMPROJECT", "BUILD_REPOSITORY_NAME",
|
|
18
|
+
"BUILD_BUILDID", "BUILD_BUILDNUMBER", "CIKIT_PIPELINE_ID")
|
|
19
|
+
|
|
20
|
+
|
|
14
21
|
def _run_ci(env, args: list, *, check_exit_code: bool = True):
|
|
15
22
|
"""Run the cikit CI CLI through coverage.
|
|
16
23
|
|
|
@@ -33,6 +40,41 @@ def _run_ci(env, args: list, *, check_exit_code: bool = True):
|
|
|
33
40
|
check_exit_code=check_exit_code)
|
|
34
41
|
|
|
35
42
|
|
|
43
|
+
@pytest.mark.parametrize(("provider_env", "provider_name"),
|
|
44
|
+
[
|
|
45
|
+
pytest.param({"GITLAB_CI": "true", "CI_PROJECT_NAMESPACE": "embedded",
|
|
46
|
+
"CI_PROJECT_NAME": "cikit", "CI_PIPELINE_ID": "123"}, "GITLAB", id="gitlab"),
|
|
47
|
+
pytest.param({"TF_BUILD": "true", "SYSTEM_TEAMPROJECT": "Embedded",
|
|
48
|
+
"BUILD_REPOSITORY_NAME": "cikit", "BUILD_BUILDID": "123"}, "AZURE_DEVOPS",
|
|
49
|
+
id="azure-devops"),
|
|
50
|
+
pytest.param({"CIKIT_PIPELINE_ID": "local-123"}, "LOCALGIT", id="local"),
|
|
51
|
+
],
|
|
52
|
+
)
|
|
53
|
+
def test_init_with_provider_data_addressing(
|
|
54
|
+
env, monkeypatch, tmp_path, provider_env, provider_name):
|
|
55
|
+
"""Verify provider based cikit data addressing with all supported providers."""
|
|
56
|
+
for key in _PROVIDER_ENV_KEYS:
|
|
57
|
+
monkeypatch.delenv(key, raising=False)
|
|
58
|
+
|
|
59
|
+
monkeypatch.delenv("CIKIT_DATA_BASE_URL", raising=False)
|
|
60
|
+
monkeypatch.delenv("CIKIT_DATA_API_TOKEN", raising=False)
|
|
61
|
+
|
|
62
|
+
public_dir = tmp_path / "public"
|
|
63
|
+
monkeypatch.setenv("PUBLIC_DIR", str(public_dir))
|
|
64
|
+
monkeypatch.setenv("CIKIT_DATA_DIR", str(public_dir / "cikit_data"))
|
|
65
|
+
monkeypatch.setenv("CIKIT_DATA_ADDRESSING", "provider")
|
|
66
|
+
|
|
67
|
+
for key, value in provider_env.items():
|
|
68
|
+
monkeypatch.setenv(key, value)
|
|
69
|
+
|
|
70
|
+
result = _run_ci(env, ["init"])
|
|
71
|
+
|
|
72
|
+
output = f"{result.stdout}\n{result.stderr}"
|
|
73
|
+
|
|
74
|
+
assert result.returncode == 0
|
|
75
|
+
assert f"Provider: {provider_name}" in output
|
|
76
|
+
|
|
77
|
+
|
|
36
78
|
def test_help_displays_usage(env):
|
|
37
79
|
"""Verify that the CI CLI help can be displayed.
|
|
38
80
|
|
|
@@ -37,10 +37,15 @@ def test_cmake_native_build(run_env):
|
|
|
37
37
|
build_dir = cmake.get_build_dir(run_env, "cmake-systemtest")
|
|
38
38
|
|
|
39
39
|
cmake.cmake_configure(run_env, NATIVE_PROJECT_DIR, build_dir, clean=True, compile_commands=True)
|
|
40
|
+
cmake.gather_compiler_meta(run_env, build_dir, "C")
|
|
40
41
|
cmake.cmake_build(run_env, build_dir)
|
|
41
42
|
|
|
42
43
|
data = run_env.data
|
|
43
44
|
|
|
45
|
+
assert data["compiler"]
|
|
46
|
+
assert data["compiler_version"]
|
|
47
|
+
assert data["compiler_type"]
|
|
48
|
+
|
|
44
49
|
assert data["build_files"] > 0
|
|
45
50
|
assert data["configure_time"] >= 0.0
|
|
46
51
|
assert data["build_time"] >= 0.0
|