forked from phpredis/phpredis
-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (156 loc) · 6.24 KB
/
Copy pathci.yml
File metadata and controls
159 lines (156 loc) · 6.24 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
on: [push, pull_request]
jobs:
ubuntu:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1', '8.2']
experimental: [false]
include:
- php: '8.2'
experimental: true
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, igbinary, msgpack, :redis
coverage: none
tools: none
- name: Install dependencies
run: |
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update
sudo apt-get install redis valgrind libzstd-dev liblz4-dev
- name: Build phpredis
run: |
phpize
./configure --enable-redis-lzf --enable-redis-zstd --enable-redis-igbinary --enable-redis-msgpack --enable-redis-lz4 --with-liblz4
sudo make -j"$(nproc)" install
echo 'extension = redis.so' | sudo tee -a "$(php --ini | grep 'Scan for additional .ini files' | awk '{print $7}')"/90-redis.ini
- name: Start redis
run: |
redis-cli SHUTDOWN NOSAVE
for PORT in $(seq 6379 6382) $(seq 32767 32769); do
redis-server --port "$PORT" --daemonize yes --aclfile tests/users.acl --acl-pubsub-default allchannels
done
redis-server --port 0 --unixsocket /tmp/redis.sock --daemonize yes --aclfile tests/users.acl --acl-pubsub-default allchannels
- name: Start redis cluster
run: |
mkdir -p tests/nodes
echo -n > tests/nodes/nodemap
for PORT in $(seq 7000 7005); do
redis-server --port "$PORT" --cluster-enabled yes --cluster-config-file "$PORT".conf --daemonize yes --aclfile tests/users.acl --acl-pubsub-default allchannels
echo 127.0.0.1:"$PORT" >> tests/nodes/nodemap
done
echo yes | redis-cli --cluster create $(seq -f 127.0.0.1:%g 7000 7005) --cluster-replicas 1 --user phpredis -a phpredis
- name: Start redis sentinel
run: |
wget raw.githubusercontent.com/redis/redis/7.0/sentinel.conf
for PORT in $(seq 26379 26380); do
cp sentinel.conf "$PORT.conf"
sed -i '/^sentinel/Id' "$PORT.conf"
redis-server "$PORT.conf" --port "$PORT" --daemonize yes --sentinel monitor mymaster 127.0.0.1 6379 1 --sentinel auth-pass mymaster phpredis
done
- name: Run tests
run: |
php tests/TestRedis.php --class Redis --user phpredis --auth phpredis
php tests/TestRedis.php --class RedisArray --user phpredis --auth phpredis
php tests/TestRedis.php --class RedisCluster --user phpredis --auth phpredis
php tests/TestRedis.php --class RedisSentinel --auth phpredis
env:
TEST_PHP_ARGS: -e
- name: Run tests using valgrind
continue-on-error: true
run: |
valgrind --suppressions=tests/vg.supp --error-exitcode=1 php tests/TestRedis.php --class Redis --user phpredis --auth phpredis
valgrind --suppressions=tests/vg.supp --error-exitcode=1 php tests/TestRedis.php --class RedisArray --user phpredis --auth phpredis
valgrind --suppressions=tests/vg.supp --error-exitcode=1 php tests/TestRedis.php --class RedisCluster --user phpredis --auth phpredis
valgrind --suppressions=tests/vg.supp --error-exitcode=1 php tests/TestRedis.php --class RedisSentinel --auth phpredis
env:
TEST_PHP_ARGS: -e
USE_ZEND_ALLOC: 0
macos:
runs-on: macos-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1', '8.2']
experimental: [false]
include:
- php: '8.2'
experimental: true
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, :redis
coverage: none
tools: none
- name: Install dependencies
run: |
pecl install igbinary
pecl install msgpack
- name: Build phpredis
run: |
phpize
./configure --enable-redis-lzf --enable-redis-zstd --enable-redis-igbinary --enable-redis-msgpack --enable-redis-lz4 --with-liblz4
sudo make install
echo 'extension = redis.so' | sudo tee -a "$(php --ini | grep 'Scan for additional .ini files' | awk '{print $7}')/90-redis.ini"
windows:
runs-on: windows-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1', '8.2']
experimental: [false]
include:
- php: '8.2'
experimental: true
ts: [nts, ts]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install PHP ${{ matrix.php }}
uses: cmb69/setup-php-sdk@v0.6
id: setup-php-sdk
with:
version: ${{ matrix.php }}
arch: x64
ts: ${{matrix.ts}}
- name: Install dependencies
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
toolset: ${{steps.setup-php-sdk.outputs.toolset}}
- name: Build phpredis
run: |
phpize
./configure --enable-redis --with-prefix=${{steps.setup-php-sdk.outputs.prefix}}
nmake
- name: package
run: |
md binaries
copy LICENSE binaries
Get-ChildItem -Recurse -Filter "php_redis.dll" | ForEach-Object {Copy-Item -Path $_.FullName -Destination "binaries"}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: redis-${{matrix.php}}-x64-${{matrix.ts}}
path: binaries