Skip to content

Commit ef37f90

Browse files
committed
Add CI
Signed-off-by: Esteve Fernandez <[email protected]>
1 parent 4871830 commit ef37f90

File tree

5 files changed

+33
-18
lines changed

5 files changed

+33
-18
lines changed

.github/workflows/rust.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Build
20+
run: cargo build --verbose
21+
- name: Run tests
22+
run: cargo test --verbose

Cargo.toml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,8 @@ edition = "2021"
66
license = "Apache-2.0"
77
description = "Parser for ROS .msg files"
88

9-
[lib]
10-
path = "src/lib.rs"
11-
12-
# Please keep the list of dependencies alphabetically sorted,
13-
# and also state why each dependency is needed.
149
[dependencies]
10+
ament_rs = "0.3.0"
11+
anyhow = "1.0.98"
12+
regex = "1.11.1"
1513

16-
[features]
17-
default = []
18-
19-
[dev-dependencies]
20-
21-
[build-dependencies]

src/field.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::ros_introspection::Type;
1+
use crate::r#type::Type;
22
use anyhow::Result;
33
use regex::Regex;
44
use std::str::FromStr;
@@ -205,7 +205,7 @@ impl Field {
205205
#[cfg(test)]
206206
mod tests {
207207
use super::*;
208-
use crate::ros_introspection::Type;
208+
use crate::field::Type;
209209

210210
#[test]
211211
fn test_new_with_type() {

src/message.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use std::sync::Arc;
33
use anyhow::{anyhow, Error};
44
use regex::Regex;
55

6-
use crate::ros_introspection::Field;
7-
use crate::ros_introspection::Type;
6+
use crate::field::Field;
7+
use crate::r#type::Type;
88

99
#[derive(Debug, Clone)]
1010
pub struct Message {
@@ -203,7 +203,7 @@ pub fn parse_message_definitions(
203203
#[cfg(test)]
204204
mod tests {
205205
use super::*;
206-
use crate::ros_introspection::Type;
206+
use crate::r#type::Type;
207207

208208
#[test]
209209
fn test_new() -> Result<(), Error> {

src/msgspec.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
use crate::ros_introspection::{self, BuiltinType, Message, Type};
1+
use crate::message::Message;
2+
use crate::r#type::{BuiltinType, Type};
23
use anyhow::{anyhow, Error, Result};
34
use std::fs;
45
use std::sync::Arc;
@@ -101,7 +102,7 @@ impl MsgSpec {
101102

102103
let contents = fs::read_to_string(msg_file_path)?;
103104

104-
let msg_parsed = ros_introspection::parse_message_definitions(&contents, &message_type)?;
105+
let msg_parsed = crate::parse_message_definitions(&contents, &message_type)?;
105106

106107
let msg_def = Arc::clone(&msg_parsed[0]);
107108
Ok(msg_def)

0 commit comments

Comments
 (0)