Skip to content

Commit 17209b8

Browse files
authored
Merge pull request #689 from Gor027/serverless_ci
Serverless ci
2 parents 328cc19 + 24fdf87 commit 17209b8

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

.github/workflows/serverless.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Serverless
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Setup Python 2.7
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '2.7'
21+
- name: Install scylla-ccm
22+
run: pip3 install https://github.com/scylladb/scylla-ccm/archive/master.zip
23+
24+
- name: Create serverless cluster
25+
run: |
26+
ccm create serverless -i 127.0.1. -n 1 --scylla -v release:5.1.6
27+
ccm start --sni-proxy --sni-port 7777
28+
29+
- name: Check
30+
run: cargo check --verbose
31+
- name: Run cloud example
32+
run: cargo run --example cloud -- $HOME/.ccm/serverless/config_data.yaml
33+
34+
- name: Remove serverless cluster
35+
run: ccm remove serverless

examples/cloud.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::env;
12
use std::path::Path;
23

34
use anyhow::Result;
@@ -6,8 +7,10 @@ use scylla::CloudSessionBuilder;
67
#[tokio::main]
78
async fn main() -> Result<()> {
89
println!("Connecting to SNI proxy as described in cloud config yaml ...");
9-
10-
let session = CloudSessionBuilder::new(Path::new("examples/config_data.yaml"))
10+
let config_path = env::args()
11+
.nth(1)
12+
.unwrap_or("examples/config_data.yaml".to_owned());
13+
let session = CloudSessionBuilder::new(Path::new(&config_path))
1114
.unwrap()
1215
.build()
1316
.await

0 commit comments

Comments
 (0)