Skip to content

Commit

Permalink
CI updates (#1139)
Browse files Browse the repository at this point in the history
* Build CMake generated makefiles
* Simplify and update checkout
* Update CI workflow 'C/C++ CI'
* Some corrections of spelling and naming.
* Remove running on branch dev since not officially available.
  • Loading branch information
bjosv authored Nov 10, 2022
1 parent 8ad4985 commit a36686f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 57 deletions.
42 changes: 9 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ jobs:
name: Ubuntu
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: ${{ env.GITHUB_REPOSITORY }}
ref: ${{ env.GITHUB_HEAD_REF }}
- uses: actions/checkout@v3

- name: Install dependencies
run: |
Expand All @@ -24,7 +20,7 @@ jobs:
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 ..
run: mkdir build && cd build && cmake .. && make

- name: Build using makefile
run: USE_SSL=1 TEST_ASYNC=1 make
Expand All @@ -46,11 +42,7 @@ jobs:
runs-on: ubuntu-latest
container: centos:7
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: ${{ env.GITHUB_REPOSITORY }}
ref: ${{ env.GITHUB_HEAD_REF }}
- uses: actions/checkout@v3

- name: Install dependencies
run: |
Expand All @@ -63,7 +55,7 @@ jobs:
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 ..
run: mkdir build && cd build && cmake3 .. && make

- name: Build using Makefile
run: USE_SSL=1 TEST_ASYNC=1 make
Expand All @@ -86,11 +78,7 @@ jobs:
runs-on: ubuntu-latest
container: rockylinux:8
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: ${{ env.GITHUB_REPOSITORY }}
ref: ${{ env.GITHUB_HEAD_REF }}
- uses: actions/checkout@v3

- name: Install dependencies
run: |
Expand All @@ -105,7 +93,7 @@ jobs:
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 ..
run: mkdir build && cd build && cmake .. && make

- name: Build using Makefile
run: USE_SSL=1 TEST_ASYNC=1 make
Expand All @@ -127,11 +115,7 @@ jobs:
runs-on: macos-12
name: FreeBSD
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: ${{ env.GITHUB_REPOSITORY }}
ref: ${{ env.GITHUB_HEAD_REF }}
- uses: actions/checkout@v3

- name: Build in FreeBSD
uses: vmactions/freebsd-vm@v0
Expand All @@ -145,11 +129,7 @@ jobs:
name: macOS
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: ${{ env.GITHUB_REPOSITORY }}
ref: ${{ env.GITHUB_HEAD_REF }}
- uses: actions/checkout@v3

- name: Install dependencies
run: |
Expand All @@ -168,11 +148,7 @@ jobs:
name: Windows
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: ${{ env.GITHUB_REPOSITORY }}
ref: ${{ env.GITHUB_HEAD_REF }}
- uses: actions/checkout@v3

- name: Install dependencies
run: |
Expand Down
44 changes: 20 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,23 @@ name: C/C++ CI

on:
push:
branches: [ master, dev ]
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
full-build:
name: Build all, plus default examples, run tests against redis

runs-on: ubuntu-latest
env:
# the docker image used by the test.sh
REDIS_DOCKER: redis:alpine

steps:

- name: install prerequisites
- name: Install prerequisites
run: sudo apt-get update && sudo apt-get install -y libev-dev libevent-dev libglib2.0-dev libssl-dev valgrind
- uses: actions/checkout@v2
- name: run make
- uses: actions/checkout@v3
- name: Run make
run: make all examples
- name: Run unittests
run: make check
Expand All @@ -29,15 +27,15 @@ jobs:
TEST_PREFIX: valgrind --error-exitcode=100
SKIPS_ARG: --skip-throughput
run: make check

build-32-bit:
name: Build and test minimal 32 bit linux
runs-on: ubuntu-latest
steps:
- name: install prerequisites
- name: Install prerequisites
run: sudo apt-get update && sudo apt-get install gcc-multilib
- uses: actions/checkout@v2
- name: run make
- uses: actions/checkout@v3
- name: Run make
run: make all
env:
PLATFORM_FLAGS: -m32
Expand All @@ -60,14 +58,14 @@ jobs:
emulator: qemu-aarch64

steps:
- name: install qemu
- name: Install qemu
if: matrix.emulator
run: sudo apt-get install -y qemu-user
- name: install ploatform toolset
run: sudo apt-get install -y qemu-user
- name: Install platform toolset
if: matrix.toolset
run: sudo apt-get install -y gcc-${{matrix.toolset}}
- uses: actions/checkout@v2
- name: run make
- uses: actions/checkout@v3
- name: Run make
run: make all
env:
CC: ${{matrix.toolset}}-gcc
Expand All @@ -83,20 +81,18 @@ jobs:
runs-on: windows-latest
steps:
- uses: microsoft/[email protected]
- uses: actions/checkout@v2
- name: Cmake
- uses: actions/checkout@v3
- name: Run CMake
run: cmake -Wno-dev CmakeLists.txt
- name: build redis
- name: Build hiredis
run: MSBuild hiredis.vcxproj /p:Configuration=Debug
- name: build redis_static
- name: Build hiredis_static
run: MSBuild hiredis_static.vcxproj /p:Configuration=Debug
- name: build redis-test
- name: Build hiredis-test
run: MSBuild hiredis-test.vcxproj /p:Configuration=Debug
# use memurai, redis compatible server, since it is easy to install. Can't
# install official redis containers on the windows runner
- name: install Memurai redis server
- name: Install Memurai redis server
run: choco install -y memurai-developer.install
- name: run tests
- name: Run tests
run: Debug\hiredis-test.exe


0 comments on commit a36686f

Please sign in to comment.