Skip to content

Release v1.1.0: Windows MSVC compatibility and Python CLI #10

Release v1.1.0: Windows MSVC compatibility and Python CLI

Release v1.1.0: Windows MSVC compatibility and Python CLI #10

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
build_type: [Release, Debug]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libcairo2-dev \
libjpeg-dev \
zlib1g-dev \
libzstd-dev
- name: Set up compiler
run: |
if [ "${{ matrix.compiler }}" = "clang" ]; then
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
else
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
fi
- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DENABLE_NATIVE_ARCH=OFF \
-DENABLE_SANITIZERS=${{ matrix.build_type == 'Debug' && 'ON' || 'OFF' }}
- name: Build
run: cmake --build build -j$(nproc)
- name: Run tests
run: ctest --test-dir build --output-on-failure -j$(nproc)
build-macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
build_type: [Release, Debug]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install cairo jpeg zstd pkg-config
- name: Configure CMake
run: |
export PKG_CONFIG_PATH="$(brew --prefix)/lib/pkgconfig:$PKG_CONFIG_PATH"
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DENABLE_NATIVE_ARCH=OFF \
-DCMAKE_PREFIX_PATH="$(brew --prefix)"
- name: Build
run: cmake --build build -j$(sysctl -n hw.ncpu)
- name: Run tests
run: ctest --test-dir build --output-on-failure -j$(sysctl -n hw.ncpu)
build-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
build_type: [Release, Debug]
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
- uses: actions/checkout@v4
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install dependencies
shell: pwsh
run: |
# Retry logic for transient network failures
$maxRetries = 3
$retryCount = 0
$success = $false
while (-not $success -and $retryCount -lt $maxRetries) {
$retryCount++
Write-Host "Attempt $retryCount of $maxRetries"
vcpkg install cairo libjpeg-turbo zstd zlib pthreads --triplet x64-windows
if ($LASTEXITCODE -eq 0) {
$success = $true
} else {
Write-Host "vcpkg install failed, retrying in 30 seconds..."
Start-Sleep -Seconds 30
}
}
if (-not $success) {
Write-Host "vcpkg install failed after $maxRetries attempts"
exit 1
}
- name: Configure CMake
run: |
cmake -B build `
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
-DENABLE_NATIVE_ARCH=OFF
- name: Build
run: cmake --build build --config ${{ matrix.build_type }} -j $env:NUMBER_OF_PROCESSORS
- name: Run tests
run: ctest --test-dir build --output-on-failure -C ${{ matrix.build_type }}
build-macos-arm64:
runs-on: macos-14 # M1 runner
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: brew install cairo jpeg zstd pkg-config
- name: Configure CMake
run: |
export PKG_CONFIG_PATH="$(brew --prefix)/lib/pkgconfig:$PKG_CONFIG_PATH"
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_NATIVE_ARCH=OFF \
-DCMAKE_PREFIX_PATH="$(brew --prefix)"
- name: Build
run: cmake --build build -j$(sysctl -n hw.ncpu)
- name: Run tests
run: ctest --test-dir build --output-on-failure
# Minimal build without optional dependencies
build-minimal:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install minimal dependencies
run: |
sudo apt-get update
sudo apt-get install -y zlib1g-dev libzstd-dev
- name: Configure CMake (minimal)
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_NATIVE_ARCH=OFF \
-DWITH_CAIRO=OFF
- name: Build
run: cmake --build build -j$(nproc)
- name: Run tests
run: ctest --test-dir build --output-on-failure -j$(nproc)