60 lines
2.5 KiB
YAML
60 lines
2.5 KiB
YAML
name: Build Cross-Compiled ROS 2 Images
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
platform:
|
|
description: "Target platform"
|
|
required: true
|
|
type: choice
|
|
options: [rk3588]
|
|
default: rk3588
|
|
ros_distro:
|
|
description: "ROS 2 distribution"
|
|
required: true
|
|
type: choice
|
|
options: [rolling, jazzy, lyrical]
|
|
default: lyrical
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
matrix:
|
|
platform: ${{ fromJSON(format('["{0}"]', inputs.platform)) }}
|
|
ros_distro: ${{ fromJSON(format('["{0}"]', inputs.ros_distro)) }}
|
|
fail-fast: false
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
# ── Stage 1: cc-base ─────────────────────────────────────────────
|
|
- name: Build cc-base
|
|
run: docker compose -f cross_compile/compose.yaml build cc-base
|
|
|
|
# ── Stage 2: cc-toolchain ─────────────────────────────────────────
|
|
- name: Build cc-toolchain (${{ matrix.platform }})
|
|
run: PLATFORM=${{ matrix.platform }} docker compose -f cross_compile/compose.yaml build cc-toolchain
|
|
|
|
# ── Stage 3: vendor-packages ──────────────────────────────────────
|
|
- name: Build vendor-packages (${{ matrix.platform }})
|
|
run: PLATFORM=${{ matrix.platform }} docker compose -f cross_compile/compose.yaml build vendor-packages
|
|
|
|
# ── Stage 4: ros2 ─────────────────────────────────────────────────
|
|
- name: Build ROS 2 (${{ matrix.ros_distro }})
|
|
run: PLATFORM=${{ matrix.platform }} ROS_DISTRO=${{ matrix.ros_distro }} docker compose -f cross_compile/compose.yaml build ros2
|
|
|
|
# ── Summary ───────────────────────────────────────────────────────
|
|
- name: Image summary
|
|
if: always()
|
|
run: |
|
|
echo "### Built Images :rocket:" >> $GITHUB_STEP_SUMMARY
|
|
docker images \
|
|
--filter "reference=cc-*" \
|
|
--filter "reference=*/cc-*" \
|
|
--format "| \`{{.Repository}}:{{.Tag}}\` | {{.Size}} |" \
|
|
>> $GITHUB_STEP_SUMMARY |