Skip to content

Commit

Permalink
Merge pull request #1357 from deeptools/action_cargotest
Browse files Browse the repository at this point in the history
Action cargotest
  • Loading branch information
WardDeb authored Jan 20, 2025
2 parents c06aae7 + 7b6dadb commit 6795ad7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/cargo_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Cargo
on: [push, pull_request]

jobs:
cargo_test:
name: run cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- name: cargo build
run: cargo build --verbose
- name: cargo test
run: cargo test --verbose
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ mod alignmentsieve;
mod filehandler;
mod normalization;
mod calc;
mod test;

#[pymodule]
fn hp(m: &Bound<'_, PyModule>) -> PyResult<()> {
Expand Down
12 changes: 12 additions & 0 deletions src/test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use crate::calc::median;

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_median() {
let v: Vec<u32> = vec![1,2,3,4,5];
assert_eq!(median(v), 3.0);
}
}

0 comments on commit 6795ad7

Please sign in to comment.