Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
28a09eb
Trying ci on other OSes
ct2034 Jul 7, 2025
14cf35c
on / under
ct2034 Jul 7, 2025
0bc58cc
windows-2019
ct2034 Jul 7, 2025
e0846a3
welcome to 2022
ct2034 Jul 10, 2025
66c72c5
push on ros2 branch ..
ct2034 Jul 10, 2025
972b5f2
using main branches
ct2034 Jul 10, 2025
5cdacec
master of lin
ct2034 Jul 10, 2025
afc49d9
fixed setup version
ct2034 Jul 10, 2025
9684f45
windows-latest
ct2034 Aug 25, 2025
0755473
Fix windows build
christophfroehlich Sep 30, 2025
d16759d
different id
ct2034 Oct 21, 2025
17f4508
one package with all distros
ct2034 Oct 21, 2025
afd8115
upgrade colcon-meson
ct2034 Oct 21, 2025
cc6fcb8
\
ct2034 Oct 21, 2025
45fa261
one line. welcome to windows
ct2034 Oct 21, 2025
1c0b853
More packages
ct2034 Oct 22, 2025
1fee478
being clever about branch
ct2034 Oct 22, 2025
ff2044c
Should work for both, push and PRs
ct2034 Oct 22, 2025
e0b9b69
custom vsc file
ct2034 Oct 22, 2025
d3c2fe4
Getting branch names differently
ct2034 Oct 22, 2025
75c637b
one yml file
ct2034 Oct 22, 2025
b77c0d9
Merge branch 'ros2' into add/ci_win_mac
ct2034 Oct 22, 2025
3adeba4
catkin_pkg is still missing somehow
ct2034 Oct 22, 2025
5ef50f8
rosdep
ct2034 Oct 22, 2025
90e08a8
--from-paths src
ct2034 Oct 22, 2025
dde5f47
?
ct2034 Oct 22, 2025
74cb3ec
Just install for current package
ct2034 Oct 22, 2025
b499466
trying what ros2_control does
ct2034 Nov 19, 2025
99aeb98
fixing what i broke
ct2034 Nov 19, 2025
ac7df90
using the input
ct2034 Nov 19, 2025
5eef8d0
package based cache key
ct2034 Nov 20, 2025
e1956ee
where does input come from?
ct2034 Nov 20, 2025
610d648
workflow_call ?
ct2034 Nov 20, 2025
d9511bc
as env ..
ct2034 Nov 20, 2025
630b497
all as env
ct2034 Nov 20, 2025
ac5b162
overwrite lockfile
ct2034 Nov 20, 2025
a25c288
making folder
ct2034 Nov 20, 2025
9194668
no creating src folder again
ct2034 Nov 20, 2025
73c09fc
what are underlay_ws_pkgs ?
ct2034 Nov 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: 1
steps:
- uses: actions/checkout@v1
- uses: ros-tooling/setup-ros@master
- uses: ros-tooling/setup-ros@0.7.15
with:
required-ros-distributions: ${{ matrix.distro }}
- uses: ros-tooling/action-ros-lint@master
Expand Down
263 changes: 258 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,41 @@ on:
schedule:
# Run every week at 20:00 on Sunday
- cron: "0 20 * * 0"

jobs:
ros_distro_from_branch_name:
runs-on: ubuntu-latest
outputs:
distro: ${{ steps.set-distro.outputs.distro }}
steps:
- name: Set ROS distro from branch name
id: set-distro
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "This is a PR. Getting branch name from base ref."
branch_name="${{ github.event.pull_request.base.ref }}"
else
echo "This is a push. Getting branch name from head ref."
branch_name="${{ github.head_ref }}"
fi
echo "> Branch name is: ${branch_name}"

if [[ "${branch_name}" == *"ros2"* ]]; then
distro="rolling"
elif [[ "${branch_name}" == *"ros2-humble"* ]]; then
distro="humble"
elif [[ "${branch_name}" == *"ros2-jazzy"* ]]; then
distro="jazzy"
elif [[ "${branch_name}" == *"ros2-kilted"* ]]; then
distro="kilted"
else
echo "! Unknown branch for determining ROS distro: ${GITHUB_REF##*/}"
exit 1
fi
echo "> Determined ROS distro to be: ${distro}!"
echo "distro=$distro" >> $GITHUB_OUTPUT
build_and_test:
name: ${{ matrix.package }} on ${{ matrix.distro }}
name: ${{ matrix.package }} under ${{ matrix.distro }}
needs: ros_distro_from_branch_name
strategy:
fail-fast: false
matrix:
Expand All @@ -22,17 +53,239 @@ jobs:
self_test,
]
include:
- distro: rolling
- distro: ${{ needs.ros_distro_from_branch_name.outputs.distro }}
os: 24.04
runs-on: ubuntu-latest
container: ubuntu:${{ matrix.os }}
steps:
- uses: ros-tooling/setup-ros@master
- uses: ros-tooling/setup-ros@0.7.15
with:
required-ros-distributions: ${{ matrix.distro }}
- uses: ros-tooling/action-ros-ci@master
- uses: ros-tooling/action-ros-ci@0.4.5
with:
target-ros2-distro: ${{ matrix.distro }}
package-name: ${{ matrix.package }}
# vcs-repo-file-url: |
# https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos
build_win:
name: ${{ matrix.package }} under ${{ matrix.distro }} (windows)
needs: ros_distro_from_branch_name
runs-on: windows-2022
# container: ${{ inputs.container }}
env:
ros_underlay_path: C:\dev
upstream_workspace: C:\upstream_ws
# this will be src/{repo-owner}/{repo-name}
repo_path: src/${{ github.repository }}

# INPUTS ...
# Space-separated list of additional pixi dependencies
pixi_dependencies: "rosinstall_generator"
# Path to a repos file with additional windows dependencies
windows_dependencies: ""
# Space-separated list of packages to skip from
skip_dependencies: "sdformat_urdf"
# Space-separated list of packages to skip from build
skip_packages: ""
# Space-separated list of packages to be built with Ninja generator (default is MSVC otherwise)
ninja_packages: ""
# Additional arguments to pass to CMake for upstream workspace, e.g. -DBUILD_TESTING=OFF
upstream_cmake_args: "-DBUILD_TESTING=OFF"
# Additional arguments to pass to CMake for target workspace, e.g. -DBUILD_TESTING=OFF
target_cmake_args: ""
strategy:
fail-fast: false
matrix:
package: [
diagnostic_aggregator,
diagnostic_common_diagnostics,
diagnostic_remote_logging,
diagnostic_updater,
self_test,
]
include:
- distro: ${{ needs.ros_distro_from_branch_name.outputs.distro }}
steps:
- name: Restore pixi.lock
uses: actions/cache/restore@v4
id: cache
with:
path: pixi.lock
key: pixi|${{ matrix.distro }}|${{ matrix.package }}

- name: Bootstrap pixi and patch manifest file
# https://docs.ros.org/en/rolling/Installation/Windows-Install-Binary.html
run: |
$manifest = "pixi.toml"
irm https://raw.githubusercontent.com/ros2/ros2/refs/heads/rolling/pixi.toml -OutFile $manifest

# patch pixi.toml to add extra dependencies
$deps = "${{ env.pixi_dependencies }}"
Write-Host "env.pixi_dependencies = $deps"
if (-not [string]::IsNullOrWhiteSpace($deps)) {
Write-Host "Extra dependencies specified: $deps"

# Read file into a string array
[string[]]$content = Get-Content $manifest

# Find [dependencies] section
$depIndex = $content.IndexOf("[dependencies]")

# If section not found, append it
if ($depIndex -eq -1) {
Add-Content $manifest "`n[dependencies]"
$content = Get-Content $manifest
$depIndex = $content.IndexOf("[dependencies]")
}

# Convert array to a List[string] explicitly
$contentList = New-Object 'System.Collections.Generic.List[string]'
$contentList.AddRange([string[]]$content)

# Insert each dependency after the [dependencies] section
$insertIndex = $depIndex + 1

foreach ($dep in $deps.Split(" ")) {
# Only insert if not already present
if (-not ($contentList -match "^\s*$dep\s*=")) {
$contentList.Insert($insertIndex, "$dep = `"*`"")
$insertIndex++
}
}

# Save updated manifest
$contentList | Set-Content $manifest
} else {
Write-Host "No additional dependencies specified."
}

- name: Install pixi
uses: prefix-dev/setup-pixi@v0.9.3
# Cache pixi environment only on default branch to save disk space
with:
cache: ${{ steps.cache.outputs.cache-hit == 'true' }} # only use cache if pixi.lock is present
cache-write: ${{ steps.cache.outputs.cache-hit == 'true' && github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} # only write cache on push to default branch to save disk space, caches from PRs can't be accessed anyways; only allowed if pixi.lock is present
locked: false

- name: Cache pixi.lock
uses: actions/cache/save@v4
# independent of the success of the following steps, but only on default branch
# cache independent of the cache hit of the restore step, because pixi.toml could have changed
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
with:
path: pixi.lock
key: pixi|${{ matrix.distro }}|${{ matrix.package }}

- name: Upload pixi lock file
uses: actions/upload-artifact@v5
with:
name: pixi.lock
path: pixi.lock
overwrite: true

- name: Install ROS
# Download and extract ROS 2 package
# https://docs.ros.org/en/rolling/Installation/Windows-Install-Binary.html
run: |
# TODO(christophfroehlich) remove with fix below
Invoke-Expression ((& pixi shell-hook -s powershell) -join "`n")

mkdir -p ${{ env.ros_underlay_path }}
Set-Location -Path ${{ env.ros_underlay_path }}
$url = "https://ci.ros2.org/view/packaging/job/packaging_windows/lastSuccessfulBuild/artifact/ws/ros2-package-windows-AMD64.zip"
$output = "ros2-package-windows-AMD64.zip"
Invoke-WebRequest -Uri $url -OutFile $output
Expand-Archive -Path $output -DestinationPath ros2_${{ matrix.distro }}

# python packages are broken: https://github.com/ros2/ros2/issues/1675
# TODO(christophfroehlich) remove once https://github.com/ros2/ci/pull/817 is released
cd ros2_${{ matrix.distro }}
irm https://gist.githubusercontent.com/knmcguire/fd5326de442289712539182f6257191c/raw/bcb4bf2a460af3a1d71bcfcdcefa065ebd5060d7/preinstall_setup_windows.py -OutFile preinstall_setup_windows.py
python preinstall_setup_windows.py

- name: Get package list
id: package_list_action
uses: ros-controls/ros2_control_ci/.github/actions/set-package-list-pixi@master
with:
path: ${{ env.repo_path }}
manifest-path: pixi.toml

- name: Clone dependencies
run: |
Invoke-Expression ((& pixi shell-hook -s powershell) -join "`n")
${{ env.ros_underlay_path }}\ros2_${{ matrix.distro }}\ros2-windows\setup.ps1

# Workaround .. --from-path: 'src/ros/diagnostics' is not an existing directory
mkdir -p ${{ env.upstream_workspace }}/${{ env.repo_path }}

# check for repos files, and pass them to vcstool
# mkdir -p ${{ env.upstream_workspace }}/src
$repo_file = "${{ env.repo_path }}\${{ steps.package_list_action.outputs.repo_name }}.${{ matrix.distro }}.repos"
if (Test-Path "$repo_file") {
Write-Output "Local repos file found"
vcs import --input $repo_file ${{ env.upstream_workspace }}/src
}
if (![string]::IsNullOrWhiteSpace("${{ env.windows_dependencies }}")) {
$repo_file_win = "${{ env.repo_path }}\${{ env.windows_dependencies }}"
if (Test-Path "$repo_file_win") {
Write-Output "Windows repos file found"
vcs import --input $repo_file_win ${{ env.upstream_workspace }}/src
}
}

# use rosinstall_generator to get all dependencies which are not yet installed
$underlay_ws_pkgs=$(ros2 pkg list)
Write-Host "underlay_ws_pkgs = $underlay_ws_pkgs"
rosinstall_generator --rosdistro ${{ matrix.distro }} --deps --deps-only --format repos --exclude $underlay_ws_pkgs ${{ env.skip_dependencies }} --from-path ${{ env.upstream_workspace }} ${{ env.repo_path }} > deps.repos
# rosinstall_generator skips excludes with are from a different repo (gbp instead of development repo)
vcs import --skip-existing --input deps.repos ${{ env.upstream_workspace }}/src

- name: Upload repos file
uses: actions/upload-artifact@v5
with:
name: ${{ steps.package_list_action.outputs.repo_name }}.${{ matrix.distro }}.windows.repos
path: deps.repos

- name: Build upstream workspace
# use Ninja generator optionally for selected packages.
# This is needed for RSL, but doesn't work for msg packages
# https://github.com/search?q=repo%3APickNikRobotics%2FRSL%20ninja&type=code
# https://github.com/colcon/colcon-ros/issues/84#issuecomment-1862881299
shell: cmd
run: |
call pixi shell-hook -s cmd > pixi_env.bat
call pixi_env.bat >nul 2>&1

call ${{ env.ros_underlay_path }}\ros2_${{ matrix.distro }}\ros2-windows\setup.bat
pushd ${{ env.upstream_workspace }}

@echo on

set skip_arg=
if not "${{ env.skip_packages }}"=="" (
set skip_arg=${{ env.skip_packages }}
)

if not "${{ env.ninja_packages }}"=="" (
colcon build --packages-up-to ${{ env.ninja_packages }} --cmake-args -G Ninja --event-handler console_cohesion+ --merge-install
set skip_arg=%skip_arg% ${{ env.ninja_packages }}
)

colcon build --packages-skip %skip_arg% --event-handler console_cohesion+ --cmake-args ${{ env.upstream_cmake_args }} --merge-install

- name: Build target workspace
shell: cmd
run: |
call pixi shell-hook -s cmd > pixi_env.bat
call pixi_env.bat >nul 2>&1

call ${{ env.ros_underlay_path }}\ros2_${{ matrix.distro }}\ros2-windows\setup.bat
call ${{ env.upstream_workspace }}\install\setup.bat

@echo on

set skip_arg=
if not "${{ env.skip_packages }}"=="" (
set skip_arg=--packages-skip ${{ env.skip_packages }}
)
colcon build %skip_arg% --event-handler console_cohesion+ --cmake-args ${{ env.target_cmake_args }} --merge-install
Loading