-
Notifications
You must be signed in to change notification settings - Fork 11
58 lines (58 loc) · 1.74 KB
/
build.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
name: Test and Build
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
FORCE_COLOR: 1
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup 3-node Scylla cluster
run: |
sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr"
docker compose -f test/docker-compose.yml up -d --wait
- name: Create Keyspace
run: |
docker exec scylla1 cqlsh -e \
"CREATE KEYSPACE charybdis WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 2};"
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Update rust toolchain
run: rustup update
- name: Print rustc version
run: rustc --version
- name: Print rustfmt version
run: cargo fmt --version
- name: Print clippy version
run: cargo clippy --version
- name: Format check
run: cargo fmt --verbose -- --check
- name: Clippy check
run: cargo clippy --verbose
- name: Cargo check
run: cargo check --verbose
- name: Build
run: cargo build --verbose
- name: Install Charybdis Migration Tool
run: cargo install --path charybdis-migrate --force
- name: Run Charybdis Migration Tool
run: migrate --keyspace charybdis --host 127.0.0.1:9042 --drop-and-replace
- name: Run tests
run: cargo test --verbose