Skip to content

Add compatibility alias for minizip-ng in CMake configuration #63

Add compatibility alias for minizip-ng in CMake configuration

Add compatibility alias for minizip-ng in CMake configuration #63

Workflow file for this run

name: Neko Function CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
build-and-test:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
# Windows builds
- {
name: "Windows MSVC Debug",
os: windows-latest,
cc: "cl",
cxx: "cl",
build_type: "Debug",
generators: "Visual Studio 17 2022"
}
- {
name: "Windows MSVC Release",
os: windows-latest,
cc: "cl",
cxx: "cl",
build_type: "Release",
generators: "Visual Studio 17 2022"
}
- {
name: "Windows Clang Debug",
os: windows-latest,
cc: "clang",
cxx: "clang++",
build_type: "Debug",
generators: "Visual Studio 17 2022"
}
- {
name: "Windows Clang Release",
os: windows-latest,
cc: "clang",
cxx: "clang++",
build_type: "Release",
generators: "Visual Studio 17 2022"
}
# Linux builds
- {
name: "Ubuntu GCC Debug",
os: ubuntu-latest,
cc: "gcc",
cxx: "g++",
build_type: "Debug",
generators: "Unix Makefiles"
}
- {
name: "Ubuntu GCC Release",
os: ubuntu-latest,
cc: "gcc",
cxx: "g++",
build_type: "Release",
generators: "Unix Makefiles"
}
- {
name: "Ubuntu Clang Debug",
os: ubuntu-latest,
cc: "clang",
cxx: "clang++",
build_type: "Debug",
generators: "Unix Makefiles"
}
- {
name: "Ubuntu Clang Release",
os: ubuntu-latest,
cc: "clang",
cxx: "clang++",
build_type: "Release",
generators: "Unix Makefiles"
}
# macOS builds
- {
name: "macOS Clang Debug",
os: macos-latest,
cc: "clang",
cxx: "clang++",
build_type: "Debug",
generators: "Unix Makefiles"
}
- {
name: "macOS Clang Release",
os: macos-latest,
cc: "clang",
cxx: "clang++",
build_type: "Release",
generators: "Unix Makefiles"
}
- {
name: "macOS GCC Debug",
os: macos-latest,
cc: "gcc",
cxx: "g++",
build_type: "Debug",
generators: "Unix Makefiles"
}
- {
name: "macOS GCC Release",
os: macos-latest,
cc: "gcc",
cxx: "g++",
build_type: "Release",
generators: "Unix Makefiles"
}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Check compiler versions (Unix)
if: "!startsWith(matrix.config.os, 'windows')"
run: |
echo "=== Compiler Information ==="
${{ matrix.config.cxx }} --version
echo "=== CMake Information ==="
cmake --version
# ============================================================================
# Install vcpkg (Unix)
# ============================================================================
- name: Install vcpkg (Unix)
if: "!startsWith(matrix.config.os, 'windows')"
run: |
echo "=== Installing Vcpkg ==="
git clone https://github.com/microsoft/vcpkg.git ~/vcpkg
~/vcpkg/bootstrap-vcpkg.sh
VCPKG_ROOT=~/vcpkg
echo "VCPKG_ROOT=$VCPKG_ROOT" >> $GITHUB_ENV
# ============================================================================
# Install packages via vcpkg (Unix)
# ============================================================================
- name: Install dependencies via vcpkg (Unix)
if: "!startsWith(matrix.config.os, 'windows')"
run: |
echo "=== Installing dependencies via vcpkg ==="
~/vcpkg/vcpkg install zlib openssl minizip-ng
# ============================================================================
# Windows: Use default vcpkg
# ============================================================================
- name: Install dependencies via vcpkg (Windows)
if: startsWith(matrix.config.os, 'windows')
run: |
Write-Host "=== Installing dependencies via vcpkg ==="
$vcpkgRoot = $env:VCPKG_INSTALLATION_ROOT
Write-Host "Using vcpkg at: $vcpkgRoot"
vcpkg install openssl:x64-windows minizip-ng:x64-windows --recurse
Write-Host ""
Write-Host "=== Installed packages ==="
vcpkg list
Write-Host ""
Write-Host "=== Verifying installation ==="
$installedPath = "$vcpkgRoot\installed\x64-windows"
Write-Host "Installed path: $installedPath"
if (Test-Path "$installedPath\share\minizip-ng") {
Write-Host "minizip-ng CMake files: OK"
} else {
Write-Host "minizip-ng CMake files: NOT FOUND"
}
if (Test-Path "$installedPath\share\openssl") {
Write-Host "OpenSSL CMake files: OK"
} else {
Write-Host "OpenSSL CMake files: NOT FOUND"
}
shell: powershell
- name: Set up MSVC environment (Windows)
if: startsWith(matrix.config.os, 'windows') && matrix.config.cc == 'cl'
uses: ilammy/msvc-dev-cmd@v1.13.0
# ============================================================================
# Configure CMake for all platforms
# ============================================================================
- name: Configure CMake (Windows)
if: startsWith(matrix.config.os, 'windows')
run: |
Write-Host "=== Configuring NekoFunction (Windows) ==="
$vcpkgRoot = $env:VCPKG_INSTALLATION_ROOT
$toolchainFile = "$vcpkgRoot\scripts\buildsystems\vcpkg.cmake"
$installedPath = "$vcpkgRoot\installed\x64-windows"
Write-Host "VCPKG_ROOT: $vcpkgRoot"
Write-Host "CMAKE_TOOLCHAIN_FILE: $toolchainFile"
Write-Host "CMAKE_PREFIX_PATH: $installedPath"
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -G "${{ matrix.config.generators }}" `
-DNEKO_FUNCTION_BUILD_TESTS=ON -DNEKO_FUNCTION_AUTO_FETCH_DEPS=ON `
-DCMAKE_TOOLCHAIN_FILE="$toolchainFile" `
-DVCPKG_TARGET_TRIPLET=x64-windows `
-DCMAKE_PREFIX_PATH="$installedPath"
shell: powershell
- name: Configure CMake (Ubuntu)
if: "startsWith(matrix.config.os, 'ubuntu')"
run: |
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -G "${{ matrix.config.generators }}" -DNEKO_FUNCTION_BUILD_TESTS=ON -DNEKO_FUNCTION_AUTO_FETCH_DEPS=ON -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DCMAKE_PREFIX_PATH=$VCPKG_ROOT/installed/x64-linux
shell: bash
- name: Configure CMake (macOS)
if: "startsWith(matrix.config.os, 'macos')"
run: |
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -G "${{ matrix.config.generators }}" -DNEKO_FUNCTION_BUILD_TESTS=ON -DNEKO_FUNCTION_AUTO_FETCH_DEPS=ON -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DCMAKE_PREFIX_PATH=$VCPKG_ROOT/installed/x64-macos
shell: bash
- name: Verify Hash and Archive Support
run: |
echo "=== NekoFunction Configuration Check ==="
if grep -q "Hash support enabled: ON" build/CMakeCache.txt 2>/dev/null || grep -rq "Hash support enabled: ON" build/ 2>/dev/null; then
echo "✓ Hash support is ENABLED"
else
echo "✗ Hash support is DISABLED or not found"
fi
if grep -q "Archiver support enabled: ON" build/CMakeCache.txt 2>/dev/null || grep -rq "Archiver support enabled: ON" build/ 2>/dev/null; then
echo "✓ Archiver support is ENABLED"
else
echo "✗ Archiver support is DISABLED or not found"
fi
shell: bash
- name: Build
run: cmake --build build --config ${{ matrix.config.build_type }} --parallel
- name: Run tests
working-directory: build
run: |
if [ "${{ runner.os }}" = "Windows" ]; then
if [ "${{ matrix.config.generators }}" = "Visual Studio 17 2022" ] || [ "${{ matrix.config.generators }}" = "Visual Studio 16 2019" ]; then
ctest -C ${{ matrix.config.build_type }} --output-on-failure --verbose
else
ctest --output-on-failure --verbose
fi
else
ctest --output-on-failure --verbose
fi
shell: bash
- name: Upload build artifacts (on failure)
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-logs-${{ matrix.config.name }}
path: |
build/CMakeFiles/CMakeOutput.log
build/CMakeFiles/CMakeError.log
build/Testing/Temporary/LastTest.log