使用 ROS Build Farm 测试您的代码
ROS 2 Build Farm 功能非常强大。
除了创建二进制文件之外,它还将通过在 PR 合并之前编译和运行 ROS 包的所有测试来测试拉取请求。
有四个先决条件。
GitHub 用户 @ros-pull-request-builder 必须有权访问存储库。
GitHub 存储库必须设置 webhook。
test_pull_requests
标志必须为 true。
GitHub 访问
您可以在 GitHub 组织级别授予对 PR Builder 的访问权限,也可以仅授予对单个 GitHub 存储库的访问权限。
GitHub 组织
Open https://github.com/orgs/%YOUR_ORG%/people (while replacing
%YOUR_ORG%
with the appropriate organization)Click
Invite Member
and enterros-pull-request-builder
GitHub 存储库
Open https://github.com/%YOUR_ORG%/%YOUR_REPO%/settings/access (while replacing
%YOUR_ORG%/%YOUR_REPO$
with the appropriate organization/repo)Click
Add people
and enterros-pull-request-builder
Select
Admin
orWrite
for their role. (see next section)
WebHooks
如果您授予“ros-pull-request-builder”完全管理权限,它将自动设置钩子。
或者,您可以通过仅使用**write**权限进行设置来避免对完全管理权限的需求。
Open https://github.com/%YOUR_ORG%/%YOUR_REPO%/settings/hooks/new)
Enter
"https://build.ros2.org/ghprbhook/
as the Payload URL- Check the following options:
Let me select individual events.
Issue comments
Pull requests
test_pull_requests
对于您想要进行拉取请求测试的每个 ROS 发行版,您必须在 rosdistro 的相应部分中启用 test_pull_requests
标志。
Option 1 - You have the option when running bloom to turn on pull request testing.
Option 2 - You can carefully manually edit the appropriate file in the rosdistro repo, and make a new pull request. Example. Documented in REP 143.
请注意,添加拉取请求后,通常直到夜间 Jenkins 重新配置后才会创建作业。