Skip to content

Commit

Permalink
chore: example test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyko committed Sep 4, 2023
1 parent c98c251 commit 9b679fd
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Test The Example

on:
push:
pull_request:

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

jobs:
run:
name: Run
runs-on: ubuntu-latest
services:
scylla:
image: scylladb/scylla:5.1
volumes:
- ./init.cql:/init.cql
ports:
- 9042:9042
options: >-
--health-cmd "[ $$(nodetool statusgossip) = running ]"
--health-interval 5s
--health-timeout 10s
--health-retries 10
steps:
- uses: actions/checkout@v3

- name: Cache Cargo
uses: Swatinem/rust-cache@v1

- uses: r7kamura/rust-problem-matchers@v1

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Apply init.cql
run: cqlsh scylla -f /init.cql

- name: Run Example
env:
RUST_LOG: debug
SCYLLA_NODES: scylla:9042
SCYLLA_DEFAULT_KEYSPACE: scyllax
run: cargo run --release -p scyllax-example
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
image: scylladb/scylla:latest
volumes:
- scylla_storage:/var/lib/scylla
- ./init.cql:/init.cql
command:
- --smp 1
ports:
Expand Down
1 change: 1 addition & 0 deletions example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ async fn main() -> anyhow::Result<()> {
let known_nodes = std::env::var("SCYLLA_NODES").unwrap_or_else(|_| String::new());
let known_nodes = known_nodes.split(',').collect::<Vec<_>>();
let default_keyspace = std::env::var("SCYLLA_DEFAULT_KEYSPACE").ok();

let session = create_session(known_nodes, default_keyspace).await?;
let executor = Executor::with_session(session);

Expand Down

0 comments on commit 9b679fd

Please sign in to comment.