-
Notifications
You must be signed in to change notification settings - Fork 66
87 lines (73 loc) · 2.35 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
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:
os:
- ubuntu-latest
- macos-latest
redis-version:
- [6-0, "7.2"]
- [6-2, "7.2"]
- [7-0, "7.2"]
- [7-2, "7.2"]
toolchain:
- 1.78.0
- stable
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout redis sources
uses: actions/checkout@v4
with:
submodules: recursive
repository: redis/redis
ref: ${{ matrix.redis-version[1] }}
path: redis
- name: Install redis
run: |
export HOMEBREW_NO_AUTO_UPDATE=1
cd redis
make -j
./src/redis-server --version
make install PREFIX=/usr/local
redis-server --version
- 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
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --no-default-features --features min-redis-compatibility-version-${{ matrix.redis-version[0] }}
- name: Build debug
run: cargo build --no-default-features --features min-redis-compatibility-version-${{ matrix.redis-version[0] }}
- name: Build release
run: cargo build --release --no-default-features --features min-redis-compatibility-version-${{ matrix.redis-version[0] }}
- name: Test
run: cargo test --no-default-features --features min-redis-compatibility-version-${{ matrix.redis-version[0] }}
- name: Doc
run: cargo doc --all-features