feat: add osx support #353
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-linux: | |
strategy: | |
matrix: | |
version: | |
- "5.0" | |
- "6.0" | |
- "6.2" | |
- "7.2" | |
- "7.4" | |
- "unstable" | |
compiler: | |
- "gcc" | |
- "clang" | |
runs-on: "ubuntu-latest" | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
CC: ${{ matrix.compiler }} | |
# TODO: would be nice to connect to a redis server instead of building from source | |
# services: | |
# redis: | |
# image: redis:${{ matrix.version }} | |
# options: >- | |
# --health-cmd "redis-cli ping" | |
# --health-interval 10s | |
# --health-timeout 5s | |
# --health-retries 5 | |
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: | | |
sudo apt-get update | |
sudo apt-get install -y cmake clang libssl-dev git bc | |
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 | |
- name: Test on redis-${{ matrix.version }} | |
shell: bash | |
run: | | |
make -j -C ${{ github.workspace }}/redis | |
if [ $(bc -l <<< "${{ matrix.version }} >= 6.2") -eq 1 ] || [ "${{ matrix.version }}" = "unstable" ]; then | |
make -j -C ${{ github.workspace }}/redis/tests/modules | |
fi | |
LIBRDB_REDIS_FOLDER="${{ github.workspace }}/redis/src" make clean debug test example | |
working-directory: ${{github.workspace}} | |
build-osx: | |
strategy: | |
matrix: | |
version: | |
- "6.2" | |
- "7.2" | |
- "7.4" | |
- "unstable" | |
runs-on: "macos-latest" | |
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: | | |
brew install cmocka bc llvm grep | |
- name: Test on redis-${{ matrix.version }} | |
shell: bash | |
run: | | |
export PATH="$(brew --prefix)/opt/grep/libexec/gnubin:${PATH}" | |
make -j -C ${{ github.workspace }}/redis | |
make -j -C ${{ github.workspace }}/redis/tests/modules | |
# FIXME NOT WORKING | |
# LIBRDB_REDIS_FOLDER="${{ github.workspace }}/redis/src" | |
make clean debug test example | |
working-directory: ${{github.workspace}} |