-
Notifications
You must be signed in to change notification settings - Fork 11
125 lines (105 loc) · 3.17 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
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0' # Run every Sunday at midnight UTC
jobs:
build-linux:
strategy:
matrix:
os:
- "ubuntu-20.04"
- "ubuntu-22.04"
- "ubuntu-24.04"
version:
- "5.0"
- "6.0"
- "6.2"
- "7.2"
- "7.4"
- "unstable"
compiler:
- "gcc"
- "clang"
runs-on: ${{ matrix.os }}
env:
DEBIAN_FRONTEND: noninteractive
CC: ${{ matrix.compiler }}
# TODO: would be nice to connect to a redis server instead of building from source
# services:
# redis:
# image: redis:${{ matrix.version }}
# options: >-
# --health-cmd "redis-cli ping"
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
steps:
- name: Checkout librdb
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Clone Redis (${{ matrix.version }})
uses: actions/checkout@v4
with:
repository: redis/redis
ref: ${{ matrix.version }}
path: redis
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get install -y cmake clang libssl-dev git bc
git clone https://git.cryptomilk.org/projects/cmocka.git
cd cmocka
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
make
sudo make install
- name: Test on redis-${{ matrix.version }}
shell: bash
run: |
make -j 4 -C ${{ github.workspace }}/redis
if [ $(bc -l <<< "${{ matrix.version }} >= 6.2") -eq 1 ] || [ "${{ matrix.version }}" = "unstable" ]; then
make -C ${{ github.workspace }}/redis/tests/modules
fi
LIBRDB_REDIS_FOLDER="${{ github.workspace }}/redis/src" make clean debug test example
working-directory: ${{github.workspace}}
build-osx:
strategy:
matrix:
version:
- "5.0"
- "6.0"
- "6.2"
- "7.2"
- "7.4"
- "unstable"
runs-on: "macos-latest"
steps:
- name: Checkout librdb
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Clone Redis (${{ matrix.version }})
uses: actions/checkout@v4
with:
repository: redis/redis
ref: ${{ matrix.version }}
path: redis
- name: Install prerequisites
run: |
brew install cmocka bc llvm grep
- name: Test on redis-${{ matrix.version }}
shell: bash
run: |
export PATH="$(brew --prefix)/opt/grep/libexec/gnubin:${PATH}"
make -j 4 -C ${{ github.workspace }}/redis
if [ $(bc -l <<< "${{ matrix.version }} >= 6.2") -eq 1 ] || [ "${{ matrix.version }}" = "unstable" ]; then
make -C ${{ github.workspace }}/redis/tests/modules
fi
# FIXME NOT WORKING
# LIBRDB_REDIS_FOLDER="${{ github.workspace }}/redis/src"
make clean debug test example
working-directory: ${{github.workspace}}