Skip to content

Commit

Permalink
Update rust.yml github action to test examples/ (gluesql#994)
Browse files Browse the repository at this point in the history
  • Loading branch information
panarch committed Nov 8, 2022
1 parent e4156c0 commit 74eb4e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
profile: minimal
default: true
components: clippy
- run: cargo clippy -- -D warnings
- run: cargo clippy --all-targets -- -D warnings

clippy_core:
name: Clippy (core) - per Powerset Features
Expand Down Expand Up @@ -86,6 +86,7 @@ jobs:
- run: |
cargo run --package gluesql --example hello_world
cargo run --package gluesql --example api_usage
cargo run --package gluesql --example memory_storage_usage
cargo run --package gluesql --example sled_multi_threaded
cargo run --package gluesql --example using_config
Expand Down
15 changes: 10 additions & 5 deletions pkg/rust/examples/memory_storage_usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod api_usage {
let storage = MemoryStorage::default();
let mut glue = Glue::new(storage);

glue.execute("DROP TABLE IF EXISTS api_test");
glue.execute("DROP TABLE IF EXISTS api_test").unwrap();

glue.execute(
"CREATE TABLE api_test (
Expand All @@ -15,7 +15,8 @@ mod api_usage {
nullable TEXT NULL,
is BOOLEAN
)",
);
)
.unwrap();

glue.execute(
"INSERT INTO api_test (
Expand All @@ -26,7 +27,8 @@ mod api_usage {
) VALUES
(1, 'test1', 'not null', TRUE),
(2, 'test2', NULL, FALSE)",
);
)
.unwrap();
}

fn memory_basic_async() {
Expand All @@ -36,7 +38,9 @@ mod api_usage {
let mut glue = Glue::new(storage);

block_on(async {
glue.execute_async("DROP TABLE IF EXISTS api_test").await;
glue.execute_async("DROP TABLE IF EXISTS api_test")
.await
.unwrap();

glue.execute_async(
"CREATE TABLE api_test (
Expand All @@ -46,7 +50,8 @@ mod api_usage {
is BOOLEAN
)",
)
.await;
.await
.unwrap();
});
}

Expand Down

0 comments on commit 74eb4e7

Please sign in to comment.