Skip to content

Commit 975f6fa

Browse files
committed
adapted the workflows
1 parent d8a4ccf commit 975f6fa

File tree

2 files changed

+164
-164
lines changed

2 files changed

+164
-164
lines changed

.github/workflows/rust-minimal.yml

+82-82
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ name: Rust Minimal
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88
schedule:
99
# Run the CI at 02:22 UTC every Tuesday
1010
# We pick an arbitrary time outside of most of the world's work hours
1111
# to minimize the likelihood of running alongside a heavy workload.
12-
- cron: '22 2 * * 2'
12+
- cron: "22 2 * * 2"
1313

1414
env:
1515
CARGO_TERM_COLOR: always
@@ -35,91 +35,91 @@ jobs:
3535
container:
3636
image: ${{ matrix.docker_image }}
3737
steps:
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v4
3939

40-
- name: Search packages in this repository
41-
id: list_packages
42-
run: |
43-
{
44-
echo 'package_list<<EOF'
45-
colcon list --names-only
46-
echo EOF
47-
} >> "$GITHUB_OUTPUT"
40+
- name: Search packages in this repository
41+
id: list_packages
42+
run: |
43+
{
44+
echo 'package_list<<EOF'
45+
colcon list --names-only
46+
echo EOF
47+
} >> "$GITHUB_OUTPUT"
4848
49-
- name: Setup ROS environment
50-
uses: ros-tooling/[email protected]
51-
with:
52-
required-ros-distributions: ${{ matrix.ros_distribution }}
53-
use-ros2-testing: ${{ matrix.ros_distribution == 'rolling' }}
49+
- name: Setup ROS environment
50+
uses: ros-tooling/[email protected]
51+
with:
52+
required-ros-distributions: ${{ matrix.ros_distribution }}
53+
use-ros2-testing: ${{ matrix.ros_distribution == 'rolling' }}
5454

55-
- name: Setup Rust
56-
uses: dtolnay/[email protected]
57-
with:
58-
components: clippy, rustfmt
55+
- name: Setup Rust
56+
uses: dtolnay/[email protected]
57+
with:
58+
components: clippy, rustfmt
5959

60-
- name: Install colcon-cargo and colcon-ros-cargo
61-
run: |
62-
sudo pip3 install git+https://github.com/colcon/colcon-cargo.git
63-
sudo pip3 install git+https://github.com/colcon/colcon-ros-cargo.git
60+
- name: Install colcon-cargo and colcon-ros-cargo
61+
run: |
62+
sudo pip3 install git+https://github.com/colcon/colcon-cargo.git
63+
sudo pip3 install git+https://github.com/colcon/colcon-ros-cargo.git
6464
65-
- name: Check formatting of Rust packages
66-
run: |
67-
for path in $(colcon list | awk '$3 == "(ament_cargo)" { print $2 }'); do
68-
cd $path
69-
rustup toolchain install nightly
70-
cargo +nightly fmt -- --check
71-
cd -
72-
done
65+
- name: Check formatting of Rust packages
66+
run: |
67+
for path in $(colcon list | awk '$3 == "(ament_cargo)" { print $2 }'); do
68+
cd $path
69+
rustup toolchain install nightly
70+
cargo +nightly fmt -- --check
71+
cd -
72+
done
7373
74-
- name: Build and test
75-
id: build
76-
uses: ros-tooling/[email protected]
77-
with:
78-
package-name: ${{ steps.list_packages.outputs.package_list }}
79-
target-ros2-distro: ${{ matrix.ros_distribution }}
80-
vcs-repo-file-url: ros2_rust_${{ matrix.ros_distribution }}.repos
74+
- name: Build and test
75+
id: build
76+
uses: ros-tooling/[email protected]
77+
with:
78+
package-name: ${{ steps.list_packages.outputs.package_list }}
79+
target-ros2-distro: ${{ matrix.ros_distribution }}
80+
vcs-repo-file-url: ros2_rust_${{ matrix.ros_distribution }}.repos
8181

82-
- name: Run clippy on Rust packages
83-
run: |
84-
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
85-
. /opt/ros/${{ matrix.ros_distribution }}/setup.sh
86-
for path in $(colcon list | awk '$3 == "(ament_cargo)" { print $2 }'); do
87-
cd $path
88-
echo "Running clippy in $path"
89-
# Run clippy for all features except generate_docs (needed for docs.rs)
90-
if [ "$(basename $path)" = "rclrs" ]; then
91-
cargo clippy --no-deps --all-targets -F default,dyn_msg -- -D warnings
92-
else
93-
cargo clippy --no-deps --all-targets --all-features -- -D warnings
94-
fi
95-
cd -
96-
done
82+
- name: Run clippy on Rust packages
83+
run: |
84+
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
85+
. /opt/ros/${{ matrix.ros_distribution }}/setup.sh
86+
for path in $(colcon list | awk '$3 == "(ament_cargo)" { print $2 }'); do
87+
cd $path
88+
echo "Running clippy in $path"
89+
# Run clippy for all features except generate_docs (needed for docs.rs)
90+
if [ "$(basename $path)" = "rclrs" ]; then
91+
cargo clippy --no-deps --all-targets -F default,dyn_msg -- -D warnings
92+
else
93+
cargo clippy --no-deps --all-targets --all-features -- -D warnings
94+
fi
95+
cd -
96+
done
9797
98-
- name: Run cargo test on Rust packages
99-
run: |
100-
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
101-
. install/setup.sh
102-
for path in $(colcon list | awk '$3 == "(ament_cargo)" && $1 != "examples_rclrs_minimal_pub_sub" && $1 != "examples_rclrs_minimal_client_service" && $1 != "rust_pubsub" { print $2 }'); do
103-
cd $path
104-
echo "Running cargo test in $path"
105-
# Run cargo test for all features except generate_docs (needed for docs.rs)
106-
if [ "$(basename $path)" = "rclrs" ]; then
107-
cargo test -F default,dyn_msg
108-
elif [ "$(basename $path)" = "rosidl_runtime_rs" ]; then
109-
cargo test -F default
110-
else
111-
cargo test --all-features
112-
fi
113-
cd -
114-
done
98+
- name: Run cargo test on Rust packages
99+
run: |
100+
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
101+
. install/setup.sh
102+
for path in $(colcon list | awk '$3 == "(ament_cargo)" && $1 != "examples_rclrs_minimal_pub_sub" && $1 != "examples_rclrs_minimal_client_service" && $1 != "rust_pubsub" && $1 != "examples_rclrs_minimal_logging" { print $2 }'); do
103+
cd $path
104+
echo "Running cargo test in $path"
105+
# Run cargo test for all features except generate_docs (needed for docs.rs)
106+
if [ "$(basename $path)" = "rclrs" ]; then
107+
cargo test -F default,dyn_msg
108+
elif [ "$(basename $path)" = "rosidl_runtime_rs" ]; then
109+
cargo test -F default
110+
else
111+
cargo test --all-features
112+
fi
113+
cd -
114+
done
115115
116-
- name: Rustdoc check
117-
run: |
118-
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
119-
. /opt/ros/${{ matrix.ros_distribution }}/setup.sh
120-
for path in $(colcon list | awk '$3 == "(ament_cargo)" && $1 != "examples_rclrs_minimal_pub_sub" && $1 != "examples_rclrs_minimal_client_service" && $1 != "rust_pubsub" { print $2 }'); do
121-
cd $path
122-
echo "Running rustdoc check in $path"
123-
cargo rustdoc -- -D warnings
124-
cd -
125-
done
116+
- name: Rustdoc check
117+
run: |
118+
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
119+
. /opt/ros/${{ matrix.ros_distribution }}/setup.sh
120+
for path in $(colcon list | awk '$3 == "(ament_cargo)" && $1 != "examples_rclrs_minimal_pub_sub" && $1 != "examples_rclrs_minimal_client_service" && $1 != "rust_pubsub" && $1 != "examples_rclrs_minimal_logging" { print $2 }'); do
121+
cd $path
122+
echo "Running rustdoc check in $path"
123+
cargo rustdoc -- -D warnings
124+
cd -
125+
done

.github/workflows/rust-stable.yml

+82-82
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ name: Rust Stable
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88
schedule:
99
# Run the CI at 02:22 UTC every Tuesday
1010
# We pick an arbitrary time outside of most of the world's work hours
1111
# to minimize the likelihood of running alongside a heavy workload.
12-
- cron: '22 2 * * 2'
12+
- cron: "22 2 * * 2"
1313

1414
env:
1515
CARGO_TERM_COLOR: always
@@ -35,91 +35,91 @@ jobs:
3535
container:
3636
image: ${{ matrix.docker_image }}
3737
steps:
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v4
3939

40-
- name: Search packages in this repository
41-
id: list_packages
42-
run: |
43-
{
44-
echo 'package_list<<EOF'
45-
colcon list --names-only
46-
echo EOF
47-
} >> "$GITHUB_OUTPUT"
40+
- name: Search packages in this repository
41+
id: list_packages
42+
run: |
43+
{
44+
echo 'package_list<<EOF'
45+
colcon list --names-only
46+
echo EOF
47+
} >> "$GITHUB_OUTPUT"
4848
49-
- name: Setup ROS environment
50-
uses: ros-tooling/[email protected]
51-
with:
52-
required-ros-distributions: ${{ matrix.ros_distribution }}
53-
use-ros2-testing: ${{ matrix.ros_distribution == 'rolling' }}
49+
- name: Setup ROS environment
50+
uses: ros-tooling/[email protected]
51+
with:
52+
required-ros-distributions: ${{ matrix.ros_distribution }}
53+
use-ros2-testing: ${{ matrix.ros_distribution == 'rolling' }}
5454

55-
- name: Setup Rust
56-
uses: dtolnay/rust-toolchain@stable
57-
with:
58-
components: clippy, rustfmt
55+
- name: Setup Rust
56+
uses: dtolnay/rust-toolchain@stable
57+
with:
58+
components: clippy, rustfmt
5959

60-
- name: Install colcon-cargo and colcon-ros-cargo
61-
run: |
62-
sudo pip3 install git+https://github.com/colcon/colcon-cargo.git
63-
sudo pip3 install git+https://github.com/colcon/colcon-ros-cargo.git
60+
- name: Install colcon-cargo and colcon-ros-cargo
61+
run: |
62+
sudo pip3 install git+https://github.com/colcon/colcon-cargo.git
63+
sudo pip3 install git+https://github.com/colcon/colcon-ros-cargo.git
6464
65-
- name: Check formatting of Rust packages
66-
run: |
67-
for path in $(colcon list | awk '$3 == "(ament_cargo)" { print $2 }'); do
68-
cd $path
69-
rustup toolchain install nightly
70-
cargo +nightly fmt -- --check
71-
cd -
72-
done
65+
- name: Check formatting of Rust packages
66+
run: |
67+
for path in $(colcon list | awk '$3 == "(ament_cargo)" { print $2 }'); do
68+
cd $path
69+
rustup toolchain install nightly
70+
cargo +nightly fmt -- --check
71+
cd -
72+
done
7373
74-
- name: Build and test
75-
id: build
76-
uses: ros-tooling/[email protected]
77-
with:
78-
package-name: ${{ steps.list_packages.outputs.package_list }}
79-
target-ros2-distro: ${{ matrix.ros_distribution }}
80-
vcs-repo-file-url: ros2_rust_${{ matrix.ros_distribution }}.repos
74+
- name: Build and test
75+
id: build
76+
uses: ros-tooling/[email protected]
77+
with:
78+
package-name: ${{ steps.list_packages.outputs.package_list }}
79+
target-ros2-distro: ${{ matrix.ros_distribution }}
80+
vcs-repo-file-url: ros2_rust_${{ matrix.ros_distribution }}.repos
8181

82-
- name: Run clippy on Rust packages
83-
run: |
84-
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
85-
. /opt/ros/${{ matrix.ros_distribution }}/setup.sh
86-
for path in $(colcon list | awk '$3 == "(ament_cargo)" { print $2 }'); do
87-
cd $path
88-
echo "Running clippy in $path"
89-
# Run clippy for all features except generate_docs (needed for docs.rs)
90-
if [ "$(basename $path)" = "rclrs" ]; then
91-
cargo clippy --no-deps --all-targets -F default,dyn_msg -- -D warnings
92-
else
93-
cargo clippy --no-deps --all-targets --all-features -- -D warnings
94-
fi
95-
cd -
96-
done
82+
- name: Run clippy on Rust packages
83+
run: |
84+
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
85+
. /opt/ros/${{ matrix.ros_distribution }}/setup.sh
86+
for path in $(colcon list | awk '$3 == "(ament_cargo)" { print $2 }'); do
87+
cd $path
88+
echo "Running clippy in $path"
89+
# Run clippy for all features except generate_docs (needed for docs.rs)
90+
if [ "$(basename $path)" = "rclrs" ]; then
91+
cargo clippy --no-deps --all-targets -F default,dyn_msg -- -D warnings
92+
else
93+
cargo clippy --no-deps --all-targets --all-features -- -D warnings
94+
fi
95+
cd -
96+
done
9797
98-
- name: Run cargo test on Rust packages
99-
run: |
100-
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
101-
. install/setup.sh
102-
for path in $(colcon list | awk '$3 == "(ament_cargo)" && $1 != "examples_rclrs_minimal_pub_sub" && $1 != "examples_rclrs_minimal_client_service" && $1 != "rust_pubsub" { print $2 }'); do
103-
cd $path
104-
echo "Running cargo test in $path"
105-
# Run cargo test for all features except generate_docs (needed for docs.rs)
106-
if [ "$(basename $path)" = "rclrs" ]; then
107-
cargo test -F default,dyn_msg
108-
elif [ "$(basename $path)" = "rosidl_runtime_rs" ]; then
109-
cargo test -F default
110-
else
111-
cargo test --all-features
112-
fi
113-
cd -
114-
done
98+
- name: Run cargo test on Rust packages
99+
run: |
100+
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
101+
. install/setup.sh
102+
for path in $(colcon list | awk '$3 == "(ament_cargo)" && $1 != "examples_rclrs_minimal_pub_sub" && $1 != "examples_rclrs_minimal_client_service" && $1 != "rust_pubsub" && $1 != "examples_rclrs_minimal_logging" { print $2 }'); do
103+
cd $path
104+
echo "Running cargo test in $path"
105+
# Run cargo test for all features except generate_docs (needed for docs.rs)
106+
if [ "$(basename $path)" = "rclrs" ]; then
107+
cargo test -F default,dyn_msg
108+
elif [ "$(basename $path)" = "rosidl_runtime_rs" ]; then
109+
cargo test -F default
110+
else
111+
cargo test --all-features
112+
fi
113+
cd -
114+
done
115115
116-
- name: Rustdoc check
117-
run: |
118-
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
119-
. /opt/ros/${{ matrix.ros_distribution }}/setup.sh
120-
for path in $(colcon list | awk '$3 == "(ament_cargo)" && $1 != "examples_rclrs_minimal_pub_sub" && $1 != "examples_rclrs_minimal_client_service" && $1 != "rust_pubsub" { print $2 }'); do
121-
cd $path
122-
echo "Running rustdoc check in $path"
123-
cargo rustdoc -- -D warnings
124-
cd -
125-
done
116+
- name: Rustdoc check
117+
run: |
118+
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
119+
. /opt/ros/${{ matrix.ros_distribution }}/setup.sh
120+
for path in $(colcon list | awk '$3 == "(ament_cargo)" && $1 != "examples_rclrs_minimal_pub_sub" && $1 != "examples_rclrs_minimal_client_service" && $1 != "rust_pubsub" && $1 != "examples_rclrs_minimal_logging" { print $2 }'); do
121+
cd $path
122+
echo "Running rustdoc check in $path"
123+
cargo rustdoc -- -D warnings
124+
cd -
125+
done

0 commit comments

Comments
 (0)