ROS 2 CI #48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ROS 2 CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: "0 2 * * *" | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build_and_test: | |
| name: "build / ${{ matrix.ros_distribution }}" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ros_distribution: | |
| - humble | |
| - jazzy | |
| - rolling | |
| include: | |
| - ros_distribution: humble | |
| container_image: rostooling/setup-ros-docker:ubuntu-jammy-latest | |
| - ros_distribution: jazzy | |
| container_image: rostooling/setup-ros-docker:ubuntu-noble-latest | |
| - ros_distribution: rolling | |
| container_image: rostooling/setup-ros-docker:ubuntu-noble-latest | |
| container: | |
| image: ${{ matrix.container_image }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # python3-robotmem-pip rosdep key 尚在 review(ros/rosdistro PR #50206) | |
| # CI 中直接 pip install 替代 | |
| # Ubuntu 24.04+ (Noble): pip 需要 --break-system-packages | |
| # Ubuntu 22.04 (Jammy): 直接 pip install | |
| - name: "Install robotmem" | |
| run: pip3 install --break-system-packages --quiet "git+https://github.com/robotmem/robotmem.git" 2>/dev/null || pip3 install --quiet "git+https://github.com/robotmem/robotmem.git" | |
| - uses: ros-tooling/action-ros-ci@v0.4 | |
| id: action_ros_ci | |
| with: | |
| target-ros2-distro: ${{ matrix.ros_distribution }} | |
| package-name: >- | |
| robotmem_msgs | |
| robotmem_ros | |
| rosdep-skip-keys: python3-robotmem-pip | |
| # 暂时跳过 colcon test(unittest discover 问题待修) | |
| skip-tests: true | |
| colcon-defaults: | | |
| { | |
| "build": { | |
| "symlink-install": true | |
| } | |
| } | |
| - name: "Verify install" | |
| run: | | |
| test -d "${{ steps.action_ros_ci.outputs.ros-workspace-directory-name }}/install/robotmem_msgs" | |
| test -d "${{ steps.action_ros_ci.outputs.ros-workspace-directory-name }}/install/robotmem_ros" | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: colcon-logs-${{ matrix.ros_distribution }} | |
| path: | | |
| ${{ steps.action_ros_ci.outputs.ros-workspace-directory-name }}/log/ | |
| ${{ steps.action_ros_ci.outputs.ros-workspace-directory-name }}/build/*/test_results/ | |
| retention-days: 7 | |
| lint: | |
| name: "lint / ${{ matrix.linter }}" | |
| runs-on: ubuntu-latest | |
| # lint 不阻塞 CI(逐步修复中) | |
| continue-on-error: true | |
| container: | |
| image: rostooling/setup-ros-docker:ubuntu-noble-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| linter: [xmllint, copyright, flake8, pep257] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ros-tooling/setup-ros@v0.7 | |
| with: | |
| required-ros-distributions: jazzy | |
| - uses: ros-tooling/action-ros-lint@v0.1 | |
| with: | |
| linter: ${{ matrix.linter }} | |
| package-name: >- | |
| robotmem_msgs | |
| robotmem_ros |