Skip to content

Commit fcb45e5

Browse files
committed
ci: skip valgrind on version matrix
1 parent 6eeea76 commit fcb45e5

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ jobs:
4141
run: sudo apt-get install valgrind
4242
- name: Test
4343
run: ./test.sh
44+
env:
45+
USE_VALGRIND: "0"
4446

4547
coverage:
4648
name: Generate and upload coverage

test.sh

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -eu
55
. ./tests/helper.sh
66

77
function unit() {
8-
if [[ "$OSTYPE" == "darwin"* ]]; then
8+
if [[ "${USE_VALGRIND:-1}" != "1" ]] || [[ "$OSTYPE" == "darwin"* ]]; then
99
./build/unit
1010
else
1111
valgrind --leak-check=full --error-exitcode=1 ./build/unit
@@ -17,26 +17,42 @@ function unit() {
1717
function integration_1() {
1818
stop_redis
1919
rm dump.rdb 2>/dev/null || true
20-
start_redis --valgrind
20+
if [[ "${USE_VALGRIND:-1}" == "1" ]]; then
21+
start_redis --valgrind
22+
else
23+
start_redis
24+
fi
2125
./tests/integration_1.sh
2226
stop_redis
2327
echo "All integration (1) tests passed"
2428
}
2529

2630
function integration_2() {
2731
stop_redis
28-
start_redis --valgrind --aof
32+
if [[ "${USE_VALGRIND:-1}" == "1" ]]; then
33+
start_redis --valgrind --aof
34+
else
35+
start_redis --aof
36+
fi
2937
./tests/integration_1.sh
3038
stop_redis
3139

3240
# Test RDB load
33-
start_redis --valgrind
41+
if [[ "${USE_VALGRIND:-1}" == "1" ]]; then
42+
start_redis --valgrind
43+
else
44+
start_redis
45+
fi
3446
./tests/integration_2.sh
3547
stop_redis
3648
rm dump.rdb 2>/dev/null || true
3749

3850
# Test AOF load
39-
start_redis --valgrind --aof
51+
if [[ "${USE_VALGRIND:-1}" == "1" ]]; then
52+
start_redis --valgrind --aof
53+
else
54+
start_redis --aof
55+
fi
4056
./tests/integration_2.sh
4157
stop_redis
4258
rm appendonly.aof 2>/dev/null || true
@@ -47,7 +63,11 @@ function integration_2() {
4763
function integration_3() {
4864
stop_redis
4965
rm dump.rdb 2>/dev/null || true
50-
start_redis --valgrind
66+
if [[ "${USE_VALGRIND:-1}" == "1" ]]; then
67+
start_redis --valgrind
68+
else
69+
start_redis
70+
fi
5171
./tests/integration_3.sh
5272
stop_redis
5373
echo "All integration (3) tests passed"

0 commit comments

Comments
 (0)