lupyuen opened a new pull request, #14317:
URL: https://github.com/apache/nuttx/pull/14317

   ## Summary
   
   Currently, CI Build Jobs will validate the `defconfig` file just before 
compiling the NuttX Target (like `rv-virt:nsh`). This means that the Build Job 
might run for a while, before hitting a `defconfig` error and failing much 
later.
   
   This PR updates the CI Workflow `build.yml` to validate all `defconfig` 
files before running any builds. This means that errors in the `defconfig` 
files will be flagged earlier. And the Build Job will terminate (with an error) 
before any build begins.
   
   This behaviour is helpful for resolving CI Build Issues quickly. The code is 
derived from `[tools/testbuild.sh](http://tools/testbuild.sh)`. The enhancement 
was suggested here: https://github.com/apache/nuttx/issues/14259
   
   ## Impact
   
   The CI Workflow `build.yml` will validate all `defconfig` files before 
running any builds.
   
   If any errors are found in `defconfig` files: The Build Job will terminate 
(with an error) after all `defconfig` files have been validated, before any 
build begins.
   
   The Updated CI Workflow shall be synced to `nuttx-apps` repo in the next PR.
   
   ## Testing
   
   We tested by creating an intentional error in a `defconfig` file:
   
   __If defconfig validation fails:__ The Build Job terminates (with an error) 
after all `defconfig` files have been validated, before any build begins
   
https://github.com/lupyuen5/label-nuttx/actions/runs/11344293823/job/31548821624
   
   ```text
   Validating targets in tools/ci/testlist/x86_64-01.dat
   ./tools/refresh.sh --silent qemu-intel64/nsh
     Normalize qemu-intel64/nsh
   8d7
   < CONFIG_AAA=y
   Saving the new configuration file
   Error: qemu-intel64/nsh:1:1: error: qemu-intel64/nsh is configured 
incorrectly. To fix it, run "tools/refresh.sh qemu-intel64/nsh"
   ...
   Error: tools/ci/testlist/x86_64-01.dat:1:1: error: Quitting, defconfig 
validation failed for tools/ci/testlist/x86_64-01.dat
   ```
   
   Errors are specially formatted to display correctly in the GitHub Actions 
Job Summary:
   
   ![Screenshot 2024-10-15 at 6 43 47 
PM](https://github.com/user-attachments/assets/39ba335d-6d25-4cf1-97cc-bca6f0084747)
   
   __If defconfig validation is successful:__ The Build Job continues to build 
the targets
   
https://github.com/lupyuen5/label-nuttx/actions/runs/11343543363/job/31546414579
   
   ```text
   Validating targets in tools/ci/testlist/x86_64-01.dat
   ./tools/refresh.sh --silent qemu-intel64/nsh
     Normalize qemu-intel64/nsh
   ...
   Configuration/Tool: qemu-intel64/nsh
     Building NuttX...
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to