|
7 | 7 | required: true
|
8 | 8 | type: string
|
9 | 9 | os_name:
|
10 |
| - description: 'On which OS to run the workflow, e.g. ubuntu-22.04' |
| 10 | + description: 'On which runner-OS to run the workflow, e.g. ubuntu-22.04' |
11 | 11 | required: false
|
12 | 12 | default: 'ubuntu-latest'
|
13 | 13 | type: string
|
| 14 | + container: |
| 15 | + description: '(optional) Docker container to run the job in, e.g. ubuntu:noble' |
| 16 | + required: false |
| 17 | + default: '' |
| 18 | + type: string |
14 | 19 |
|
15 | 20 | jobs:
|
16 | 21 | coverage:
|
17 | 22 | name: coverage build ${{ inputs.ros_distro }}
|
18 | 23 | runs-on: ${{ inputs.os_name }}
|
| 24 | + container: ${{ inputs.container }} |
19 | 25 | steps:
|
| 26 | + - name: "Determine prerequisites" |
| 27 | + id: prereq |
| 28 | + run: | |
| 29 | + DEBIAN_FRONTEND=noninteractive apt update && apt upgrade -y |
| 30 | + apt install -y sudo apt-utils |
| 31 | + echo "need_node=$(command -v node >/dev/null 2>&1 && echo 0 || echo 1)" >> $GITHUB_OUTPUT |
| 32 | + echo "need_python=$(command -v python3 >/dev/null 2>&1 && echo 0 || echo 1)" >> $GITHUB_OUTPUT |
| 33 | + echo "need_rosdep=$(command -v rosdep >/dev/null 2>&1 && echo 0 || echo 1)" >> $GITHUB_OUTPUT |
| 34 | + echo "need_ros=$(if [ -d "/opt/ros/${{ inputs.ros_distro }}" ]; then echo 0; else echo 1; fi)" >> $GITHUB_OUTPUT |
| 35 | +
|
| 36 | + # needed for github actions, and only if a bare ubuntu image is used |
| 37 | + # Consider switching to https://github.com/actions/setup-node when it works |
| 38 | + # https://github.com/nektos/act/issues/973 |
| 39 | + # - uses: actions/setup-node@v4 |
| 40 | + # if: ${{ steps.prereq.outputs.need_node == '1' }} |
| 41 | + # with: |
| 42 | + # node-version: 16 |
| 43 | + - name: Install node |
| 44 | + if: ${{ steps.prereq.outputs.need_node == '1' }} |
| 45 | + run: | |
| 46 | + apt install -y curl |
| 47 | + curl -sS https://webi.sh/node | sh |
| 48 | + echo ~/.local/opt/node/bin >> $GITHUB_PATH |
| 49 | +
|
| 50 | + # not working for noble yet |
| 51 | + # - uses: actions/setup-python@v5 |
| 52 | + # with: |
| 53 | + # python-version: '3.11' |
| 54 | + # needed only if a bare ubuntu image is used |
| 55 | + - name: Install python |
| 56 | + if: ${{ steps.prereq.outputs.need_python == '1' }} |
| 57 | + run: | |
| 58 | + DEBIAN_FRONTEND=noninteractive apt install -y python3-pip |
| 59 | +
|
| 60 | + # why is this necessary for ros:rolling-ros-core-noble? |
| 61 | + # and why does this not work with setup-ros? |
| 62 | + - name: Install ros-dev-tools |
| 63 | + if: ${{ steps.prereq.outputs.need_rosdep == '1' }} |
| 64 | + run: | |
| 65 | + apt install -y ros-dev-tools \ |
| 66 | + python3-colcon-common-extensions python3-colcon-mixin python3-colcon-coveragepy-result |
| 67 | + rosdep init |
| 68 | +
|
| 69 | + # needed only if a non-ros image is used |
20 | 70 | - uses: ros-tooling/[email protected]
|
21 |
| - # - name: Temporary fix for rolling by setting the ROSDISTRO_INDEX_URL |
| 71 | + if: ${{ steps.prereq.outputs.need_ros == '1' }} |
| 72 | + |
| 73 | + # - name: Temporary fix for rolling@jammy by setting the ROSDISTRO_INDEX_URL |
22 | 74 | # # see https://docs.ros.org/en/rolling/How-To-Guides/Using-Custom-Rosdistro.html
|
23 | 75 | # run: |
|
24 | 76 | # if [[ "${{ inputs.ros_distro }}" == "rolling" ]]; then
|
|
31 | 83 | # echo "ROS_DISTRO: $ROS_DISTRO"
|
32 | 84 | # rosdep resolve test_msgs std_msgs || true
|
33 | 85 | # rosdep resolve test_msgs std_msgs --os=ubuntu:jammy --rosdistro=rolling
|
34 |
| - # - uses: actions/checkout@v4 |
| 86 | + |
| 87 | + - uses: actions/checkout@v4 |
35 | 88 | - id: package_list_action
|
36 | 89 | uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@master
|
37 | 90 | - uses: ros-tooling/[email protected]
|
|
0 commit comments