Commit Graph

158 Commits

Author SHA1 Message Date
xuxin19 1bba720c2f build.yml:disable CMake Ninja for Msys2
CI in the msys2 environment, the CMake ninja generator
will have a problem with parameters being too long

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-12 22:02:52 +08:00
Marco Casaroli a2b129fb1d ci: use venv for check
To avoid the following CI error:

This environment is externally managed
--> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.12/README.venv for more information.
2024-10-12 20:46:47 +08:00
Tomasz 'CeDeROM' CEDRO 2c5091415e Contributing and PR template fix.
* Fix CONTRIBUTING.md github link reference.
* Full URL is provided to avoid relative/fork reference issues.
* Minor update on full contributing documentation.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2024-10-12 08:12:05 +08:00
Tomasz 'CeDeROM' CEDRO 140ce28616 Update github pull request template.
* Update CONTRIBUTING.md guide with hints and examples.
* Minor GitHub Pull Request Template update hinting expected information.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2024-10-11 15:45:36 +08:00
Lup Yuen Lee d637d5b66d CI: Skip the CI Builds that don't match the Board Label
This PR extends the CI Build Rules to eliminate more unnecessary builds. We use the Board Label for PRs:
- Previously: "Arch: arm" will build only `arm-01` to `arm-14`
- Now: "Board: arm" will also build `arm-01` to `arm-14`
- This applies only to Simple PRs: One Arch Label + One Board Label + One Size Label, like "Arch: arm, Board: arm, Size: L"
- If Arch Label and Board Label are both present: They must be the same. Otherwise All Targets shall be built.
- Works with Arm32, Arm64, RISC-V, Simulator, x86_64 and Xtensa

The updated code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-11 03:02:01 +08:00
Lup Yuen Lee 80d03cb296 CI: Split the RISC-V Build Jobs into smaller jobs
To speed up the CI Workflow, this PR splits the CI Build Jobs for RISC-V into smaller jobs. Each job will now complete within 1 hour.

Before the PR: There are 2 jobs for RISC-V, each requiring more than 1.5 hours
- `risc-v-01` (1 hour 42 mins): BL602, Ox64, ESP32-C3 / C6 / H2
- `risc-v-02` (1 hour 41 mins): K230, Icicle, QEMU, RV32M1-Vega

After the PR: The build is spread across 6 jobs for RISC-V, each job completes within 1 hour
- `risc-v-01` (19 mins): BL602, Ox64
- `risc-v-02` (44 mins): ESP32-C3
- `risc-v-03` (45 mins): ESP32-C6, ESP32-H2
- `risc-v-04` (31 mins): K230, Icicle
- `risc-v-05` (41 mins): QEMU CITest
- `risc-v-06` (38 mins): Rest of QEMU, RV32M1-Vega

Following the same convention as the Arm32 Build Jobs, the above jobs are sorted by Target Name. Performance of the RISC-V Build Jobs is discussed in https://github.com/apache/nuttx/issues/13775
2024-10-10 08:44:02 +08:00
Lup Yuen Lee a38e533bfa CI: Set PR Label to the Arch-Specific Board
This PR changes the Labeling of PRs so that the Architecture (arm, risc-v, xtensa, ...) is specified in the Board Label. Previously the CI Workflow would set Generic Board Labels like "Area: Board support". Now it will set the Arch-Specific Board Label like "Board: arm".

The Board Label will be used by the upcoming CI Build Rules to skip unnecessary builds. So "Board: arm" will enable only the builds for `arm-01` to `arm-14`. This is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-09 18:00:16 +08:00
Lup Yuen Lee c74206a982 CI: Split the Build Job arm-05 into multiple smaller jobs
CI Build Job `arm-05` (runtime 2 hours) has become the Performance Bottleneck for CI Workflow. That's because `arm-05` builds too many targets for nRF, RP2040, SAM 3, SAM A and SAM D. This PR splits `arm-05` into multiple smaller jobs, to reduce the CI Build Duration.

Before the PR: `arm-05` is overloaded, build requires 2 hours
- `arm-05` (2 hours): nRF, RP2040, SAM 3, SAM A, SAM D
- `arm-06` (56 mins): STM32 [a-m]*

After the PR: `arm-05` is offloaded (to `arm-06` and `arm-07`), completes within 1 hour
- `arm-05` (47 mins): nRF
- `arm-06` (1 hour): Reserve for RP2040 exclusively
- `arm-07` (1 hour 15 mins): SAM 3, SAM A, SAM D, STM32 [a-m]*

Build Jobs are sorted by Target Name. So we cascade the changes and rename the Build Jobs: `arm-07` becomes `arm-08`, `arm-08` becomes `arm-09` etc. Then `arm-13` becomes a new job `arm-14`. (Which we added to `build.yml`)

Performance of `arm-05` is discussed in https://github.com/apache/nuttx/issues/13775 and https://github.com/apache/nuttx/issues/12773
2024-10-09 13:45:26 +08:00
Lup Yuen Lee 69f58de304 CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).

The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built

This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets

The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 18:40:07 +08:00
Lup Yuen Lee 3173746e5d CI: Refactor the Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The changes in this PR will not take effect until the next PR, which will switch `build.yml` to use the rules in this PR.

In this PR, we refactor the CI Build Rules into a separate Reusable Workflow `arch.yml`. The original rules were migrated to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built

New and Updated Rules:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets

The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:04:28 +08:00
Lup Yuen Lee 089b5e07c7 build.yml: Check out the correct branch of nuttx-apps
When building a branch like `releases/12.7`, the CI Workflow incorrectly checks out the `master` branch of `nuttx-apps`, instead of `releases/12.7`. This PR fixes a typo in `apps_ref`, to check out the correct branch.
2024-10-03 14:29:12 +08:00
Lup Yuen Lee abe2f4baa2 build.yml: Skip the CI Builds that don't match the Arch Label
This PR proposes to enhance the CI Workflow, to skip the unnecessary NuttX Builds. Currently, NuttX Devs wait for the CI Builds to complete across All Architectures (Arm32, Arm64, RISC-V, Xtensa), even though they modified a Single Architecture. With this PR, the CI Workflow will build only the Modified Architecture.

The solution uses the Arch Labels for PRs. We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- If "Arch: arm / arm64" is the only non-size label, then we build `other`, `arm-01`, `arm-02`, ...
- If "Arch: risc-v" is the only non-size label, then build `risc-v-01`, `risc-v-02`
- If "Arch: xtensa" is the only non-size label, then build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built

The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-03 09:38:48 +08:00
Lup Yuen Lee 01bba4542a build.yml: Undo debug print
Undo the unintended changes for debug printing. I edited the wrong repo, I am deeply sorry about this.
2024-10-01 20:29:39 +08:00
Lup Yuen Lee 8fce648452
Update build.yml 2024-10-01 16:49:18 +08:00
Lup Yuen Lee 298392e283
Update build.yml 2024-10-01 16:48:48 +08:00
dependabot[bot] a116a6210e build(deps): bump codelytv/pr-size-labeler from 1.10.0 to 1.10.1
Bumps [codelytv/pr-size-labeler](https://github.com/codelytv/pr-size-labeler) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/codelytv/pr-size-labeler/releases)
- [Commits](https://github.com/codelytv/pr-size-labeler/compare/v1.10.0...v1.10.1)

---
updated-dependencies:
- dependency-name: codelytv/pr-size-labeler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 14:37:02 +08:00
raiden00pl ff24fc425e github: add specifier to issue github labels
This change adds a specifier to github lables created with "new issue":

- for labels related to architecture specifier is "Arch: xxx"
- for labels related to issue type specifier is "Type: xxx"
- for labels related to host OS type specifier is "OS: xxx"
- for labels related to issue area type specifier is "Area: xxx"
2024-09-20 22:02:44 +08:00
raiden00pl cafd563da1 github/workflows: add auto labeler for PR
this commit adds initial support for auto labeler for PR
based on https://github.com/actions/labeler
2024-09-20 10:02:18 -03:00
simbit18 6a0c0722e2 CI: Improvement to speed up compilation and reduce download errors.
The simple improvement is designed to speed up compilation and reduce download errors on github and local.

Added a folder nxtmpdir for storing third-party packages

nuttxworkspace
|
|- nuttx
|- apps
|- nxtmpdir

tools/Unix.mk:
added export NXTMPDIR := $(WSDIR)/nxtmpdir

tools/configure.sh:
added option -S creates the nxtmpdir folder for third-party packages.

tools/Config.mk:
added macro
CLONE - Git clone repository.
CHECK_COMMITSHA - Check if the branch contains the commit SHA-1.

tools/testbuild.sh:
added option -S

For now I added in the folder this package

ESP_HAL_3RDPARTY_URL = https://github.com/espressif/esp-hal-3rdparty.git

ARCH
arch/xtensa/src/esp32/Make.defs
arch/xtensa/src/esp32s2/Make.defs
arch/xtensa/src/esp32s3/Make.defs
arch/risc-v/src/common/espressif/Make.defs
arch/risc-v/src/esp32c3-legacy/Make.defs

but you can also add other packages (maybe also of apps)
2024-09-20 11:26:01 +08:00
raiden00pl 31b2438ac1 github/workflows: add PR size labeler
add workflow that assigns labels based on the PR's size
2024-09-19 22:19:12 +08:00
Lup Yuen Lee d36197266a build.yml: Limit the GitHub Runners
This PR modifies NuttX CI and GitHub Actions, to comply with ASF Policy. Right now, every NuttX Pull Request will trigger 24 Concurrent Jobs (GitHub Runners), executing them in parallel: https://lupyuen.github.io/articles/ci

According to ASF Policy: We should run at most 15 Concurrent Jobs: https://infra.apache.org/github-actions-policy.html

Thus we'll cut down the Concurrent Jobs from 24 down to 15. That's 12 Linux Jobs, 2 macOS, 1 Windows. (Each job takes 30 mins to 2 hours)

(1) Right now our "Linux > Strategy" is a flat list of 20 Linux Jobs, all executed in parallel

(2) We change "Linux > Strategy" to prioritise by Target Architecture, and limit to 12 concurrent jobs

(3) So NuttX CI will initially execute 12 Build Jobs across Arm32, Arm64, RISC-V, Simulator and Xtensa. As they complete, NuttX CI will execute the remaining 8 Build Jobs (for Arm32).

(4) This will extend the Overall Build Duration from [2 hours](https://github.com/apache/nuttx/actions/runs/10817443237) to [2.25 hours](https://github.com/lupyuen4/ci-nuttx/actions/runs/10828246630)

(5) We'll also limit macOS Jobs to 2, Windows Jobs to 1
2024-09-13 14:33:13 +08:00
dependabot[bot] 5c90cd23f6 build(deps): bump github/super-linter from 6 to 7
Bumps [github/super-linter](https://github.com/github/super-linter) from 6 to 7.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/super-linter/compare/v6...v7)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-07 12:08:11 +08:00
simbit18 ccb20feb25 tools/ci/docker/linux/Dockerfile: Restarting the Docker-Linux workflow a new attempt
tools/ci/docker/linux/Dockerfile

revert from --strip-components=1 to --strip-components 1

.github/workflows/docker_linux.yml

   added -> workflow_dispatch:

Manual execution of a workflow
https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/manually-running-a-workflow
2024-09-02 14:11:51 -04:00
simbit18 1661a66843 [cmake]: added initial support for MSYS2
Currently concerns only arm.

tools/ci/testlist/msys2.dat:
At the moment I only added the board nucleo-l152re:nsh

.github/workflows/build.yml:
Enabled cmake for msys2
2024-08-27 21:36:12 +08:00
simbit18 439b9e9683 ISSUE_TEMPLATE: Fixed incorrect links for issue forms
Correct links:

- Bug report

- Feature request

- General Help

add BSD keyword
2024-08-05 15:35:48 -03:00
simbit18 cf0e832f2b Added Issue templates
Template

Bug report
Report a bug to improve NuttX stability

Feature request
Request an enhancement for NuttX

General Help
Get general support regarding NuttX

Action
An action for automatically labelling issues
2024-08-02 15:13:14 -03:00
simbit18 3637040d73 tools/ci/testlist: Added jobs to speed up CI checks.
Divided jobs risc-v and xtensa to finish workflow under 2 hours.
2024-07-30 01:43:29 +08:00
simbit18 d8a8d6e67c build.yml: fix error: externally-managed-environment 2024-07-29 22:24:48 +08:00
simbit18 6edd1e3f7d doc.yml: Updated the workflow to use version v4 of the actions/upload-artifact 2024-07-23 22:38:43 +08:00
simbit18 5f75c0ad84 buildyml: Updated the workflow to use version v4 of the actions/upload-artifact and actions/download-artifact. 2024-07-23 01:30:34 +08:00
simbit18 1540dc2d67 tools/testbuild.sh: add option -N use CMake with Ninja
tools/testbuild.sh
     added option -N Use CMake with Ninja as the backend.

    updated help.

    added date to print startup board

   added HOST=Msys

github/workflows/build.yml

   added option -N job docker
2024-07-18 13:40:20 +08:00
dependabot[bot] 9d0894fd51 build(deps): bump docker/build-push-action from 5 to 6
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-25 16:42:24 +08:00
dependabot[bot] 22ffa8ebf1 build(deps): bump github/super-linter from 5 to 6
Bumps [github/super-linter](https://github.com/github/super-linter) from 5 to 6.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/super-linter/compare/v5...v6)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-29 17:34:32 +08:00
simbit18 21572864e7 Minor improvement for tools/ci: Fixed cmake build of bloaty and installation in darwin.sh script.
function bloaty() Add  -D CMAKE_INSTALL_PREFIX="${NUTTXTOOLS}"/bloaty.
Improves workflow execution time because it is now cached.

Changed reference file to calculate the hash for key of actions/cache@v4. Now it is darwin.sh.
2024-03-19 20:52:40 +08:00
Xiang Xiao 9d5471349f ci: Remove the codecheck from build.yml
the check isn't really enabled and enforce before
due to a mass of false alarm, but recently it break
ci frequently, so it's better to remove it now.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-02-29 18:54:41 -03:00
dependabot[bot] 2ec36fa7bd build(deps): bump actions/cache from 3 to 4
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 01:42:03 -08:00
simbit18 eaf1d07809 tools/ci: add initial support for MSYS2
removed uname from msys2 job
2024-01-09 05:50:09 -08:00
dependabot[bot] 387e9d64ac build(deps): bump actions/setup-python from 4 to 5
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-10 21:53:27 -08:00
Xiang Xiao cf2f206f3b Revert "CI: Free space on worker building container"
done by https://github.com/apache/nuttx/pull/11354 now

This reverts commit 05801f9fec.
2023-12-10 06:39:30 -08:00
ThomasNS 2b6a42e88f free disk space action added to fix docker image build issue 2023-12-08 14:42:17 +01:00
ThomasNS 54f72d9e5e free up runner disk space before build docker image 2023-12-07 19:48:28 -08:00
dependabot[bot] b98e78b9f5 build(deps): bump docker/build-push-action from 4 to 5
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 13:33:40 +08:00
dependabot[bot] 1bd0e0ec91 build(deps): bump docker/login-action from 2 to 3
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 13:33:29 +08:00
dependabot[bot] 045afdf8b5 build(deps): bump docker/setup-buildx-action from 2 to 3
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 13:33:15 +08:00
dependabot[bot] 890dd87a4a build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 14:28:40 +08:00
Xiang Xiao b090b7340b github: Skip the build if the change is under tools/ci/docker/linux
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-24 12:09:11 -03:00
chao an ed6503b9a3 ci/check: install format tool before run style check script
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-21 20:47:26 +08:00
Petro Karashchenko dc6baf68a9 .github/workflows: run MAC OS builds based on macos-13 image
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-05 00:16:44 +08:00
Brennan Ashton 6417ca79ad CI: set-output command is deprecated
CI currently runs with the warning:

The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2023-05-16 15:56:01 +08:00
Brennan Ashton 9a654b658e docs: Generate pdf version of docs for #9095
This implements the changes required to genreate the pdf version
of the documentation. The pdf will be generated as a build artifact
attached to the build. This is the first patch to enable this
a follow on patch to the website repo will publish the pdf to the
NuttX website.
2023-05-16 15:12:10 +08:00