diff --git a/.woodpecker/check.yml b/.woodpecker/check.yml new file mode 100644 index 0000000..ff1b0ab --- /dev/null +++ b/.woodpecker/check.yml @@ -0,0 +1,20 @@ +when: + - event: pull_request + +steps: + - name: fmt + image: rust:1.84 + commands: + - rustup component add rustfmt + - cargo fmt -- --check + + - name: clippy + image: rust:1.84 + commands: + - rustup component add clippy + - cargo clippy -- -D warnings + + - name: test + image: rust:1.84 + commands: + - cargo test diff --git a/.woodpecker.yml b/.woodpecker/deploy.yml similarity index 100% rename from .woodpecker.yml rename to .woodpecker/deploy.yml diff --git a/src/main.rs b/src/main.rs index e3c81a9..327c364 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,3 +13,14 @@ async fn main() { async fn handler() -> Html<&'static str> { Html("

Mikhail Kilin

") } + +#[cfg(test)] +mod tests { + use super::*; + + #[tokio::test] + async fn test_handler() { + let response = handler().await; + assert!(response.0.contains("Mikhail Kilin")); + } +}