diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index a0391a4..d923697 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -1,2 +1,7 @@ - name: Code Coverage Summary - uses: irongut/CodeCoverageSummary@v1.3.0 \ No newline at end of file + uses: irongut/CodeCoverageSummary@v1.3.0 + + 'on': + push: + branches: [ "master" ] + tags: '*' \ No newline at end of file diff --git a/rust/Cargo.lock b/rust/Cargo.lock index c2f5612..66e2300 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -769,7 +769,7 @@ dependencies = [ [[package]] name = "render_cdk" -version = "0.0.3" +version = "0.0.4" dependencies = [ "anyhow", "base64", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index e88172c..c1142ee 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "render_cdk" -version = "0.0.3" +version = "0.0.4" edition = "2021" authors = ["Irfan Ghat"] description = "This crate provides a streamlined interface for interacting with Render, a platform that allows you to build, deploy, and scale your apps with ease." diff --git a/rust/README.md b/rust/README.md index 1ca5bec..5afbabb 100644 --- a/rust/README.md +++ b/rust/README.md @@ -24,7 +24,7 @@ Add `render_cdk` to your `Cargo.toml`: ```toml [dependencies] -render_cdk = "0.0.1" +render_cdk = "0.0.4" ``` ### Usage diff --git a/rust/src/main.rs b/rust/src/main.rs index 160033d..6ab77c5 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -7,17 +7,21 @@ use tokio::main; /// Examples #[main] async fn main() { + /// Examples + /// 1. Querying for deployed Services. + /// /// List all Services. let services = ServiceManager::list_all_services("20").await; - // List all Services by Name and Type. + /// List all Services by Name and Type. let services = ServiceManager::find_service_by_name_and_type("whoami", "web_service").await; - // List all Services by Region. + /// List all Services by Region. let services = ServiceManager::find_service_by_region("oregon", "10").await; - // List all Services by Environment. + /// List all Services by Environment. let services = ServiceManager::find_service_by_environment("image", "10").await; + //////////////////////////////////////////////// } /// Checks for regression of service management functions @@ -48,6 +52,7 @@ async fn main() { /// let services = result.unwrap(); /// assert!(!services.is_empty()); /// } +/// /// More tests... #[cfg(test)] @@ -86,4 +91,16 @@ mod tests { let services = result.unwrap(); assert!(!services.is_empty()); } + + #[tokio::test] + async fn test_find_service_by_environment() { + let result = ServiceManager::find_service_by_environment("image", "10").await; + + // The reult should be Ok(). + assert!(result.is_ok()); + + // Validate data. + let services = result.unwrap(); + assert!(!services.is_empty()); + } }