fix ci.yml #202
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 0 * * 0' # Run every Sunday at midnight UTC | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
compiler: gcc | |
version: "5.0" | |
- os: ubuntu-latest | |
compiler: clang | |
version: "6.0" | |
- os: ubuntu-latest | |
compiler: gcc | |
version: "7.0" | |
- os: ubuntu-latest | |
compiler: clang | |
version: "7.2" | |
- os: ubuntu-latest | |
compiler: gcc | |
version: "7.4" | |
- os: ubuntu-latest | |
compiler: clang | |
version: "unstable" | |
- os: macos-latest | |
compiler: gcc | |
version: "7.4" | |
- os: macos-latest | |
compiler: clang | |
version: "unstable" | |
runs-on: ${{ matrix.os }} | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
CC: ${{ matrix.compiler }} | |
steps: | |
- name: Checkout librdb | |
uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Clone Redis (${{ matrix.version }}) | |
uses: actions/checkout@v4 | |
with: | |
repository: redis/redis | |
ref: ${{ matrix.version }} | |
path: redis | |
- name: Install prerequisites | |
run: | | |
if [ "${RUNNER_OS}" = "Linux" ]; then | |
sudo apt-get update | |
sudo apt-get install -y cmake clang libssl-dev valgrind git bc | |
# Build and install cmocka | |
git clone https://git.cryptomilk.org/projects/cmocka.git | |
cd cmocka | |
mkdir build | |
cd build | |
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local | |
make | |
sudo make install | |
elif [ "${RUNNER_OS}" = "macOS" ]; then | |
brew install cmocka bc llvm grep | |
echo "PATH=$(brew --prefix)/opt/grep/libexec/gnubin:${PATH}" >> "${GITHUB_ENV}" | |
fi | |
- name: Build Redis ${{ matrix.version }} | |
run: | | |
make -j -C redis | |
if [ $(bc -l <<< "${{ matrix.version }} >= 6.2") -eq 1 ] || [ "${{ matrix.version }}" = "unstable" ]; then | |
make -j -C redis/tests/modules | |
fi | |
- name: Run tests with shared lib | |
run: | | |
LIBRDB_REDIS_FOLDER="$(pwd)/redis/src" make clean debug test | |
- name: Run tests with static lib and valgrind | |
if: runner.os == 'Linux' | |
run: | | |
LIBRDB_REDIS_FOLDER="$(pwd)/redis/src" make clean all valgrind |