Skip to content

Small fixes for compilation workflow #3

Small fixes for compilation workflow

Small fixes for compilation workflow #3

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
- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DENABLE_NATIVE_ARCH=OFF
- 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]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
vcpkg install cairo libjpeg-turbo zstd zlib --triplet x64-windows
- 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
- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_NATIVE_ARCH=OFF
- 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)