-
Notifications
You must be signed in to change notification settings - Fork 110
108 lines (103 loc) · 4.32 KB
/
rust.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
name: Rust
on:
push:
branches:
- main
- 'branch-*'
pull_request:
branches:
- main
- 'branch-*'
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: full
rust_min: 1.70.0 # <- Update this when bumping up MSRV
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- name: Setup 3-node Scylla cluster
run: |
sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr"
docker compose -f test/cluster/docker-compose.yml up -d --wait
- 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 --all -- --check
- name: Clippy check
run: cargo clippy --verbose --all-targets
- name: Clippy check with all features
run: cargo clippy --verbose --all-targets --all-features
- name: Cargo check with cpp_rust_unstable cfg
run: RUSTFLAGS="--cfg cpp_rust_unstable" cargo clippy --verbose --all-targets --all-features
- name: Cargo check without features
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features ""
- name: Cargo check with all serialization features
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "full-serialization"
- name: Cargo check with all features
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --all-features
- name: Cargo check with secrecy-08 feature
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "secrecy-08"
- name: Cargo check with chrono-04 feature
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "chrono-04"
- name: Cargo check with time-03 feature
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "time-03"
- name: Cargo check with num-bigint-03 feature
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "num-bigint-03"
- name: Cargo check with num-bigint-04 feature
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "num-bigint-04"
- name: Cargo check with bigdecimal-04 feature
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "bigdecimal-04"
- name: Build scylla-cql
run: cargo build --verbose --all-targets --manifest-path "scylla-cql/Cargo.toml" --features "full-serialization"
- name: Build
run: cargo build --verbose --all-targets --features "full-serialization"
- name: Run tests
run: |
cargo clean
RUST_LOG=trace SCYLLA_URI=172.42.0.2:9042 SCYLLA_URI2=172.42.0.3:9042 SCYLLA_URI3=172.42.0.4:9042 cargo test --verbose --features "full-serialization"
- name: Stop the cluster
if: ${{ always() }}
run: docker compose -f test/cluster/docker-compose.yml stop
- name: Print the cluster logs
if: ${{ always() }}
run: docker compose -f test/cluster/docker-compose.yml logs
- name: Remove cluster
run: docker compose -f test/cluster/docker-compose.yml down
# Tests that our current minimum supported rust version compiles everything sucessfully
min_rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_min }}
run: |
rustup install ${{ env.rust_min }}
rustup override set ${{ env.rust_min }}
- name: Print Rust version
run: rustc --version
- name: Use MSRV Cargo.lock
run: mv Cargo.lock.msrv Cargo.lock
- name: MSRV cargo check with features
run: cargo check --verbose --all-targets --all-features --locked
- name: MSRV cargo check without features
run: cargo check --verbose --all-targets --locked --manifest-path "scylla/Cargo.toml"
- name: MSRV cargo check scylla-cql
run: cargo check --verbose --all-targets --locked --manifest-path "scylla-cql/Cargo.toml"
# Tests that docstrings generate docs without warnings
cargo_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update rust toolchain
run: rustup update
- name: Compile docs
run: RUSTDOCFLAGS=-Dwarnings cargo doc