Swatantra-66 commented on issue #20483:
URL: https://github.com/apache/nuttx/issues/20483#issuecomment-6100552663

   Hi @acassis,
   
   I investigated the current CI pipeline (`.github/workflows/arch.yml`, 
`build.yml`, `labeler.yml`, and `tools/ci/testlist/`) to see why chip-isolated 
PRs like #20477 end up triggering all 14 `arm-xx` jobs.
   
   ### Current Pipeline Bottleneck
   1. **Broad Labeling**: `.github/labeler.yml` labels any change in 
`arch/arm/**` as `Arch: arm`.
   2. **Coarse-Grained Filter**: In `.github/workflows/arch.yml`, when `Arch: 
arm` is present, it skips non-ARM architectures (RISC-V, Xtensa, Simulator, 
etc.), but it passes **all 14** `arm-01` through `arm-14` jobs to the matrix.
   3. **Alphanumeric Partitioning**: `tools/ci/testlist/arm-*.dat` divides 
chips into arbitrary alphanumeric buckets (`[a]*`, `[b-h]*`, etc.) rather than 
chip families, so a one-line change in `imxrt` triggers all 14 container jobs 
building hundreds of unrelated STM32, NRF52, LPC, and SAMA5 defconfigs.
   
   ---
   
   ### Proposed Improvement Approaches
   
   #### Option A: Family-Based Testlists + Sub-Labels (Direct Implementation of 
Your Suggestion)
   1. **Refactor `tools/ci/testlist/`**:
      Group ARM and RISC-V testlists by major vendor/chip families rather than 
arbitrary numbers:
      - `arm-stm32f.dat`, `arm-stm32h.dat`, `arm-stm32l_u_g.dat`
      - `arm-imxrt.dat`
      - `arm-nrf.dat` (`nrf52`, `nrf53`, `nrf91`)
      - `arm-nxp.dat` (`lpc*`, `kinetis`, `s32k`)
      - `arm-sam.dat` (`sam34`, `sama5`, `samd`, `samv7`)
      - `arm-rp2040.dat` (`rp2040`, `rp23xx`)
      - `arm-other.dat`
   2. **Update `labeler.yml`**:
      Apply chip family labels (e.g. `Chip: imxrt`, `Chip: stm32`) when changes 
are isolated to `arch/<arch>/src/<chip>/**` and `boards/<arch>/<chip>/**`.
   3. **Update `arch.yml`**:
      When a `Chip: <family>` label is detected without core OS changes, filter 
the matrix to only run `arm-<family>.dat`.
   
   #### Option B: Dynamic Chip Filter in `testbuild.sh` (Zero Matrix Bloat)
   Instead of creating dozens of separate GitHub Actions matrix jobs (which 
could hit GitHub Actions concurrency/queue limits during complex PRs):
   1. Detect modified chip directories from the PR changeset (e.g., `imxrt`).
   2. If changes are strictly confined to `arch/<arch>/src/<chip>/**` or 
`boards/<arch>/<chip>/**` (and no common files like `sched/`, `fs/`, 
`include/nuttx/`, or `arch/*/src/common` were touched):
      Pass a target filter flag to `testbuild.sh` (e.g., `-F imxrt`) so it 
skips board configs outside that chip family.
   3. For PR #20477, this would compile only `imxrt` defconfigs in 2–3 minutes 
while keeping the existing matrix structure intact.
   
   ---
   
   I would be happy to work on this and submit a PR. Which approach aligns best 
with your vision for the CI?
   


-- 
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