test[CI][littlefs]: 添加 RT-Thread 编译验证#34
Conversation
add a GitHub Actions workflow for RT-Thread littlefs package builds clone RT-Thread and copy the package into the selected BSP package tree enable the required DFS, MTD NOR, heap, mutex, and littlefs Kconfig symbols compile the qemu-vexpress-a9 BSP against master and v5.0.1 verify that dfs_lfs_init and lfs_mount are linked into the generated ELF
WalkthroughAdds a new RT-Thread LittleFS CI validation pipeline: a build script that bootstraps an RT-Thread environment, integrates the littlefs package, applies configuration, and verifies a successful compile; and a GitHub Actions workflow that orchestrates this script across RT-Thread versions. ChangesRT-Thread LittleFS CI Validation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/rtthread.yml (2)
59-59: ⚡ Quick winPin
kconfiglibto a specific version for reproducible CI.The upstream kconfiglib project has not been maintained for more than 4 years, meaning the PyPI version is essentially frozen at 14.1.0, but an unpinned install is still vulnerable to any future republication or accidental version bump changing behavior without notice.
⚙️ Proposed fix
- python3 -m pip install --user kconfiglib + python3 -m pip install --user 'kconfiglib==14.1.0'🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/rtthread.yml at line 59, Pin the kconfiglib dependency in the GitHub Actions workflow by replacing the unpinned pip install step (the line containing "python3 -m pip install --user kconfiglib") with an explicit version specification (e.g., kconfiglib==14.1.0) to ensure reproducible CI installs and avoid accidental future changes.
3-6: ⚡ Quick winConsider adding a
pathsfilter to avoid running the 45-minute ARM build on unrelated changes.Without any
paths:filter, every push to every branch (e.g., documentation-only, CI-script-only, README) triggers the full RT-Thread compile. A focused filter limits wasteful CI minutes while keeping coverage on code that matters.⚙️ Example paths filter
on: push: + paths: + - '**.c' + - '**.h' + - '**.py' + - '.github/workflows/rtthread.yml' + - '.github/ci/**' pull_request: + paths: + - '**.c' + - '**.h' + - '**.py' + - '.github/workflows/rtthread.yml' + - '.github/ci/**' workflow_dispatch:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/rtthread.yml around lines 3 - 6, The workflow currently triggers the full RT-Thread build for all pushes and PRs because the top-level on: block (events push, pull_request, workflow_dispatch) has no paths filter; add a paths: filter under push and pull_request in the same on: block to restrict runs to relevant files (e.g., source, board, build scripts) and exclude docs/ci-only changes so the long ARM build only runs for changes affecting RT-Thread code; modify the on: configuration (the push and pull_request entries) to include appropriate glob patterns for your codebase.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/rtthread.yml:
- Line 59: Pin the kconfiglib dependency in the GitHub Actions workflow by
replacing the unpinned pip install step (the line containing "python3 -m pip
install --user kconfiglib") with an explicit version specification (e.g.,
kconfiglib==14.1.0) to ensure reproducible CI installs and avoid accidental
future changes.
- Around line 3-6: The workflow currently triggers the full RT-Thread build for
all pushes and PRs because the top-level on: block (events push, pull_request,
workflow_dispatch) has no paths filter; add a paths: filter under push and
pull_request in the same on: block to restrict runs to relevant files (e.g.,
source, board, build scripts) and exclude docs/ci-only changes so the long ARM
build only runs for changes affecting RT-Thread code; modify the on:
configuration (the push and pull_request entries) to include appropriate glob
patterns for your codebase.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6f007fab-cb40-481c-8f30-41558853f536
📒 Files selected for processing (2)
.github/ci/rtthread-littlefs/build.sh.github/workflows/rtthread.yml
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
当前 littlefs package 缺少面向 RT-Thread BSP 的自动化编译验证,无法在 PR 阶段及时发现 package 与 RT-Thread Kconfig、SCons 构建图、DFS/MTD 依赖或链接符号之间的集成问题。
本 PR 添加 RT-Thread 编译 CI,用于在 GitHub Actions 中验证 littlefs package 能够被复制到 RT-Thread BSP 的 packages/littlefs 路径下,并完成配置生成、编译和关键符号链接检查。
你的解决方案是什么 (what is your solution)
新增
.github/workflows/rtthread.yml,在 push、pull_request 和 workflow_dispatch 时触发 RT-Thread littlefs 编译验证。新增
.github/ci/rtthread-littlefs/build.sh,执行以下流程:packages/littlefs;littlefs_compile_check.c,引用真实 littlefs API 并导出初始化检查函数;.config启用 DFS、DFS v1、MTD NOR、heap、mutex、device 和PKG_USING_LITTLEFS等必要配置;nm检查dfs_lfs_init和lfs_mount符号是否已链接进目标 ELF;请提供验证的bsp和config (provide the config and bsp)
BSP: bsp/qemu-vexpress-a9
.config: CONFIG_RT_USING_COMPONENTS_INIT CONFIG_RT_USING_DEVICE CONFIG_RT_USING_DEVICE_OPS CONFIG_RT_USING_HEAP CONFIG_RT_USING_DFS CONFIG_DFS_USING_POSIX CONFIG_DFS_USING_WORKDIR CONFIG_RT_USING_DFS_V1 CONFIG_RT_USING_DFS_DEVFS CONFIG_RT_USING_DFS_ROMFS CONFIG_RT_USING_DEVICE_IPC CONFIG_RT_USING_MUTEX CONFIG_RT_USING_MTD_NOR CONFIG_PKG_USING_LITTLEFS
action: https://github.com/wdfk-prog/littlefs/actions/runs/25356576204
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned upSummary by CodeRabbit