ci: auto-install cmake and build dependencies
Some checks failed
CI with Native Libraries / Build and Test Native Libraries (push) Blocked by required conditions
CI with Native Libraries / Build Release Libraries (push) Blocked by required conditions
Test / test (push) Waiting to run
Checkout test / test (push) Successful in 5s
CI with Native Libraries / Check Build Environment (push) Successful in 12s
Documentation / build-and-publish (push) Has been cancelled

This commit is contained in:
Jeremie Fraeys 2026-02-12 13:35:48 -05:00
parent 06b388d692
commit b4f2b3e785
No known key found for this signature in database

View file

@ -21,6 +21,42 @@ jobs:
timeout-minutes: 5
steps:
- name: Install Build Dependencies
run: |
echo "Installing build dependencies..."
# Detect OS and install dependencies
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if command -v apt-get &> /dev/null; then
echo "Detected Debian/Ubuntu - installing cmake, zlib, build-essential..."
sudo apt-get update
sudo apt-get install -y cmake zlib1g-dev build-essential
elif command -v yum &> /dev/null; then
echo "Detected RHEL/CentOS - installing cmake, zlib, gcc-c++..."
sudo yum install -y cmake zlib-devel gcc-c++
else
echo "WARNING: Unknown package manager. Please install manually:"
echo " - cmake"
echo " - zlib development headers"
echo " - C++ compiler (g++ or clang++)"
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Detected macOS - checking for Homebrew..."
if ! command -v brew &> /dev/null; then
echo "ERROR: Homebrew not found. Install from https://brew.sh"
exit 1
fi
echo "Installing cmake, zlib via Homebrew..."
brew install cmake zlib
else
echo "WARNING: Unknown OS. Please install manually:"
echo " - cmake"
echo " - zlib development headers"
echo " - C++ compiler (g++ or clang++)"
fi
echo "Dependencies installed."
- name: Check CMake Available
run: |
if ! command -v cmake &> /dev/null; then
@ -34,26 +70,26 @@ jobs:
echo "Or add this to your runner setup script."
exit 1
fi
echo "cmake: $(cmake --version | head -1)"
echo "cmake: $(cmake --version | head -1)"
- name: Check C++ Compiler
run: |
if ! command -v g++ &> /dev/null && ! command -v clang++ &> /dev/null; then
echo "❌ ERROR: No C++ compiler found (g++ or clang++)"
echo "No C++ compiler found (g++ or clang++)"
echo ""
echo "To fix this:"
echo " Ubuntu/Debian: sudo apt-get install -y build-essential"
echo " macOS: xcode-select --install"
exit 1
fi
echo "C++ compiler available"
echo "C++ compiler available"
- name: Check Zlib
run: |
if pkg-config --exists zlib 2>/dev/null || [ -f /usr/include/zlib.h ] || [ -f /usr/local/include/zlib.h ]; then
echo "zlib development headers found"
echo "zlib development headers found"
else
echo "⚠️ WARNING: zlib headers not found - native build may fail"
echo "zlib headers not found - native build may fail"
echo " Install: sudo apt-get install -y zlib1g-dev || brew install zlib"
fi
@ -79,7 +115,7 @@ jobs:
make native-build 2>&1
if [ $? -ne 0 ]; then
echo ""
echo "Native build failed!"
echo "Native build failed!"
echo ""
echo "Common causes:"
echo " 1. Missing cmake: Install with 'apt-get install cmake' or 'brew install cmake'"
@ -90,7 +126,7 @@ jobs:
echo "Check the detailed error above for more information."
exit 1
fi
echo "Native libraries built successfully"
echo "Native libraries built successfully"
- name: Test with Native Libraries
run: |
@ -119,7 +155,7 @@ jobs:
- name: Lint
run: |
echo "Running linters..."
make lint || echo "⚠️ Linting completed with warnings"
make lint || echo "Linting completed with warnings"
build-release:
name: Build Release Libraries
@ -141,7 +177,7 @@ jobs:
run: |
echo "Building optimized release libraries..."
make native-release 2>&1
echo "Release libraries built"
echo "Release libraries built"
- name: List Build Artifacts
run: |