@@ -2,14 +2,14 @@ name: Rust Stable
2
2
3
3
on :
4
4
push :
5
- branches : [ main ]
5
+ branches : [main]
6
6
pull_request :
7
- branches : [ main ]
7
+ branches : [main]
8
8
schedule :
9
9
# Run the CI at 02:22 UTC every Tuesday
10
10
# We pick an arbitrary time outside of most of the world's work hours
11
11
# to minimize the likelihood of running alongside a heavy workload.
12
- - cron : ' 22 2 * * 2'
12
+ - cron : " 22 2 * * 2"
13
13
14
14
env :
15
15
CARGO_TERM_COLOR : always
@@ -35,91 +35,91 @@ jobs:
35
35
container :
36
36
image : ${{ matrix.docker_image }}
37
37
steps :
38
- - uses : actions/checkout@v4
38
+ - uses : actions/checkout@v4
39
39
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"
48
48
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' }}
54
54
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
59
59
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
64
64
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
73
73
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
81
81
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
97
97
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
115
115
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