Asynchronous testcases that requires the event library `libevent` can be built and enabled by using the added build flags: - ENABLE_ASYNC_TESTS when using CMake - TEST_ASYNC when using Make The async tests are disabled by default to avoid adding new requirements, but the testcases are built and run in CI.
183 lines
5.2 KiB
YAML
183 lines
5.2 KiB
YAML
name: Build and test
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
ubuntu:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: ${{ env.GITHUB_REPOSITORY }}
|
|
ref: ${{ env.GITHUB_HEAD_REF }}
|
|
|
|
- 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 valgrind libevent-dev
|
|
|
|
- name: Build using cmake
|
|
env:
|
|
EXTRA_CMAKE_OPTS: -DENABLE_EXAMPLES:BOOL=ON -DENABLE_SSL:BOOL=ON -DENABLE_SSL_TESTS:BOOL=ON -DENABLE_ASYNC_TESTS:BOOL=ON
|
|
CFLAGS: -Werror
|
|
CXXFLAGS: -Werror
|
|
run: mkdir build-ubuntu && cd build-ubuntu && cmake ..
|
|
|
|
- name: Build using makefile
|
|
run: USE_SSL=1 TEST_ASYNC=1 make
|
|
|
|
- name: Run tests
|
|
env:
|
|
SKIPS_AS_FAILS: 1
|
|
TEST_SSL: 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
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: ${{ env.GITHUB_REPOSITORY }}
|
|
ref: ${{ env.GITHUB_HEAD_REF }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
|
|
yum -y --enablerepo=remi install redis
|
|
yum -y install gcc gcc-c++ make openssl openssl-devel cmake3 valgrind libevent-devel
|
|
|
|
- name: Build using cmake
|
|
env:
|
|
EXTRA_CMAKE_OPTS: -DENABLE_EXAMPLES:BOOL=ON -DENABLE_SSL:BOOL=ON -DENABLE_SSL_TESTS:BOOL=ON -DENABLE_ASYNC_TESTS:BOOL=ON
|
|
CFLAGS: -Werror
|
|
CXXFLAGS: -Werror
|
|
run: mkdir build-centos7 && cd build-centos7 && cmake3 ..
|
|
|
|
- name: Build using Makefile
|
|
run: USE_SSL=1 TEST_ASYNC=1 make
|
|
|
|
- name: Run tests
|
|
env:
|
|
SKIPS_AS_FAILS: 1
|
|
TEST_SSL: 1
|
|
run: $GITHUB_WORKSPACE/test.sh
|
|
|
|
- name: Run tests under valgrind
|
|
env:
|
|
SKIPS_AS_FAILS: 1
|
|
TEST_SSL: 1
|
|
TEST_PREFIX: valgrind --track-origins=yes --leak-check=full
|
|
run: $GITHUB_WORKSPACE/test.sh
|
|
|
|
centos8:
|
|
runs-on: ubuntu-latest
|
|
container: centos:8
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: ${{ env.GITHUB_REPOSITORY }}
|
|
ref: ${{ env.GITHUB_HEAD_REF }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
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 cmake valgrind libevent-devel
|
|
|
|
- name: Build using cmake
|
|
env:
|
|
EXTRA_CMAKE_OPTS: -DENABLE_EXAMPLES:BOOL=ON -DENABLE_SSL:BOOL=ON -DENABLE_SSL_TESTS:BOOL=ON -DENABLE_ASYNC_TESTS:BOOL=ON
|
|
CFLAGS: -Werror
|
|
CXXFLAGS: -Werror
|
|
run: mkdir build-centos8 && cd build-centos8 && cmake ..
|
|
|
|
- name: Build using Makefile
|
|
run: USE_SSL=1 TEST_ASYNC=1 make
|
|
|
|
- name: Run tests
|
|
env:
|
|
SKIPS_AS_FAILS: 1
|
|
TEST_SSL: 1
|
|
run: $GITHUB_WORKSPACE/test.sh
|
|
|
|
- name: Run tests under valgrind
|
|
env:
|
|
SKIPS_AS_FAILS: 1
|
|
TEST_SSL: 1
|
|
TEST_PREFIX: valgrind --track-origins=yes --leak-check=full
|
|
run: $GITHUB_WORKSPACE/test.sh
|
|
|
|
macos:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: ${{ env.GITHUB_REPOSITORY }}
|
|
ref: ${{ env.GITHUB_HEAD_REF }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
brew install openssl redis
|
|
|
|
- name: Build hiredis
|
|
run: USE_SSL=1 make
|
|
|
|
- name: Run tests
|
|
env:
|
|
TEST_SSL: 1
|
|
run: $GITHUB_WORKSPACE/test.sh
|
|
|
|
windows:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: ${{ env.GITHUB_REPOSITORY }}
|
|
ref: ${{ env.GITHUB_HEAD_REF }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
choco install -y ninja memurai-developer
|
|
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
|
- name: Build hiredis
|
|
run: |
|
|
mkdir build && cd build
|
|
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_EXAMPLES=ON
|
|
ninja -v
|
|
|
|
- name: Run tests
|
|
run: |
|
|
./build/hiredis-test.exe
|
|
|
|
- name: Setup cygwin
|
|
uses: egor-tensin/setup-cygwin@v3
|
|
with:
|
|
platform: x64
|
|
packages: cmake gcc-core gcc-g++
|
|
|
|
- name: Build in cygwin
|
|
env:
|
|
HIREDIS_PATH: ${{ github.workspace }}
|
|
run: |
|
|
build_hiredis() {
|
|
cd $(cygpath -u $HIREDIS_PATH)
|
|
rm -rf build && mkdir build && cd build
|
|
cmake .. -G "Unix Makefiles" && make VERBOSE=1
|
|
}
|
|
build_hiredis
|
|
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
|