-
Notifications
You must be signed in to change notification settings - Fork 66
74 lines (63 loc) · 1.95 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
name: CI
on: [pull_request]
jobs:
test:
name: Build and run the unit tests using the latest rust.
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name:
- stable
os:
- ubuntu-latest
- macos-latest
redis-version:
- 6-0
- 6-2
- 7-0
- 7-2
toolchain:
- 1.78.0
- stable
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install toolchain
id: tc
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
components: rustfmt, clippy
- name: Setup cache
if: runner.os != 'macOS'
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-test-${{ steps.tc.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.toml') }}
- name: Format and clippy
run: |
cargo fmt --all -- --check
cargo clippy --all-targets --all-features
- name: Install redis
run: |
export HOMEBREW_NO_AUTO_UPDATE=1
./deps/readies/bin/getredis -v '${{ matrix.redis-version }}' --force ''
redis-server --version
- name: Build debug
run: cargo build --no-default-features --features min-redis-compatibility-version-${{ matrix.redis-version }}
- name: Build release
run: cargo build --release --no-default-features --features min-redis-compatibility-version-${{ matrix.redis-version }}
- name: Test
run: cargo test --no-default-features --features min-redis-compatibility-version-${{ matrix.redis-version }}
- name: Doc
run: cargo doc --all-features