From 4a126e8a9c52ac2fd0bb46cae57afa3f1cb44fd6 Mon Sep 17 00:00:00 2001 From: michael-grunder Date: Wed, 13 Oct 2021 12:15:54 -0700 Subject: [PATCH] Add valgrind and CMake to tests --- .github/workflows/build.yml | 61 ++++++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25d4fa39e..a7877004d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,18 +11,33 @@ jobs: repository: ${{ env.GITHUB_REPOSITORY }} ref: ${{ env.GITHUB_HEAD_REF }} - - name: Install redis-server + - name: Install dependencies run: | sudo add-apt-repository -y ppa:chris-lea/redis-server sudo apt-get update - sudo apt-get install -y redis-server - - - name: Build hiredis + sudo apt-get install -y redis-server valgrind + + - name: Build using cmake + env: + EXTRA_CMAKE_OPTS: -DENABLE_EXAMPLES:BOOL=ON -DENABLE_SSL:BOOL=ON -DENABLE_SSL_TESTS:BOOL=ON + CFLAGS: -Werror + CXXFLAGS: -Werror + run: mkdir build-ubuntu && cd build-ubuntu && cmake .. + + - name: Build using makefile run: USE_SSL=1 make - name: Run tests + env: + SKIPS_AS_FAILS: 1 run: $GITHUB_WORKSPACE/test.sh + # - name: Run tests under valgrind + # env: + # SKIPS_AS_FAILS: 1 + # TEST_PREFIX: valgrind --track-origins=yes --leak-check=full + # run: $GITHUB_WORKSPACE/test.sh + centos7: runs-on: ubuntu-latest container: centos:7 @@ -37,12 +52,27 @@ jobs: run: | yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm yum -y --enablerepo=remi install redis - yum -y install gcc make openssl-devel + yum -y install gcc gcc-c++ make openssl-devel cmake3 valgrind - - name: Build hiredis + - name: Build using cmake + env: + EXTRA_CMAKE_OPTS: -DENABLE_EXAMPLES:BOOL=ON -DENABLE_SSL:BOOL=ON -DENABLE_SSL_TESTS:BOOL=ON + CFLAGS: -Werror + CXXFLAGS: -Werror + run: mkdir build-centos7 && cd build-centos7 && cmake3 .. + + - name: Build using Makefile run: USE_SSL=1 make - name: Run tests + env: + SKIPS_AS_FAILS: 1 + run: $GITHUB_WORKSPACE/test.sh + + - name: Run tests under valgrind + env: + SKIPS_AS_FAILS: 1 + TEST_PREFIX: valgrind --track-origins=yes --leak-check=full run: $GITHUB_WORKSPACE/test.sh centos8: @@ -60,12 +90,27 @@ jobs: dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm dnf -y module install redis:remi-6.0 dnf -y group install "Development Tools" - dnf -y install openssl-devel + dnf -y install openssl-devel cmake valgrind - - name: Build hiredis + - name: Build using cmake + env: + EXTRA_CMAKE_OPTS: -DENABLE_EXAMPLES:BOOL=ON -DENABLE_SSL:BOOL=ON -DENABLE_SSL_TESTS:BOOL=ON + CFLAGS: -Werror + CXXFLAGS: -Werror + run: mkdir build-centos8 && cd build-centos8 && cmake .. + + - name: Build using Makefile run: USE_SSL=1 make - name: Run tests + env: + SKIPS_AS_FAILS: 1 + run: $GITHUB_WORKSPACE/test.sh + + - name: Run tests under valgrind + env: + SKIPS_AS_FAILS: 1 + TEST_PREFIX: valgrind --track-origins=yes --leak-check=full run: $GITHUB_WORKSPACE/test.sh macos: