Skip to content

Testing new fallback layer for simd. #130

Testing new fallback layer for simd.

Testing new fallback layer for simd. #130

name: Jsonifier Build
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]
platform:
- os: ubuntu-latest
compiler: clang
cc: clang
cxx: clang++
name: "Ubuntu Clang"
cmake_cxx: /usr/bin/clang++-20
- os: ubuntu-latest
compiler: gcc
cc: gcc
cxx: g++
name: "Ubuntu GCC"
cmake_cxx: /usr/bin/g++-14
- os: macos-latest
compiler: clang
cc: clang
cxx: clang++
name: "macOS Clang"
cmake_cxx: ""
- os: macos-latest
compiler: gcc
cc: gcc
cxx: g++
name: "macOS GCC"
cmake_cxx: ""
- os: windows-latest
compiler: msvc
name: "Windows MSVC"
cmake_cxx: ""
runs-on: ${{ matrix.platform.os }}
name: ${{ matrix.platform.name }} (${{ matrix.build_type }})
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Clang (Ubuntu)
if: matrix.platform.os == 'ubuntu-latest' && matrix.platform.compiler == 'clang'
run: |
sudo apt-get update
sudo apt update
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 20
sudo apt-get install liburing-dev
- name: Setup GCC (Ubuntu)
if: matrix.platform.os == 'ubuntu-latest' && matrix.platform.compiler == 'gcc'
run: |
sudo apt-get install build-essential
sudo apt-get install g++-14
sudo apt-get install liburing-dev
- name: Setup Clang (macOS)
if: matrix.platform.os == 'macos-latest' && matrix.platform.compiler == 'clang'
run: |
brew install llvm
- name: Setup GCC (macOS)
if: matrix.platform.os == 'macos-latest' && matrix.platform.compiler == 'gcc'
run: |
brew install gcc
GCC_PATH=$(brew --prefix gcc)
GCC_VER=$(ls ${GCC_PATH}/bin/gcc-* 2>/dev/null | grep -oE '[0-9]+$' | sort -rn | head -1)
echo "CC=${GCC_PATH}/bin/gcc-${GCC_VER}" >> $GITHUB_ENV
echo "CXX=${GCC_PATH}/bin/g++-${GCC_VER}" >> $GITHUB_ENV
${GCC_PATH}/bin/gcc-${GCC_VER} --version
${GCC_PATH}/bin/g++-${GCC_VER} --version
- name: Setup MSVC (Windows)
if: matrix.platform.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: Create Build Directory
run: mkdir -p Build
- name: Configure CMake (Ubuntu-GCC)
if: matrix.platform.os == 'ubuntu-latest' && matrix.platform.compiler == 'gcc'
run: |
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -DCMAKE_INSTALL_RPATH="@loader_path/../lib" -DJSONIFIER_BENCHMARKS=TRUE -DCMAKE_CXX_COMPILER=${{ matrix.platform.cmake_cxx }}
- name: Configure CMake (Ubuntu-Clang)
if: matrix.platform.os == 'ubuntu-latest' && matrix.platform.compiler == 'clang'
run: |
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -DCMAKE_INSTALL_RPATH="@loader_path/../lib" -DJSONIFIER_BENCHMARKS=TRUE -DCMAKE_CXX_COMPILER=${{ matrix.platform.cmake_cxx }}
- name: Configure CMake (macOS-Clang)
if: matrix.platform.os == 'macos-latest' && matrix.platform.compiler == 'clang'
run: |
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -DCMAKE_INSTALL_RPATH="@loader_path/../lib" -DJSONIFIER_BENCHMARKS=TRUE
- name: Configure CMake (macOS-GCC)
if: matrix.platform.os == 'macos-latest' && matrix.platform.compiler == 'gcc'
run: |
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -DCMAKE_INSTALL_RPATH="@loader_path/../lib" -DJSONIFIER_BENCHMARKS=TRUE -DCMAKE_C_COMPILER=${{ env.CC }} -DCMAKE_CXX_COMPILER=${{ env.CXX }}
- name: Configure CMake (Windows)
if: matrix.platform.os == 'windows-latest'
run: cmake -S . -B ./Build -DJSONIFIER_BENCHMARKS=TRUE
- name: Build Project
run: cmake --build ./Build --config=${{ matrix.build_type }} -v
- name: Install Project (Unix)
if: runner.os != 'Windows'
run: sudo cmake --install ./Build --config=${{ matrix.build_type }} -v
- name: Install Project (Windows)
if: runner.os == 'Windows'
run: cmake --install ./Build --config=${{ matrix.build_type }} -v
- name: Run Benchmarks (Unix)
if: runner.os != 'Windows'
run: ./Build/Benchmarks/Json-Performance
- name: Run Benchmarks (Windows)
if: runner.os == 'Windows'
run: |
& "C:\Program Files (x86)\Jsonifier\bin\Json-Performance.exe"