Skip to content

Remove binary parser #201

Remove binary parser

Remove binary parser #201

Workflow file for this run

# Copyright 2025 Nana Sakisaka
#
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
name: CI
on:
pull_request:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
BOOST_SPIRIT_X4_BUILD_JOBS: 4
jobs:
changes:
runs-on: ubuntu-latest
outputs:
spirit_component: ${{ steps.filter.outputs.changes }}
x4: ${{ steps.filter.outputs.x4 }}
steps:
- uses: actions/checkout@v5
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
x4:
- '.github/workflows/*.yml'
- 'CMakeLists.txt'
- 'test/CMakeLists.txt'
- 'include/boost/spirit/x4/**/*'
- 'include/boost/spirit/x4.hpp'
- 'test/x4/**/*'
- '!**/Jamfile'
build:
name: "[${{ matrix.cpp_version.name }}] ${{ matrix.spirit_component }} | ${{ matrix.compiler.toolset }}-${{ matrix.compiler.version }} (${{ matrix.build_type.name }}) @ ${{ matrix.os.name }}-${{ matrix.os.version }}"
needs: changes
if: ${{ needs.changes.outputs.spirit_component != '[]' && needs.changes.outputs.spirit_component != '' }}
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
spirit_component: ${{ fromJSON(needs.changes.outputs.spirit_component) }}
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:
# required for upstream Boost version detection
# sadly not working due to upstream bug: https://github.com/actions/checkout/issues/1471
fetch-tags: true
- name: Fetch git tags
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- 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=$(git for-each-ref refs/tags --sort=-refname --format='%(refname:lstrip=-1)' --count=1)
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/bind \
libs/config \
libs/container_hash \
libs/core \
libs/describe \
libs/detail \
libs/endian \
libs/function \
libs/function_types \
libs/functional \
libs/fusion \
libs/integer \
libs/io \
libs/mp11 \
libs/mpl \
libs/predef \
libs/preprocessor \
libs/static_assert \
libs/throw_exception \
libs/tuple \
libs/type_index \
libs/type_traits \
libs/typeof \
libs/utility \
libs/variant
- 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/spirit_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\spirit_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/spirit_x4/build/_deps
# Adapt CMP0168; enable caching in CI
# https://cmake.org/cmake/help/latest/module/FetchContent.html#variable:FETCHCONTENT_UPDATES_DISCONNECTED
- name: Setup Cached CMake Dependencies
id: deps-info
shell: bash
run: |
if [ "${{ steps.cache-deps.outputs.cache-hit }}" = "true" ]; then
echo "BOOST_SPIRIT_X4_CMAKE_ARGS=-DFETCHCONTENT_FULLY_DISCONNECTED=ON" >> "$GITHUB_OUTPUT"
else
echo "BOOST_SPIRIT_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/
cd libs/spirit_x4
cmake ${{ steps.deps-info.outputs.BOOST_SPIRIT_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 }} \
-S .
- name: Build Tests
working-directory: ${{ steps.env-info.outputs.BOOST_ROOT }}/libs/spirit_x4
run: |
cmake --build build --config ${{ matrix.build_type.name }} -j${{ env.BOOST_SPIRIT_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/spirit_x4/build/_deps
- name: Test
env:
CLICOLOR_FORCE: 1
working-directory: ${{ steps.env-info.outputs.BOOST_ROOT }}/libs/spirit_x4/build/test
run: ctest --output-on-failure -C ${{ matrix.build_type.name }}