Skip to content

Commit

Permalink
add rust tests to pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ekneg54 committed Sep 9, 2024
1 parent 40c9b68 commit a8404f9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ on:
workflow_call:

jobs:
rust:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Perform tests for rust modules
run: cargo test
python:
runs-on: ubuntu-22.04
strategy:
Expand Down
10 changes: 2 additions & 8 deletions rust/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#[cfg(test)]
mod tests;
use pyo3::prelude::*;

/// Formats the sum of two numbers as string.
Expand All @@ -12,11 +14,3 @@ fn rust(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(sum_as_string, m)?)?;
Ok(())
}

#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!("4", "4");
}
}
5 changes: 5 additions & 0 deletions rust/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[cfg(test)]
#[test]
fn it_works() {
assert_eq!("4", "4");
}

0 comments on commit a8404f9

Please sign in to comment.