Commit Graph

56 Commits

Author SHA1 Message Date
Kumar Gala f80f31eb0d ci: github: reduce when we do doc builds
Rather than doing a doc build on every PR, limit it to PRs that either
touch a file in doc/, *.rst and what's listed as DOXY_SOURCES in
doc/CMakeLists.txt.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-10-21 17:40:52 +02:00
Carlo Caione d16eb84dbe github: labeler: Add 'area: ARM_64' label
As answered in [0] add a new label for the ARM64 code.

[0] https://github.com/zephyrproject-rtos/zephyr/discussions/28353

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-10-06 09:50:12 -05:00
Anas Nashif dac6937cda actions: install needed modules for docs
add scripts/requirements-base.txt to install needed modules for docs to
build.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-10-05 13:04:22 -04:00
Martí Bolívar a6856811a3 scripts: dts: pass tests on windows
Doing this just requires a bit of os.fspath()-ery.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-10-02 11:51:15 +02:00
Martí Bolívar a8612f75c5 scripts: dts: convert test suites to pytest
Use the pytest test framework in the dtlib.py and edtlib.py test
suites (testdtlib.py and testedtlib.py respectively).

The goal here is not to change what is being tested. The existing test
suite is excellent and very thorough.

However, it is made up of executable scripts where all of the tests
are run using a hand-rolled framework in a single function per file.
This is a bit all-or-nothing and prevents various nice features
available in the de-facto standard pytest test framework from being
used.

In particular, pytest can:

- drop into a debugger (pdb) when there is a problem
- accept a pattern which specifies a subset of tests to run
- print very detailed error messages about the actual and expected
  results in various traceback formats from brief to very verbose
- gather coverage data for the python scripts being tested (via plugin)
- run tests in parallel (via plugin)
- It's easy in pytest to run tests with temporary directories
  using the tmp_path and other fixtures. This us avoid
  temporarily dirtying the working tree as is done now.

Moving to pytest lets us leverage all of these things without any loss
in ease of use (in fact, some things are nicer in pytest):

- Any function that starts with "test_" is automatically picked up and
  run. No need for rolling up lists of functions into a test suite.
- Tests are written using ordinary Python 'assert'
  statements.
- Pytest magic unpacks the AST of failed asserts to print details on
  what went wrong in really nice ways. For example, it will show you
  exactly what parts of two strings that are expected to be equal
  differ.

For the most part, this is a pretty mechanical conversion:

- extract helpers and test cases into separate functions
- insert temporary paths and adjust tests accordingly to not match
  file names exactly
- use 'assert CONDITION' instead of 'if not CONDITION: fail()'

There are a few cases where making this happen required slightly
larger changes than that, but they are limited.

Move the checks from check_compliance.py to a new GitHub workflow,
removing hacks that are no longer needed.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-10-02 11:51:15 +02:00
Øyvind Rønningstad d6c30eead0 nrfjprog.py: Fail if hex file has UICR data and no --erase
Inspect the hex file with intelhex, and fail if the hex file has any
contents in the UICR area(s).
family == 'NRF52' still always does --sectoranduicrerase, but this
option is not available on other families.
Add --force command line option to proceed with flashing instead of
failing.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-09-28 14:09:14 -05:00
Anas Nashif c25f486322 actions: increase stale operations
Increase to 400 to have it complete the job in one run.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-21 16:05:15 -04:00
Anas Nashif a06884a4e6 actions: stale: increase operations per run
The action is currently being aborted due to a very low value. Trying
something larger to get more operation done per day.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-18 19:05:29 -04:00
Carles Cufi c573bef48f github: labeler: Remove line using negation (!)
The current version of the labeler action doesn't support yet negations.
This is supported in master but we probably want to wait until a release
to update. In the meantime remove the rule that uses negations.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-14 18:19:39 +02:00
Carles Cufi 1019fb3fc6 Revert "github: labeler: Fix dts/ folder matching"
This reverts commit d20b6f90ea.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-14 18:19:39 +02:00
Carles Cufi d20b6f90ea github: labeler: Fix dts/ folder matching
Use the syntax described in:
https://github.com/actions/labeler#common-examples

in order to rewrite the matching expression for the dts/ folder.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-14 09:33:06 -04:00
Anas Nashif bc8832f6c8 actions: add backporting bot
With new event 'pull_request_target' it is now possible to run the
backporting action that we used to have in the past as a Github app.

Use labels for backporting as before.

See https://github.com/tibdex/backport for more details.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-12 07:28:16 -04:00
Carles Cufi bbcda199bf github: actions: Use on-PR labeler
Now that the standard GitHub action supports forks, switch to the on-PR
action instead of running a cronjob.

Reference:

https://github.com/actions/labeler/issues/12#issuecomment-670967607

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-12 07:27:41 -04:00
Martí Bolívar bd827056f6 scripts: runners: add type checking for west_commands
Use mypy to type check the runners package.

The test procedure is now annoying enough to replicate locally that
I'm going to wrap it in a script. Do this for both UNIX and Windows
environments by writing that script in Python.

Keep the GitHub workflow up to date so we now get mypy results in CI.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Fabio Utzig 551f1789a5 doc: update versions of build tools
Update documentation build tooling:

- Sphinx>=3.2.0
- Breathe>=4.20.0
- docutil>=0.16.0

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Anas Nashif 1787663b15 actions: daily_tests: fetch all tags
Fetch all tags or otherwise we will not be able to run 'git describe'
and post a new version.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-20 08:57:44 -04:00
Anas Nashif b8c7de6d9a actions: update daily version for testing
Update versions.json with the daily commit that device testing will be
performed on.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-09 11:29:56 +02:00
Aastha Grover 177f2dac8b github workflow : Add github worklow for Sanitycheck testsuite
Add github worklow for sanitycheck tests to run sanitycheck
testsuite on any changes in sanitycheck, sanitylib or
scripts/tests/sanitycheck directory.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2020-07-08 20:27:03 -04:00
Anas Nashif c53581dc1a templates: add template for hardware support
Add template for hardware support to properly label those requests and
distinguish them from other feature requests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-08 15:08:26 -04:00
Anas Nashif 7eeb572e8c templates: rename rfc template file
Remove the too many hyphens.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-08 15:08:26 -04:00
Christian Taedcke 668e359d85 actions: add labeler rule for "platform: SiLabs"
Update labeler action script to apply label for efm32/efr32 mcus.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-07-08 10:48:28 -05:00
Maureen Helm 4e39938942 actions: Add label for nxp boards, drivers, socs
Extends the github labeling action to automatically add the nxp label to
nxp-related boards, drivers, and socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-07 13:01:37 -04:00
Erwan Gouriou 41279af8a4 actions: get labeler adding "area: Shields" labels
Update labeler action script to treat Shields label.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-07-07 07:53:35 -04:00
Erwan Gouriou dce698c496 actions: get labeler adding "platform: STM32" labels
Update labeler action script to treat stm32 label.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-07-07 07:53:35 -04:00
Anas Nashif 743d2c4d3e actions: disable conflict action for now
Too much traffic is causing this workflow to generate noise and
conflicting labeling. Disabling for now while we investigate.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-02 10:59:34 -04:00
Anas Nashif 8516d19ffd actions: use one label for stale PRs and issues
Lets just use one single label for stale items.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-02 10:59:34 -04:00
Henrik Brix Andersen 2bd451e9eb actions: add labels for CAN and EEPROM driver areas
Add automatic labeling of the CAN and EEPROM driver areas.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-07-02 07:56:11 -04:00
Kumar Gala afda728f08 actions: Add some additional labels for devicetree
- Handle name change of labels from 'Device Tree' to Devicetree
- Split out things between "Devicetree" (as a catchall),
  "Devicetree Tooling" (for the scripts) and
  "Devicetree Binding" (for bindings)

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-30 18:14:52 -05:00
Anas Nashif 9c65a17743 actions: mark pull requests with conflicts
This action will go over pull requests after something was pushed to the
tree and marks pull requests with conflicts.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-29 17:51:56 -04:00
Anas Nashif a6e7d95a26 actions: only mark bugs as stale
Bugs are being looked at on a weekly basis, we still did not go through
many of the enhancements and long term feature issues, so do not mark
those as stale yet, this will otherwise mark more than 50% of open GH
issues as stale...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-29 12:10:38 -04:00
Anas Nashif 183585c810 actions: action for processing stale PRs/Issues
Mark stale PRs/Issues and close them after a period of inactivity.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-29 10:59:18 -04:00
Anas Nashif 2f350dfe43 actions: add automatic labeler action
Add action to labler pull requests on a regular basis. This will replace
the current labler implemented in ci-tools and will operate on a
schedule rather than on pull request trigger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-29 10:27:57 -04:00
Joakim Andersson f7f164468b templates: Encourage attaching log files over screenshots
Rewrite console log section to encourage bug-reporters to obtain the
console output in text-format over screenshots, as well as hinting
about other debug information that can be attached.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-06-25 08:53:42 -04:00
Anas Nashif 288ae28c13 ci: add compliance checking via GH actions
Move check_compliance script to main tree and adapt/use with GH actions.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-12 07:53:09 -04:00
Anas Nashif 2c8cb643bb templates: use correct label for Enhancement
enhancement -> Enhancement

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-21 13:21:09 -04:00
Henrik Brix Andersen 3c2984d4a9 scripts: west: add CANopen flash runner
Add west flash runner for program download via CANopen.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-05-08 10:53:42 +02:00
Anas Nashif 295572a5b1 ci: do not use latest breathe release for docs
breathe v4.15.0 was just released and fixes some compatibility issues
with latest sphinx, the combo works, however with many warnings that we
still need to either fix or whitelist. This is temporary until we are
able to use those new versions.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-07 18:51:13 -04:00
Anas Nashif 6cfa11c013 doc: lock sphinx version to a compatible one
Version 3.0.0 release recently break doc build, lock version of sphinx
to something compatible while we upgrade dependencies...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-05 19:10:43 -04:00
Anas Nashif 82e0066601 ci: support license check with topic branch with v3
When determining added files, support branches other than master.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-02-20 18:22:58 -06:00
Kumar Gala 8469ae6c87 github: doc-publish: remove debug flag
Now that we found the permission issue that was causing the aws s3 sync
to fail we can remove the debug flag.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-16 12:08:48 -06:00
Kumar Gala c6fc36f7cc Revert "github: For now limit doc publish to master"
This branch filter doesn't work as expected with tag.  Need to test this
more on testing tree to find a combo or solution that works properly.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-15 17:35:58 -06:00
Kumar Gala ac484f2f39 github: add more debug to see why aws sync is failing
For some reason the aws s3 sync fails, but not sure exactly why.  Adding
more debug to see if we can understand what's going on.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-15 16:43:18 -06:00
Kumar Gala 9e075e5e8c github: For now limit doc publish to master
Limit doc publish workflow to master branch.  Need to see if we can
seperate out 'latest' to be on master only and release branches to
publish to the proper location.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-15 16:43:18 -06:00
Kumar Gala bf3850c270 github: Add debug to try diagnose workflow failure
The doc publish workflow is failing in the AWS S3 push.  Add more
debug output in that section to see what's going on.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-14 22:32:48 +02:00
Kumar Gala 49bf8b1d54 github: Fix daily/release doc publish workflow
We now need pyelftools to build the docs.  See the following commit:

commit 83b346edef
Author: Alexey Brodkin <abrodkin@synopsys.com>
Date:   Fri Feb 7 11:37:25 2020 +0300

    runners: opeocd: Allow loading Elf-files

Match the update to doc-build.yml to `pip3 install pyelftools`.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-13 20:23:55 -06:00
Alexey Brodkin 83b346edef runners: opeocd: Allow loading Elf-files
In some cases especially for on-going development & debugging of real
application it might be useful to load and run not from flash but
from RAM in that case there's one catch: we cannot reset the board
after loading memory with our app.

That's because:
 a) RAM we use might be either cleared on reset or might enter
    unpredictable state with portion of previously loaded data
    being corrupted.
 b) Reset vector most probably still point to ROM/flash and so
    our current application won't be executed on reset.

So instead of "run reset" command of OpenOCD we'll use
"resume 0x12345678". Where 0x12345678 is our application's
entry-point (which BTW may very well not match beginning of
the .text section or link base).

Now to extract the entry-point we need our application's zephyr.elf
and since we already have a requirement for Elf we may use it for
loading because OpenOCD does it perfectly fine moreover automatically
detecting loaded image type (binary, hex, Elf etc).

And to use that nice feature just add "--use-elf" to west's
command-line for boards that use "openocd" runner. Like that:
----------->8--------------
west flash --use-elf
----------->8--------------

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2020-02-13 10:45:44 +02:00
Kumar Gala 3b60f09583 github: Add GH workflow to build daily docs and docs on release
Add a workflow that will build the docs daily or on release and
publish them to AWS S3.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-13 02:15:35 -06:00
Kumar Gala ae380c55c8 github: Update doc build action
Make a few cleanups to the doc build action:

1. Only do action for pull requests - action is meant to test PRs
2. Remove west update / cache of modules as we dont need them for docs

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-13 02:15:35 -06:00
Anas Nashif 3b625aaaa9 ci: add license check using github actions
Use Github for license checks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-02-09 11:55:56 -05:00
Kumar Gala b1de748948 github: Rename GitHub workflow action
GitHub checks need to be uniquely named, and 'Documentation' conflicts
with the ci-tool name.  Rename this while we are running both so the
names don't conflict.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-08 09:05:50 -06:00