Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 178 additions & 0 deletions .github/workflows/boost_root.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
name: Boost CI

on:
workflow_dispatch:
inputs:
branch:
description: 'Boost branch to run for'
required: false
default: 'auto'
options:
- auto
- master
- develop
pull_request:
push:
branches:
- master
- develop
- feature/**

env:
UBSAN_OPTIONS: print_stacktrace=1

jobs:
BoostRoot:
strategy:
matrix:
enable_test: [ON, OFF]
cmake_version: [default, 3.8.0, 3.9.0, 3.10.0, 3.11.0, 3.12.0, 3.13.0, 3.14.0, 3.16.0, 3.19.0, 3.31.0, 4.0.0, 4.1.0]
fail-fast: false

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup Boost
run: |
BOOST_BRANCH="${{inputs.branch}}"
if [[ -z $BOOST_BRANCH ]]; then
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
[[ "$REF" == "master" ]] && BOOST_BRANCH=master || BOOST_BRANCH=develop
fi
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init --jobs 3
rm -rf tools/cmake/*
cp -r $GITHUB_WORKSPACE/* tools/cmake
- name: Configure each library independently
working-directory: ../boost-root
if: matrix.cmake_version == 'default'
run: |
failed_libs=""
failed_outputs=()
for cml in libs/*/CMakeLists.txt; do
lib=$(dirname "${cml#*libs/}")
echo "====================================================================="
echo "Building $lib"
echo "====================================================================="
error=0
out=$(cmake -DBUILD_TESTING=${{matrix.enable_test}} -DBOOST_INCLUDE_LIBRARIES=$lib -DBoost_DEBUG=ON -B "__build_$lib" . 2>&1) || error=1
echo "$out"
echo; echo; echo
[[ "$out" != *"BOOST_INCLUDE_LIBRARIES has not been found"* ]] || error=1
[[ "$out" != *"CMake Error"* ]] || error=1
if ((error==1)); then
failed_libs+=" $lib"
failed_outputs+=(
"====================================================================="
"Output of $lib"
"$out"
)
fi
done
if [[ -n $failed_libs ]]; then
echo "Failed libraries: $failed_libs"
printf '%s\n' "${failed_outputs[@]}"
exit 1
fi

- name: Cache CMake
if: matrix.cmake_version != 'default'
id: cache-cmake
uses: actions/cache@v4
with:
path: /tmp/cmake
key: ${{ runner.os }}-cmake-${{matrix.cmake_version}}

- name: Install CMake dependencies
if: matrix.cmake_version != 'default'
run: sudo apt-get -o Acquire::Retries=3 -y -q --no-install-suggests --no-install-recommends install curl libcurl4-openssl-dev libarchive-dev

- name: Build CMake
if: matrix.cmake_version != 'default' && steps.cache-cmake.outputs.cache-hit != 'true'
run: |
version=${{matrix.cmake_version}}
filename="cmake-$version.tar.gz"
cd "$(mktemp -d)"
wget https://cmake.org/files/v${version%.*}/$filename
tar -xf $filename --strip-components=1
flags=(
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_INSTALL_PREFIX=/tmp/cmake"
"-B" "__build"
"-Wno-dev" # Make configuring more silent
"-DCMAKE_USE_SYSTEM_CURL=1" # Avoid failures caused by newer (system) OpenSSL in CMake < 3.10
"-DCMAKE_CXX_FLAGS='-include cstdint -include limits'" # Fix missing includes in CMake < 3.10
)
cmake "${flags[@]}" .
cmake --build __build -- -j 3
cmake --build __build --target install

- name: Configure Boost with CMake ${{matrix.cmake_version}}
working-directory: ../boost-root
if: matrix.cmake_version != 'default'
run: |
version_greater_equal() { printf '%s\n' "$2" "$1" | sort --check=quiet --version-sort; }
excluded=()
for cml in "$PWD"/libs/*/CMakeLists.txt "$PWD"/libs/numeric/*/CMakeLists.txt; do
lib=$(dirname "${cml#*libs/}")
if minimal_cmake_version=$(grep "cmake_minimum_required" "$cml" | grep -Eo '[0-9]\.[0-9]+' | head -1); then
version_greater_equal ${{matrix.cmake_version}} "$minimal_cmake_version" || excluded+=("$lib")
else
echo "Minimum required CMake version not found in $cml for library $lib"
fi
done
# Libraries that don't declare their correct minimal required CMake version or where dependencies require higher version
version_greater_equal ${{matrix.cmake_version}} 3.12.0 || excluded+=("msm")
version_greater_equal ${{matrix.cmake_version}} 3.14.0 || excluded+=("pfr" "mysql") # mysql depends on pfr
/tmp/cmake/bin/cmake --version
/tmp/cmake/bin/cmake -DBUILD_TESTING=${{matrix.enable_test}} -DBOOST_EXCLUDE_LIBRARIES="$(IFS=';'; echo "${excluded[*]}")" -B "__build_cmake-$version" .

posix-check-quick:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, macos-15 ]
shared: [ ON, OFF ]

runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v4

- name: Install packages
if: matrix.install
run: sudo apt install ${{matrix.install}}

- name: Setup Boost
run: |
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init --jobs 3
rm -rf tools/cmake/*
cp -r $GITHUB_WORKSPACE/* tools/cmake

- name: Configure Boost
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBoost_VERBOSE=${{matrix.verbose}} -DBUILD_TESTING=ON -DBUILD_SHARED_LIBS=${{matrix.shared}} ..

- name: Test Boost
run: |
cd ../boost-root/__build__
cmake --build . --target check-quick

151 changes: 0 additions & 151 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -382,114 +382,6 @@ jobs:
PATH C:\Boost\bin;%PATH%
cmake --build . --config Release && ctest --output-on-failure --no-tests=error -j 3 -C Release

BoostRoot:
strategy:
matrix:
enable_test: [ON, OFF]
cmake_version: [default, 3.8.0, 3.9.0, 3.10.0, 3.11.0, 3.12.0, 3.13.0, 3.14.0, 3.16.0, 3.19.0, 3.31.0, 4.0.0, 4.1.0]
fail-fast: false

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup Boost
run: |
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init --jobs 3
rm -rf tools/cmake/*
cp -r $GITHUB_WORKSPACE/* tools/cmake
- name: Configure each library independently
working-directory: ../boost-root
if: matrix.cmake_version == 'default'
run: |
failed_libs=""
failed_outputs=()
for cml in libs/*/CMakeLists.txt; do
lib=$(dirname "${cml#*libs/}")
echo "====================================================================="
echo "Building $lib"
echo "====================================================================="
error=0
out=$(cmake -DBUILD_TESTING=${{matrix.enable_test}} -DBOOST_INCLUDE_LIBRARIES=$lib -DBoost_DEBUG=ON -B "__build_$lib" . 2>&1) || error=1
echo "$out"
echo; echo; echo
[[ "$out" != *"BOOST_INCLUDE_LIBRARIES has not been found"* ]] || error=1
[[ "$out" != *"CMake Error"* ]] || error=1
if ((error==1)); then
failed_libs+=" $lib"
failed_outputs+=(
"====================================================================="
"Output of $lib"
"$out"
)
fi
done
if [[ -n $failed_libs ]]; then
echo "Failed libraries: $failed_libs"
printf '%s\n' "${failed_outputs[@]}"
exit 1
fi

- name: Cache CMake
if: matrix.cmake_version != 'default'
id: cache-cmake
uses: actions/cache@v4
with:
path: /tmp/cmake
key: ${{ runner.os }}-cmake-${{matrix.cmake_version}}

- name: Install CMake dependencies
if: matrix.cmake_version != 'default'
run: sudo apt-get -o Acquire::Retries=3 -y -q --no-install-suggests --no-install-recommends install curl libcurl4-openssl-dev libarchive-dev

- name: Build CMake
if: matrix.cmake_version != 'default' && steps.cache-cmake.outputs.cache-hit != 'true'
run: |
version=${{matrix.cmake_version}}
filename="cmake-$version.tar.gz"
cd "$(mktemp -d)"
wget https://cmake.org/files/v${version%.*}/$filename
tar -xf $filename --strip-components=1
flags=(
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_INSTALL_PREFIX=/tmp/cmake"
"-B" "__build"
"-Wno-dev" # Make configuring more silent
"-DCMAKE_USE_SYSTEM_CURL=1" # Avoid failures caused by newer (system) OpenSSL in CMake < 3.10
"-DCMAKE_CXX_FLAGS='-include cstdint -include limits'" # Fix missing includes in CMake < 3.10
)
cmake "${flags[@]}" .
cmake --build __build -- -j 3
cmake --build __build --target install

- name: Configure Boost with CMake ${{matrix.cmake_version}}
working-directory: ../boost-root
if: matrix.cmake_version != 'default'
run: |
version_greater_equal() { printf '%s\n' "$2" "$1" | sort --check=quiet --version-sort; }
excluded=()
for cml in "$PWD"/libs/*/CMakeLists.txt "$PWD"/libs/numeric/*/CMakeLists.txt; do
lib=$(dirname "${cml#*libs/}")
if minimal_cmake_version=$(grep "cmake_minimum_required" "$cml" | grep -Eo '[0-9]\.[0-9]+' | head -1); then
version_greater_equal ${{matrix.cmake_version}} "$minimal_cmake_version" || excluded+=("$lib")
else
echo "Minimum required CMake version not found in $cml for library $lib"
fi
done
# Libraries that don't declare their correct minimal required CMake version or where dependencies require higher version
version_greater_equal ${{matrix.cmake_version}} 3.12.0 || excluded+=("msm")
version_greater_equal ${{matrix.cmake_version}} 3.14.0 || excluded+=("pfr" "mysql") # mysql depends on pfr
/tmp/cmake/bin/cmake --version
/tmp/cmake/bin/cmake -DBUILD_TESTING=${{matrix.enable_test}} -DBOOST_EXCLUDE_LIBRARIES="$(IFS=';'; echo "${excluded[*]}")" -B "__build_cmake-$version" .

BoostTest:
strategy:
fail-fast: false
Expand Down Expand Up @@ -709,49 +601,6 @@ jobs:
cd ../boost-root/__build__
cmake --build . --target check

posix-check-quick:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, macos-15 ]
shared: [ ON, OFF ]

runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v4

- name: Install packages
if: matrix.install
run: sudo apt install ${{matrix.install}}

- name: Setup Boost
run: |
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init --jobs 3
rm -rf tools/cmake/*
cp -r $GITHUB_WORKSPACE/* tools/cmake

- name: Configure Boost
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBoost_VERBOSE=${{matrix.verbose}} -DBUILD_TESTING=ON -DBUILD_SHARED_LIBS=${{matrix.shared}} ..

- name: Test Boost
run: |
cd ../boost-root/__build__
cmake --build . --target check-quick

posix-install:
strategy:
fail-fast: false
Expand Down