Commit Graph

184 Commits

Author SHA1 Message Date
Gerard Marull-Paretas d89dc22665 uncrustify: remove configuration file
Remove uncrustify configuration file in favor of using clang-format, a
tool that is nowadays more popular/powerful for code formatting.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-15 09:37:30 -04:00
Stephanos Ioannidis f2b0991147 scripts: check_compliance: Fix broken links to Contribution Guidelines
This commit fixes the broken links to the Contribution Guidelines in
the Compliance Check script.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-17 13:40:27 -04:00
Anas Nashif f089f964fd twister: update ci options for twister
Now that we have partially oerhauled twister in the tree, modify actions
with new options:
- not reporting filtered tests is now default
- output is json, not csv

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:57:37 -04:00
Anas Nashif 7f3a62f2ce ci: keep old name of testplan file for now
Until we are ready to change workflow file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 41cb42d4db ci: testplan converted to use json
twister now exports json instead of csv, so we make the testplan read
the json data and generate the consolidated plan for the workflow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Aastha Grover eee56d8840 scripts/check_complaince: Add configs to UNDEF_KCONFIG_WHITELIST
Adding LOG_BACKEND_MOCK_OUTPUT_DEFAULT &
LOG_BACKEND_MOCK_OUTPUT_SYST to UNDEF_KCONFIG_WHITELIST as Kconfig
options generated by a template under testcases are not
identified by Compliance check by default.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-05-12 07:39:06 -04:00
Anas Nashif 94b316eacf ci: testplan: limit test scope on global changes
When doing global changes, like typo fixes or header changes, keep
default scope and do not build each test for each platform.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-06 08:19:49 -04:00
Stephanos Ioannidis 5a93798b22 Revert "scripts: check_compliance: check for commit message errors"
This reverts commit e61c534e52, which
enabled commit message checking via the checkpatch script.

The checkpatch commit message checking is currently causing more
problems that it fixes, for example:

1. the rules that are supposed to be specific to the "header" (commit
   message) are being applied to the diffs.

2. there are some rules that do not fully make sense for the Zephyr
   and the way we have been doing things.

Note that we currently have the 'gitlint' checking the commit messages,
so reverting this feature does not completely take away the commit
message checking in the CI.

If we are to ever re-introduce this feature, all of the aforementioned
issues need to be addressed, and the effects and ramifications of
enabling this feature must be thoroughly analysed.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-04-20 22:31:57 +09:00
Fabio Baltieri e61c534e52 scripts: check_compliance: check for commit message errors
Change CheckPatch() compliance test to call checkpatch.pl directly
rather than through git diff. This has the advantage of including the
commit message in what is being checked, which is useful to catch stuff
like spurious Gerrit commit ids.

The --mailback does not seem to work correctly in this mode, but since
the output is filtered by checking the command exit code anyway, that
option is redundant, so drop that as well.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-04-15 10:35:09 -07:00
Anas Nashif 8c0b82d0b8 ci: remove buildkite/daily.yml from ignore list
This file does not exist anymore

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-03-24 09:44:11 -05:00
Nazar Kazakov f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Gerard Marull-Paretas 6b2391d000 scripts: ci: check_compliance: add check for boolean prompt text
Add a new check that enforces boolean's prompt to not start with
"Enable...".

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-09 15:35:54 +01:00
Henrik Brix Andersen 57a9f0431b scripts: ci: test_plan: use common code for finding matching boards
Use the common code in scripts/list_boards.py for finding matching
boards in scripts/ci/test_plan.py. This has the benefit of not trying to
use board revisions files as board names.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-02-28 07:31:19 -08:00
Gerard Marull-Paretas 724b042108 scripts: ci: check_compliance: check for (re)defined Kconfig symbols
Kconfig symbols must not be defined in Kconfig.defconfig.* files. Such
files are meant to change the default value of certain options.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-21 19:35:21 -05:00
Anas Nashif 8e70d04193 actions: twister: build/run module tests and samples
This step was dropped when we moved to to GH actions, add it back.

Fixes #41305

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-02-09 19:47:36 -05:00
Anas Nashif f7cdea8510 ci: disable cbprintf tag filtering
Need a better way or tagging for this area, we have been introducing
regressions that were undetected due to those filters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-01-27 10:32:02 -05:00
Anas Nashif ce60a91fb0 actions: twister: scale nodes up for large test coverage
If we determine we need more nodes than the default, do not override the
calculated number.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-01-06 07:32:20 -05:00
Anas Nashif 9cb2bc2c01 actions: clang: do not test all boards when --platform is given
If we are invoking testplan for only one board, do not bother with other
board related changes, just generate plan for the specified platform.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-12-09 16:23:22 +01:00
Anas Nashif 77a7df31e5 ci: fix test plan for smaller sets
We were missing smaller sets and skipping tests when the set is smaller
than the allowed number of tests per node.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-12-05 10:53:50 -05:00
Anas Nashif 8d40928b2a actions: twister: determine nodes in python script
Improve calculation of matrix and move calculations from workflow to the
testplan script. We now generate a file that can be parsed by the action
with the data needed to start twister with the right number of nodes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-29 20:06:24 -05:00
Anas Nashif d52212b09a actions: fix filtering for clang action
Do not invoke --integration when dealing with one platform only and
generate testplan only for the needed platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-29 20:06:24 -05:00
Anas Nashif 8b55275d48 ci: test_plan: fix pylint warnings
Fix some of the warnings reported by pylint.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-28 20:35:40 -05:00
Anas Nashif 053cc9fe62 actions: twister: run tests on all platforms when changed
When tests are changes, run them on all supported platformed, not only
integration platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-28 20:35:40 -05:00
Anas Nashif 0b2df8f41c actions: twister/clang: cleanup test plan generation
Merged 3 files used to generate the test plan per PR based on the
changes. 2 python scripts and a shell script are now all merged into 1
python script that generates the input file for twister based on a list
of changed files by the PR.

This remove lots of old and obsolete code and simplifies things a bit,
no need anymore for an intermediate script to call twister, we call it
directly in the workflow and use the new test_plan script to generate
the test plan.

This also reenables the recently disabled tag based filtering which had
a bug, bug is resolved in this new implementation.

On push events, we now run twister without the --integration option to
catch any issues in the main branch that were not caught in PRs. PRs
continue to run with --integration enabled. This event (push) is now run
on 15 builders due to the increased size.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-24 22:54:25 -05:00
Anas Nashif 5c24fcb4ae actions: run twister using github action
This action replaces current buildkite workflow and uses github actions
to build and run tests in the zephyr tree using twister. The main
differences to current builtkite workflow:

- the action handles all 3 events: pull requests, push and schedule

- the action determines size of matrix (number of build hosts) based on
  the change with a minimum of 1 builder. If more tests are built/run
  due to changes to boards or tests/samples, the matrix size is
  increased. This will avoid timeouts when running over capacity due to
  board/test changes.

- We use ccache and store cache files on amazon S3 for more flexibility

- Results are collected per build host and merged in the final step and
  failures are posted into github action check runs.

- It runs on more powerful instances that can handle more load.
  Currently we have 10 build hosts per run (that can increase depending
  on number of tests run) and can deliver results within 1 hour.

- the action can deal with non code changes and will not allocate more
  than required to deal with changes to documentation and other files
  that do not require running twister

The goal long-term is better integrate this workflow with other actions
and not run unncessarily if other workflows have failed, for example, if
commit message is bogus, we should stop at that check, to avoid wasting
resources given that the commit message will have to be fixed anyways
which would later trigger another run on the same code.

Currently there is 1 open issue with this action related to a github
workflow bug where the final results are not posted to the same workflow
and might appear under other workflows. Github is working on this bug.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-23 06:42:23 -05:00
Anas Nashif 46e3318dbd ci: hotfix: disable test exclusion by tags
Many tests and CI activties are being missed by excluding tests
mistakingly when running twister.
This is visibile when you change one or more tests in kernel/ for
example, twister does not run those tests that have changed at all and
marking the PR as tested and ready to be merged.

Temporary fix for #40235.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-10 22:37:21 -05:00
Anas Nashif 23ab949975 ci: inclusive language, use nodes instead of slaves
Fix the usage of the word slaves and replace with nodes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-10 08:04:26 -06:00
Anas Nashif 910e86af68 ci: do not run twister on footprint script changes
No need to run twister on changes to changes to scripts/footprint/*

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-10-29 12:26:36 -04:00
Torsten Rasmussen e2427ff671 scripts: check_compliance should not generate soc/shield Kconfig files
Fixes: #38463

With 6be1b2af9b then Zephyr shields and
soc Kconfig are always sourced from Kconfig directly.

However, check_compliance.py generates Kconfig files for sourcing the
same files thus sourcing the same files twice.
The end result is a lot of Kconfig warnings as described in #38463.

Removing the generated Kconfig files as this is no longer needed after
6be1b2af9b has been introduced.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-09-23 11:27:41 -04:00
Andy Ross 507e1154e3 scripts/check_compliance.py: Add kconfig false positives
New docs for cavs_v25 describe building a Linux kernel for a
Chromebook and need to talk about these kconfigs.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-09-03 07:19:34 -04:00
Torsten Rasmussen 36bb00d1f5 armclang: ARM Compiler C library support
Support for ARM Compiler C library.

This commit add support for the ARM Compiler C libary in:
- Kconfig
- libc/armstdc

A new Kconfig symbol is added to allow a toolchain to specify if they
support linking with the minimal C library.
Also the CMake variable `TOOLCHAIN_HAS_NEWLIB` is exported to Kconfig
so that CONFIG_NEWLIB_LIBS can only be enabled if the toolchain has
newlib.

The armclang toolchain selects the CMake scatter file generator and
disables support for the LD linker template which is not supported by
armlink.

For the ARM Compiler C library, a corresponding lib/libc/armstc/ folder
with a minimal implementation to work with the ARM Compiler C library
is added.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-30 08:54:23 -04:00
Martí Bolívar 6fe3c30af7 scripts: check_compliance: fix filter_py edge case
The filter_py() function is handed a bunch of file names and is
expected to give back just the python files.

Its input is the output from a 'git diff' command which normally when
used in the vanilla zephyr repository just prints regular files.

In situations where we're checking compliance on a repository with
submodules, however, filter_py() can be given directories in the
'fnames' list from the git output.

In the interests of being defensive and sharing infrastructure, just
handle this case in filter_py().

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-05 16:14:12 +02:00
Armando Visconti 351b28e122 drivers/sensor: lis2dw12: move int-pin in DTS binding
Take the int-pin information (i.e. what pin between INT1
and INT2 the drdy is attached to) directly from DT.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-06-29 11:31:06 -04:00
Kumar Gala 3641de91e0 ci/tags.yaml: Add entries for a few different tags
Add entries for bluetooth, cmsis_dsp, posix, and cbprintf.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-24 12:38:57 -05:00
Kumar Gala 0f7dde8ec1 ci/tags.yaml: Remove includes
Remove includes from the tag file.  If we have a change to an include
that implies some API change which may show up somewhere else so we
want to build as many tests/samples as possible in that case.

Also added a comment about keeing entries sorted alphabetically.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-24 12:38:57 -05:00
Kumar Gala 1bf5b70771 run_ci.sh: Fix setting of twister_exclude_tag_opt
We were testing modified_tags.args before we called get_twister_opt.py
so it would never have been created and thus twister_exclude_tag_opt
would never get set correctly.  Move the check to after we call
get_twister_opt.py

Also we need to remove modified_tags.args once we are done with it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-16 16:00:06 -05:00
Kumar Gala d736899504 run_ci.sh: add support for tag exclusion
Plumb modified_tags.args into run_ci.sh

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-15 11:39:23 -04:00
Kumar Gala d7773fba06 ci: Add twister tag support to get_twister_opt
Add the ability to map file/dir paths of a PR to twister TAG.  We
introduce scripts/ci/tags.yaml to conveys which files are associated
with which tag.

Since not all file/tags will be specified in tags.yaml we use the
combination of the files modified list and the tags.yaml information to
determine which tags can be excluded (ie if the file list doesn't match
any file in tags.yaml for a given tag listed there, we can that exclude
it).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-15 11:39:23 -04:00
Kumar Gala 168bdaadc5 run_ci.sh: Move creation of test_file.txt into a function
Make a single function that handles creation of test_file.txt and fold
get_tests_to_run into it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-10 07:53:58 -05:00
Kumar Gala 5e46a6453c run_ci.sh: Rename test_file_main to test_file_full
Rename test_file_main to test_file_full to be more consistent with the
usage of "full" elsewhere.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-10 07:53:58 -05:00
Kumar Gala 4e7a444131 run_ci.sh: rework logic to be a bit more consistent
Treat all test_file_* files the same and just explicitly set the header
in the final test_file.txt.  This makes the logic the same regardless of
what paths tests are coming from.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-10 07:53:58 -05:00
Kumar Gala fd8dabcb95 run_ci.sh: Fix what tests run with -l
If the local option (-l) was specified we were ignoring the results
of what_changed.py and always setting a "FULL" build.  Only explicitly
set a FULL run if we are building for a commit to the tree (local and
PR builds should respect the output of what_changed.py).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-10 07:53:58 -05:00
Kumar Gala 88cf35cb24 run_ci.sh: Rename master to main branch in example comment
Since we use 'main' now, rename the example comment usage to use
that branch name instead of 'master'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-10 07:53:58 -05:00
Carles Cufi 2189c08e4e ci: Add an errno.h check to CI
Add a very simple check that verifies that new error numbers are added
according to the errno.h file in newlib, in order to maintain
compatibility with it.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-05-17 09:11:15 -04:00
Anas Nashif 01c1bcf724 ci: disable identifier_length scripts for now
This rules is not working as expected, so remove it for now.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-06 14:45:03 -04:00
Krzysztof Chruscinski d3b246464c scripts: ci: check_compliance: Extend UNDEF_KCONFIG_WHITELIST
Added SAMPLE_MODULE_LOG_LEVEL_DBG as an exception. Define is used
in the log_api test suite.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-06 15:40:05 +02:00
Anas Nashif d4e03991a0 ci: have twister cleanup artifacts as it goes
Avoid running out of space by cleaning up passing tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-05 18:48:45 -05:00
Anas Nashif bc4b4c5988 actions: cocci: remove boolean.cocci as it take too long
This script is taking too long on large files and is delaying the
action. Remove it for now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-03 17:11:12 -04:00
Anas Nashif 8ebc67ee0d action: timeout on scripts taking too long
Some scripts might take very long to execute, kill those after 10s and
let the action continue.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-03 17:11:12 -04:00
Anas Nashif b669f0c017 ci: fix regex in guideline_check.py
Also match _ in file names.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-03 08:08:25 -05:00