-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (98 loc) · 3.18 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: CI
on:
push:
branches: [main]
paths-ignore: ["**.md"]
pull_request:
paths-ignore: ["**.md"]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
jobs:
check:
name: Check Suite
runs-on: scyllax-runner
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Register Problem Matchers
uses: r7kamura/rust-problem-matchers@v1
- run: rustup toolchain install stable --profile minimal
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install Cargo Make
uses: davidB/rust-cargo-make@v1
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run Formatter
run: cargo make format-ci
- name: Run Clippy
run: cargo make lint-ci
- name: Build
run: cargo build --release --all-features
- name: Run Unit Tests
run: cargo make cov-ci
- name: Upload coverage data to codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: lcov.info
example:
name: Run the example
runs-on: scyllax-runner
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Register Problem Matchers
uses: r7kamura/rust-problem-matchers@v1
- run: rustup toolchain install stable --profile minimal
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup 3-node Scylla cluster
run: |
sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr"
docker pull scylladb/scylla # only pull once
docker compose -f ./test/docker-compose.yml up --wait
- name: Install cqlsh
run: pip install -U cqlsh
- name: Create migration keyspace
env:
CQLSH_HOST: 172.42.0.2
run: cqlsh -f ./test/migration.cql
- name: Run Migrations
env:
RUST_LOG: debug
SCYLLA_NODES: 172.42.0.2,172.42.0.3,172.42.0.4
run: cd test && cargo run -p scyllax-cli -- migrate run
- name: Run Example
env:
RUST_LOG: debug
SCYLLA_NODES: 172.42.0.2,172.42.0.3,172.42.0.4
SCYLLA_DEFAULT_KEYSPACE: scyllax
run: cargo run --bin example
- name: Run Benchmark
env:
RUST_LOG: debug
SCYLLA_NODES: 172.42.0.2,172.42.0.3,172.42.0.4
SCYLLA_DEFAULT_KEYSPACE: scyllax
run: cargo bench -p example
- name: Stop the cluster
if: ${{ always() }}
run: docker compose -f ./test/docker-compose.yml stop
- name: Print the cluster logs
if: ${{ always() }}
run: docker compose -f ./test/docker-compose.yml logs
- name: Remove cluster
run: docker compose -f ./test/docker-compose.yml down