Commit Graph

460 Commits

Author SHA1 Message Date
Jamie McCrae
6751c85c63 scripts: ci: check_compliance: Add check for zephyr module file
Adds a check which fails CI if a zephyr module file is added to the
zephyr repository itself

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-07-25 08:13:56 -04:00
Arkadiusz Cholewinski
d021851182 CI: Coverage: Fix: Get component name from testsuite name.
Get component name from testsuite name instead of
testcase identifier.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2025-07-24 17:00:48 +01:00
Pieter De Gendt
b1f398d176 scripts: ci: check_compliance: KeepSorted allow combining strip and re
No reason we couldn't strip a line we want to match to a regex.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-07-24 06:08:10 -04:00
Chaitanya Tata
ef8bbab600 ci: Add missing nrf_wifi directory
This directory is part of the nRF Wi-Fi driver and should trigger tests.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-07-24 06:04:00 -04:00
Jamie McCrae
744a5635f9 scripts: ci: check_compliance: Add support for module Kconfigs
Adds support for checking module samples and tests for additional
Kconfigs, as well as logging Kconfigs, so that this check can be
reused more easily with out of tree manifest repos

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-07-23 17:29:07 +01:00
Benjamin Cabé
db47c899e3 scripts: ci: check_compliance: no need for lxml anymore
Remove an old workaround requiring lxml to be present as junitparser was
not working with xml.etree.ElementTree until version 3.0.0.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-23 09:31:28 +02:00
Pieter De Gendt
373c0724c9 scripts: ci: check_compliance: Capture failing tests
If a compliance test itself throws an exception, the entire script is
aborted.
Update this by capturing the exception and failing only the test itself.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-07-21 07:22:26 -04:00
Anas Nashif
2f35e68dd8 Revert "scripts: ci: check_compliance: Add support for module Kconfigs"
This reverts commit 6013fc7201.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-19 20:58:31 -04:00
Anas Nashif
9219c81b66 twister: make no-detailed-test-id default
Make this option default and reduce amount of details displayed by
twister.
This options has been enabled in CI for a while now with the intention
of making it default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-19 15:50:47 -04:00
Jamie McCrae
6013fc7201 scripts: ci: check_compliance: Add support for module Kconfigs
Adds support for checking module samples and tests for additional
Kconfigs, as well as logging Kconfigs, so that this check can be
reused more easily with out of tree manifest repos

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-07-19 15:48:24 -04:00
Declan Snyder
3b5bfd9f4a scripts: check_compliance: Fix resource leak
The git diff subprocess was leaking, ie.,
it was still running with it's file streams open,
and python was printing warnings about this. Fix by calling
communicate() on the object which will do the cleanup.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-07-19 15:34:47 -04:00
Pieter De Gendt
15fbf214b5 scripts: ci: check_compliance: Keepsorted optional folding
Introduce a marker for zephyr-keep-sorted to not fold continued indented
lines.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-07-19 13:23:41 -04:00
Pieter De Gendt
27e36c31b4 scripts: ci: check_compliance: Keepsorted optional stripped characters
Allow passing characters to strip for zephyr-keep-sorted. This can be
useful for optional double quotes in yaml maps.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-07-19 13:23:41 -04:00
Benjamin Cabé
f672cb72d4 Revert "doc: ci: Zephyr now requires Python 3.12 or higher"
This reverts commit 043bb58488.

Note that  scripts/requirements-actions.txt might not be 100% the same
as what was pinned prior to the revert due to it being difficult to
restore previous versions while also accounting for the new dependencies
that were added in the meantime.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-04 15:50:06 -05:00
Fabio Baltieri
42e8837085 scripts: do_not_merge: wait for manifest before checking
Seems like github relabel rerun is susceptible to race conditions and
may not rerun the label check script if the manifest workflow runs at
the same time.

Delay the check to explicitly wait until the currently checked sha had a
successful manifest run.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-07-03 11:59:56 -05:00
Fabio Baltieri
db18e4c507 scripts: do_not_merge: integrate the empty body check in the python file
No point spreading the logic around, the python file already has the
data, check it there.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-07-03 11:59:56 -05:00
Fabio Baltieri
5b743871b8 scripts: do_not_merge: add some debug prints
Log the PR link and labels, may come in handy for troubleshooting down
the road.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-07-03 11:59:56 -05:00
Chris Friedt
e363fdd16b scripts: ci: check_compliance: allow CONFIG_BOARD_UNIT_TESTING
Previously, code like the snippet below would not pass compliance checks.
With this change, we add `CONFIG_BOARD_UNIT_TESTING` to the Kconfig allow
list, so that code like the snippet below is not incorrectly reported as
a compliance failure.

```
if defined(CONFIG_BOARD_UNIT_TESTING)
/* unit-testing only */
endif
```

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-06-24 14:18:52 +02:00
Jamie McCrae
6d73a9c45a scripts: ci: check_compliance: Add support for modules for Kconfig
Adds support for checking modules for disallow Kconfig's in boards
and SoCs, which have been defined in a Zephyr module file

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-06-20 14:41:20 -05:00
Pieter De Gendt
e454aaa6b6 scripts: ci: check_compliance: Pass path representation to magic
On windows the Magic.from_file method fails to convert a PathLike to its
representation.
Pass using os.fspath.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-20 13:25:45 -04:00
Benjamin Cabé
ba56cd1020 scripts: ci: disable trailing-whitespace check in SphinxLint
SphinxLint doesn't need to report trailing whitespace errors as it's
already checked by checkpatch.pl.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-20 13:21:13 -04:00
Anas Nashif
c1229e308f ci: remove pylint checks covered by ruff
Few rules are duplicate and are reported multiple times, so disable
those from pylint and rely on ruff reporting them.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-06-20 08:52:22 +02:00
Benjamin Cabé
043bb58488 doc: ci: Zephyr now requires Python 3.12 or higher
Update getting started guide, release notes, CI actions and
Python version compliance check to use Python 3.12 as
minimum supported version.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-19 13:56:59 +02:00
Anas Nashif
43971ea0d5 ci: add member check
Verify that collaborators/maintainers added to the MAINTAINERS.yml file
actually have access to the project and are members.
Only those who already gained access following the process shall be
added to the file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-06-18 17:47:54 -04:00
Fabio Baltieri
a626d865c0 scripts: do_not_merge: print the API limit stats
This information is useful for troubleshooting and not available
anywhere else, does not quite belong to this script but this runs for
every PR so it's not a bad place to have it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-06-18 09:54:12 -04:00
James Roy
4240853a06 scripts: ci: Add CI bindings style checker
Implement a check in the CI pipeline to enforce
that property names in device tree bindings do
not contain underscores.

Signed-off-by: James Roy <rruuaanng@outlook.com>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2025-06-17 16:03:54 +02:00
Jason Yu
c387d9c73d modules: hal_nxp: mcux-sdk-ng: Fix LPC55S16 build error
Fix build error when CONFIG_MCUX_COMPONENT_driver.fro_calib is set.
Error message:

modules/hal/nxp/mcux/mcux-sdk-ng/cmake/extension/function.cmake:2084 (if)
  if given arguments:

    "IN_LIST" "NEED_WRAP_TOOLCHAINS"

The error is because, mcux sdk ng cmake functions `mcux_add_xxx` support
add content based on toolchains. CMake should set current toolchain in
CMake Variable `CONFIG_TOOLCHAIN` to use this feature.

Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
2025-06-16 14:15:12 -04:00
Maureen Helm
29ca4bdfd2 scripts: ci: check_compliance: Ignore additional mcuboot Kconfigs
Adds BOOT_IMAGE_EXECUTABLE_RAM_START and BOOT_IMAGE_EXECUTABLE_RAM_SIZE
to the list of mcuboot symbols ignored by the compliance checking
script.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2025-06-13 10:29:20 -04:00
Jacob Wienecke
0c7fbd164e scripts: ci: check_compliance.py: Fix check_disallowed_defconfigs: Windows
#78615 Added a check for disallowed Kconfigs which does not work
on Windows machines. Windows machines seem to behave differently when
faced with the \b word boundary marker. I have removed the \b word
boundary marker from the grep commands when os.name=='nt'.
The script performs the same as before for any other os.

Signed-off-by: Jacob Wienecke <jacob.wienecke@nxp.com>
2025-06-12 11:35:07 +02:00
Benjamin Cabé
17ab862169 scripts: ci: add vermin (min python version check)
Add a compliance check that allows to flag when a given file requires a
Python version higher than 3.10 (minimum supported version in Zephyr at
the time of writing) since not all Python scripts are tested against
3.10 in CI and we want to avoid introducing changes that could break
users.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-06 08:45:13 +02:00
Fabio Baltieri
649eb6280d ci: pr_metadata_check: convert DNM logic to python
GitHub seems to have issue with workflow state caching that causes the
DNM step to not work properly in few cases and not detecting changes in
the DNM tag, forcing people to mess with tags or close/opening PRs,
which in turns restarts all workflows.

Convert the script to Python so that the tag data is guaranteed to be
fresh.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-05-20 10:17:19 +02:00
Chris Friedt
c32488f97b cmake: kconfig: auto-generate boolean board revision option
Automatically generate a boolean CONFIG_BOARD_REVISION_FOO=y Kconfig
option based on e.g. CONFIG_BOARD_REVISION="foo".

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-05-16 16:11:48 +02:00
Jason Yu
c488c652cd modules: hal_nxp: Unified to use SDK NG driver
Some NXP boards are using legacy SDK driver, such as S32K, K64, MIMX8Q,
and so on. The legacy SDK driver will not be updated, migrate to use
SDK NG driver.

Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
2025-05-15 19:32:19 +02:00
Carles Cufi
9f7b786a35 scripts: compliance: Avoid exception when commit message body is empty
Avoid the following exception in the Identity test when the commit body
is empty:

Traceback (most recent call last):
  File "zephyr/scripts/ci/check_compliance.py", line 2053, in main
    n_fails = _main(args)
              ^^^^^^^^^^^
  File "zephyr/scripts/ci/check_compliance.py", line 1988, in _main
    test.run()
  File "zephyr/scripts/ci/check_compliance.py", line 1459, in run
    auth_name, auth_email, body = git(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 3, got 2)

This is triggered because ``%b`` represents the body of the commit
message, which can be empty if there's a single line in it, because the
first line is considered the title.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2025-05-15 19:31:47 +02:00
Mirai SHINJO
e4650bc349 scripts: ci: check_compliance: fix identity check for multiple DCOs
The current implementation of the identity check fails if multiple DCO
signoff lines are present and the first instance of the signoff line
does not belong to the author of the commit. This patch proposes a solution
that allows patches with multiple DCO signoff lines to pass the identity
check, regardless of the order of the signoff lines.

Signed-off-by: Mirai SHINJO <oss@mshinjo.com>
2025-05-13 17:46:01 +02:00
Robin Kastberg
5a92e46c92 iar: toolchain: Implement IAR static init routine
This will implement a way of doing static initialization
the "IAR" way. This is done by calling __iar_data_init3
which handles all static initialization that is mentioned
in the linker file "initialize by copy".

Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
2025-05-12 19:18:56 +02:00
Jamie McCrae
4876ff4b42 scripts: ci: check_compliance: Add Kconfig to allow list
Adds a Kconfig used in MCUboot to the allow list

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-04-25 14:03:34 +02:00
Chris Friedt
5fb47cd97f scripts: check_compliance: un-ignore diff and patch for CheckPatch
Un-ignore diff and patch files for CheckPatch.

This was originally added to avoid throwing false-positives when diff
and patch files were actually in the repo, since it would incorrectly
try to perform code-formatting checks on those files instead of on
the content of the commit.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-22 13:14:30 -04:00
Chris Friedt
b032304bbe scripts: ci: check_compliance: use git-top to check modules
BoardYml, DeviceTreeBindings, Kconfig, and KconfigBasic checks
can be run with a decentralized west manifest.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-11 06:32:31 +02:00
Chris Friedt
07a023d779 scripts: ci: check_compliance: GIT_TOP and ZEPHYR_BASE as paths
Use pathlib.Path objects for GIT_TOP and ZEPHYR_BASE instead of
strings.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-11 06:32:31 +02:00
Chris Friedt
af342e5205 scripts: ci: check_compliance: allow mcuboot log level dbg
Currently, only MCUBOOT_LOG_LEVEL_INF and MCUBOOT_LOG_LEVEL_WRN
are allowed in UNDEF_KCONFIG_ALLOWLIST. Let's allow
MCUBOOT_LOG_LEVEL_DBG as well, since some use cases may require
this level of scrutiny.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-11 06:32:31 +02:00
Chris Friedt
305e648d63 scripts: ci: check_compliance: ignore patch and diff files
Was getting several false positives about whitespace at line
endings with check_compliance.py because it was analyzing
.patch and .diff files as source.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-11 06:32:31 +02:00
Ederson de Souza
e420b21834 share/sysbuild: Support single app slot RAM load mode
Adds a new Kconfig to support MCUboot single application slot RAM load
mode.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-04-08 16:12:33 +02:00
Jamie McCrae
2f55dc8add scripts: ci: check_compliance: Disallow board hooks in defconfigs
Adds board hooks to the disallowed defconfig symbol list as
these should be selected, not put in a defconfig

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-04-04 12:06:38 +02:00
Pieter De Gendt
b2c37e00fc scripts: ci: compliance: Check .pyi files with ruff
Add pyi stub files to be checked by the ruff CI compliance rule.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-04-03 00:07:03 +02:00
Anas Nashif
56c5e93cb7 ci: add empty CODEOWNERS file
Add an empty codeowner file redirecting to MAINTAINERSS.yml file for
clarity and to make some tooling happy.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-27 09:50:45 +01:00
John Barbero Unenge
53c5aa3bb0 scripts: ci: check_compliance: Fix signoff check
Use the --format flag in git rather than parsing the output of
the git log. The inspiration for this change was that the previous
implementation breaks if there's a ~/.gitconfig that changes the
git log format.

Signed-off-by: John Barbero Unenge <git@lsrkttn.com>
2025-03-13 16:56:40 +00:00
Jamie McCrae
0035449137 scripts: ci: check_compliance: Add sysbuild Kconfig exclusions
Adds some Kconfigs to the allow list which are used for
demonstration purposes in sysbuild documentation

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-03-05 09:58:26 +00:00
Benjamin Cabé
f7c9200cc7 scripts: ci: check_compliance: inclusive language fix
use allowlist terminology

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-02-19 18:48:15 +01:00
Jamie McCrae
5e1aaa5395 scripts: ci: check_compliance: Fix paths for disallowed Kconfigs
Fixes using the wrong path for checking if disallowed Kconfigs
are present, to use the zephyr base instead of the git top level
folder which caused issues for downstream manifests

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-02-14 19:13:39 +00:00