feat: add osx support #350
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: | |
os: | |
# - "macos-latest" | |
- "ubuntu-20.04" | |
- "ubuntu-22.04" | |
- "ubuntu-24.04" | |
version: | |
- "5.0" | |
- "6.0" | |
- "6.2" | |
- "7.2" | |
- "7.4" | |
- "unstable" | |
compiler: | |
- "gcc" | |
- "clang" | |
runs-on: ${{ matrix.os }} | |
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 | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Install Prerequisites and clone Redis ${{ matrix.version }} | |
shell: bash | |
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 | |
git clone https://github.com/redis/redis.git ~/redis | |
- name: Test on redis-${{ matrix.version }} | |
shell: bash | |
run: | | |
# clang is more strict to shared-obj versioning. Satisfy its needs. | |
pushd ~/redis | |
git checkout ${{ matrix.version }} | |
make -j 4 -C ~/redis | |
if [ $(bc -l <<< "${{ matrix.version }} >= 6.2") -eq 1 ] || [ "${{ matrix.version }}" = "unstable" ]; then | |
make -C ~/redis/tests/modules | |
fi | |
popd | |
make clean debug test example | |
working-directory: ${{github.workspace}} |