Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI that builds with colcon. #70

Merged
merged 3 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 16 additions & 4 deletions .github/workflows/rust_and_ros2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,39 @@ jobs:
docs_no_ros:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: docker build . --file ./tests/Dockerfile_no_ros --tag r2r_no_ros
- run: docker run r2r_no_ros cargo build --features doc-only

minimal_workspace_humble:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout tools repo
uses: actions/checkout@v4
with:
repository: m-dahl/r2r_minimal_node
path: r2r_minimal_node
- run: docker build . --file ./tests/Dockerfile_humble --tag r2r_humble
- run: docker run r2r_humble /r2r/tests/build_minimal_node.bash

tests_humble:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: docker build . --file ./tests/Dockerfile_humble --tag r2r_humble
- run: docker run r2r_humble cargo test

tests_galactic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: docker build . --file ./tests/Dockerfile_galactic --tag r2r_galactic
- run: docker run r2r_galactic cargo test

tests_foxy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: docker build . --file ./tests/Dockerfile_foxy --tag r2r_foxy
- run: docker run r2r_foxy cargo test
2 changes: 1 addition & 1 deletion r2r_cargo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function(r2r_cargo)
if(CARGO_CLEAN)
add_custom_target(cargo_target ALL
COMMAND ${CMAKE_COMMAND} "-E" "env" "cargo" "clean" "--profile" "colcon"
COMMAND ${CMAKE_COMMAND} "-E" "env" "RUSTFLAGS=$ENV{RUSTFLAGS}" "CMAKE_IDL_PACKAGES=$ENV{CMAKE_IDL_PACKAGES}" "CMAKE_INCLUDE_DIRS=$ENV{CMAKE_INCLUDE_DIRS_PACKAGES}" "cargo" "build" "--profile" "colcon"
COMMAND ${CMAKE_COMMAND} "-E" "env" "RUSTFLAGS=$ENV{RUSTFLAGS}" "CMAKE_IDL_PACKAGES=$ENV{CMAKE_IDL_PACKAGES}" "CMAKE_INCLUDE_DIRS=$ENV{CMAKE_INCLUDE_DIRS}" "cargo" "build" "--profile" "colcon"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
else()
Expand Down
3 changes: 3 additions & 0 deletions tests/Dockerfile_foxy
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# syntax=docker/dockerfile:1
FROM ros:foxy

# Update ROS expired key
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B63CF8FDE49746E98FA01DDAD19BAB3CBF125EA

# Update default packages
RUN apt-get update

Expand Down
3 changes: 3 additions & 0 deletions tests/Dockerfile_galactic
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# syntax=docker/dockerfile:1
FROM ros:galactic

# Update ROS expired key
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B63CF8FDE49746E98FA01DDAD19BAB3CBF125EA

# Update default packages
RUN apt-get update

Expand Down
18 changes: 18 additions & 0 deletions tests/build_minimal_node.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Use the local version of r2r when building the minimal node.
cat >> /r2r/r2r_minimal_node/r2r_minimal_node/Cargo.toml << EOF

[patch.crates-io]
r2r = { path = "../../r2r" }

[workspace]

EOF

# Overwrite r2r_cargo to make sure the version in the r2r repo is ok.
cp /r2r/r2r_cargo.cmake /r2r/r2r_minimal_node/r2r_minimal_node/

# Build using colcon.
cd /r2r/r2r_minimal_node
colcon build