Replace boost::fusion with iris::alloy #79
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2025-2026 Nana Sakisaka | |
| # Copyright 2026 The Iris Project Contributors | |
| # | |
| # Distributed under the Boost Software License, Version 1.0. | |
| # https://www.boost.org/LICENSE_1_0.txt | |
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - 'main' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| IRIS_X4_BUILD_JOBS: 4 | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| components: ${{ steps.processed.outputs.result }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| general: | |
| - '.github/workflows/*.yml' | |
| - 'CMakeLists.txt' | |
| - 'modules/iris' | |
| - 'test/CMakeLists.txt' | |
| alloy: | |
| - 'include/iris/alloy/**/*' | |
| - 'test/alloy/**/*' | |
| x4: | |
| - 'include/iris/x4.hpp' | |
| - 'include/iris/x4/**/*' | |
| - 'test/x4/**/*' | |
| - uses: actions/github-script@v8 | |
| id: processed | |
| env: | |
| CHANGES: ${{ steps.filter.outputs.changes }} | |
| with: | |
| script: | | |
| const changes = JSON.parse(process.env.CHANGES); | |
| console.log('changes: ', changes); | |
| let result = []; | |
| if (changes.includes('general') || changes.includes('alloy')) result.push('alloy'); | |
| if (changes.includes('general') || changes.includes('alloy') || changes.includes('x4')) result.push('x4'); | |
| console.log('result: ', result); | |
| return result; | |
| build: | |
| name: "[${{ matrix.cpp_version.name }}] ${{ matrix.components }} | ${{ matrix.compiler.toolset }}-${{ matrix.compiler.version }} (${{ matrix.build_type.name }}) @ ${{ matrix.os.name }}-${{ matrix.os.version }}" | |
| needs: changes | |
| if: ${{ needs.changes.outputs.components != '[]' && needs.changes.outputs.components != '' }} | |
| runs-on: ${{ matrix.os.name }}-${{ matrix.os.version }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - name: ubuntu | |
| version: 24.04 | |
| - name: windows | |
| version: 2022 | |
| build_type: | |
| - name: Debug | |
| lowercase: debug | |
| - name: Release | |
| lowercase: release | |
| cpp_version: | |
| - name: C++23 | |
| number: 23 | |
| - name: C++26 | |
| number: 26 | |
| compiler: | |
| - name: GCC | |
| toolset: gcc | |
| version: 14 | |
| executable: g++-14 | |
| cxxflags: -fdiagnostics-color=always | |
| - name: Clang | |
| toolset: clang | |
| version: 21 | |
| executable: clang++-21 | |
| cxxflags: -stdlib=libc++ -fcolor-diagnostics | |
| - name: MSVC | |
| toolset: msvc | |
| version: 2022 | |
| builder_additional_args: -- "-consoleLoggerParameters:ForceConsoleColor" | |
| executable: cl | |
| components: ${{ fromJSON(needs.changes.outputs.components) }} | |
| exclude: | |
| # Blacklist all invalid combinations of environments | |
| - os: | |
| name: windows | |
| compiler: | |
| name: GCC | |
| - os: | |
| name: windows | |
| compiler: | |
| name: Clang | |
| - os: | |
| name: ubuntu | |
| compiler: | |
| name: MSVC | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: Initialize Ubuntu | |
| if: matrix.os.name == 'ubuntu' | |
| run: | | |
| sudo echo "set man-db/auto-update false" | sudo debconf-communicate | |
| sudo dpkg-reconfigure man-db | |
| - name: Setup GCC | |
| if: matrix.compiler.toolset == 'gcc' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y g++-${{ matrix.compiler.version }} | |
| - name: Setup Clang | |
| if: matrix.compiler.toolset == 'clang' | |
| run: | | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x ./llvm.sh | |
| sudo ./llvm.sh ${{ matrix.compiler.version }} | |
| sudo apt-get install -y libc++-${{ matrix.compiler.version }}-dev libc++abi-${{ matrix.compiler.version }}-dev libunwind-${{ matrix.compiler.version }}-dev | |
| - uses: TheMrMilchmann/setup-msvc-dev@v3 | |
| if: matrix.os.name == 'windows' | |
| with: | |
| arch: x64 | |
| - name: Fetch Environment Info | |
| id: env-info | |
| shell: bash | |
| run: | | |
| set -e | |
| case "${{ matrix.compiler.toolset }}" in | |
| "gcc") | |
| COMPILER_FULL_VERSION=$(${{ matrix.compiler.executable }} -dumpfullversion -dumpversion) | |
| ;; | |
| "clang") | |
| COMPILER_FULL_VERSION=$(${{ matrix.compiler.executable }} -dumpversion) | |
| ;; | |
| "msvc") | |
| COMPILER_FULL_VERSION=$(powershell -NoProfile -Command "(Get-Command ${{ matrix.compiler.executable }}).FileVersionInfo.FileVersion") | |
| ;; | |
| esac | |
| echo "COMPILER_FULL_VERSION=$COMPILER_FULL_VERSION" | |
| echo "compiler-full-version=$COMPILER_FULL_VERSION" >> "$GITHUB_OUTPUT" | |
| export BOOST_RELEASE_VERSION_NAME=boost-1.89.0 # Fixed on the timing of X4's fork | |
| echo "BOOST_RELEASE_VERSION_NAME: $BOOST_RELEASE_VERSION_NAME" | |
| echo "BOOST_RELEASE_VERSION_NAME=$BOOST_RELEASE_VERSION_NAME" >> "$GITHUB_OUTPUT" | |
| if [ "${{ matrix.os.name }}" = "windows" ]; then | |
| export BOOST_ROOT=$(cygpath -w $HOME/boost) | |
| else | |
| export BOOST_ROOT=$HOME/boost | |
| fi | |
| echo "BOOST_ROOT: $BOOST_ROOT" | |
| echo "BOOST_ROOT=$BOOST_ROOT" >> "$GITHUB_OUTPUT" | |
| - name: Cache upstream Boost libraries (restore) | |
| id: cache-boost | |
| uses: actions/cache/restore@v4 | |
| with: | |
| key: ${{ steps.env-info.outputs.BOOST_RELEASE_VERSION_NAME }}-${{ matrix.os.name }}-${{ matrix.os.version }}-${{ matrix.compiler.toolset }}-${{ steps.env-info.outputs.compiler-full-version }}-${{ matrix.cpp_version.name }}-${{ matrix.build_type.name }} | |
| path: | | |
| ${{ steps.env-info.outputs.BOOST_ROOT }} | |
| !${{ steps.env-info.outputs.BOOST_ROOT }}/.git | |
| - name: Clone upstream Boost libraries | |
| if: steps.cache-boost.outputs.cache-hit != 'true' | |
| shell: bash | |
| run: | | |
| git -c advice.detachedHead=false clone --no-tags \ | |
| --single-branch --branch=${{ steps.env-info.outputs.BOOST_RELEASE_VERSION_NAME }} \ | |
| --depth=1 --filter=blob:none --quiet https://github.com/boostorg/boost.git \ | |
| "${{ steps.env-info.outputs.BOOST_ROOT }}" | |
| cd "${{ steps.env-info.outputs.BOOST_ROOT }}" | |
| git submodule update --init --depth 1 --recursive -- \ | |
| tools/build \ | |
| tools/boost_install \ | |
| libs/assert \ | |
| libs/config \ | |
| libs/core \ | |
| libs/io \ | |
| libs/mpl \ | |
| libs/predef \ | |
| libs/preprocessor \ | |
| libs/static_assert \ | |
| libs/throw_exception \ | |
| libs/type_traits \ | |
| libs/utility | |
| - name: Build upstream Boost libraries (Ubuntu) | |
| if: matrix.os.name == 'ubuntu' && steps.cache-boost.outputs.cache-hit != 'true' | |
| env: | |
| BOOST_ROOT: ${{ steps.env-info.outputs.BOOST_ROOT }} | |
| working-directory: ${{ steps.env-info.outputs.BOOST_ROOT }} | |
| shell: bash | |
| run: | | |
| set -xe | |
| rm -rf libs/iris_x4 | |
| ./bootstrap.sh --with-toolset=${{ matrix.compiler.toolset }} | |
| ./b2 -d0 headers | |
| - name: Build upstream Boost libraries (Windows) | |
| if: matrix.os.name == 'windows' && steps.cache-boost.outputs.cache-hit != 'true' | |
| env: | |
| BOOST_ROOT: ${{ steps.env-info.outputs.BOOST_ROOT }} | |
| working-directory: ${{ steps.env-info.outputs.BOOST_ROOT }} | |
| shell: cmd | |
| run: | | |
| rd /s /q libs\iris_x4 | |
| .\bootstrap.bat --with-toolset=${{ matrix.compiler.toolset }} | |
| .\b2 -d0 headers | |
| - name: Cache upstream Boost libraries (save) | |
| if: steps.cache-boost.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| key: ${{ steps.cache-boost.outputs.cache-primary-key }} | |
| path: | | |
| ${{ steps.env-info.outputs.BOOST_ROOT }} | |
| !${{ steps.env-info.outputs.BOOST_ROOT }}/.git | |
| - name: Cache CMake Dependencies (restore) | |
| id: cache-deps | |
| uses: actions/cache/restore@v4 | |
| with: | |
| key: deps-${{ matrix.os.name }}-${{ matrix.os.version }}-${{ matrix.compiler.toolset }}-${{ steps.env-info.outputs.compiler-full-version }}-${{ matrix.cpp_version.name }}-${{ matrix.build_type.name }} | |
| path: ${{ steps.env-info.outputs.BOOST_ROOT }}/libs/iris_x4/build/_deps | |
| # Adapt CMP0168; enable caching in CI | |
| # https://cmake.org/cmake/help/latest/module/FetchContent.html#variable:FETCHCONTENT_FULLY_DISCONNECTED | |
| - name: Setup Cached CMake Dependencies | |
| id: deps-info | |
| shell: bash | |
| run: | | |
| if [ "${{ steps.cache-deps.outputs.cache-hit }}" = "true" ]; then | |
| echo "IRIS_X4_CMAKE_ARGS=-DFETCHCONTENT_FULLY_DISCONNECTED=ON" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "IRIS_X4_CMAKE_ARGS=" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Configure | |
| env: | |
| BOOST_ROOT: ${{ steps.env-info.outputs.BOOST_ROOT }} | |
| working-directory: ${{ steps.env-info.outputs.BOOST_ROOT }} | |
| shell: bash | |
| run: | | |
| set -xe | |
| cp -rp "${{ github.workspace }}/." libs/iris_x4 | |
| cd libs/iris_x4 | |
| cmake ${{ steps.deps-info.outputs.IRIS_X4_CMAKE_ARGS }} -B build \ | |
| -DCMAKE_CXX_COMPILER=${{ matrix.compiler.executable }} \ | |
| -DCMAKE_CXX_FLAGS="${{ matrix.compiler.cxxflags }}" \ | |
| -DCMAKE_CXX_STANDARD=${{ matrix.cpp_version.number }} \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type.name }} \ | |
| -DIRIS_TEST_ALLOY=${{ case(matrix.components == 'alloy' || matrix.components == 'x4', 'ON', 'OFF') }} \ | |
| -DIRIS_TEST_X4=${{ case(matrix.components == 'x4', 'ON', 'OFF') }} \ | |
| -S . | |
| - name: Build Tests | |
| working-directory: ${{ steps.env-info.outputs.BOOST_ROOT }}/libs/iris_x4 | |
| run: | | |
| cmake --build build --config ${{ matrix.build_type.name }} -j${{ env.IRIS_X4_BUILD_JOBS }} ${{ matrix.compiler.builder_additional_args }} | |
| - name: Cache CMake Dependencies (save) | |
| if: steps.cache-deps.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| key: ${{ steps.cache-deps.outputs.cache-primary-key }} | |
| path: ${{ steps.env-info.outputs.BOOST_ROOT }}/libs/iris_x4/build/_deps | |
| - name: Test | |
| env: | |
| CLICOLOR_FORCE: 1 | |
| working-directory: ${{ steps.env-info.outputs.BOOST_ROOT }}/libs/iris_x4/build/test | |
| run: ctest --output-on-failure -C ${{ matrix.build_type.name }} |