Skip to content
Merged
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
197 changes: 176 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: GitHub Actions CI
name: CI

on:
pull_request:
Expand All @@ -18,47 +18,202 @@ jobs:
matrix:
include:
- name: "g++-13"
os: ubuntu-latest
os: ubuntu-24.04
packages: "g++-13"
toolset: "gcc-13"
- name: "clang-15"
os: ubuntu-latest
packages: "clang-15"
toolset: "clang-15"
cxxstd: 11,14,17,20,2b
- name: "clang-19"
os: ubuntu-24.04
packages: "clang-19"
toolset: "clang-19"
cxxstd: 11,14,17,20,2b
- name: "xcode"
os: macos-latest
toolset: "clang"
cxxstd: 11,14,17,20,2b
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@main
- name: Install
- name: Install packages
if: matrix.packages
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get -o Acquire::Retries=3 update -y
sudo apt-get -o Acquire::Retries=3 -y install ${{matrix.packages}}
- name: Setup
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
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 && ( test "${GITHUB_REF_NAME}" == "master" || test "${GITHUB_REF_NAME}" == "modular" ) && BOOST_BRANCH=${GITHUB_REF_NAME} || true
BOOST_GIT=https://github.com/${GITHUB_REPOSITORY/sort/boost}.git
echo BOOST_GIT: ${BOOST_GIT}
echo BOOST_BRANCH: ${BOOST_BRANCH}
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b "${BOOST_BRANCH}" --depth 1 "${BOOST_GIT}" boost-root
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init --jobs 3 tools/boostdep libs/assert libs/config libs/core libs/test libs/sort
python tools/boostdep/depinst/depinst.py -X test -g "--jobs 3" test
python tools/boostdep/depinst/depinst.py -X test -g "--jobs 3" sort
rm -rf libs/sort/*
cp -r $GITHUB_WORKSPACE/* libs/sort
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
./bootstrap.sh
./b2 -d0 headers
- name: Test
- name: Run tests
run: |
cd ../boost-root
./b2 -j3 libs/sort/test toolset=${{matrix.toolset}} cxxstd=11,14,17,20
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release

posix-cmake-subdir:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: macos-latest

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_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
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
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY

- name: Use library with add_subdirectory
run: |
cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test
mkdir __build__ && cd __build__
cmake ..
cmake --build .
ctest --output-on-failure --no-tests=error

posix-cmake-install:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: macos-latest

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_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
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
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY

- name: Configure
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local ..

- name: Install
run: |
cd ../boost-root/__build__
cmake --build . --target install

- name: Use the installed library
run: |
cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
cmake --build .
ctest --output-on-failure --no-tests=error

posix-cmake-test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: macos-latest

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_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
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
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY

- name: Configure
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON ..

- name: Build tests
run: |
cd ../boost-root/__build__
cmake --build . --target tests

- name: Run tests
run: |
cd ../boost-root/__build__
ctest --output-on-failure --no-tests=error
17 changes: 17 additions & 0 deletions test/cmake_install_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2018, 2019 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt

cmake_minimum_required(VERSION 3.5...3.16)

project(cmake_install_test LANGUAGES CXX)

find_package(boost_sort REQUIRED)

add_executable(main main.cpp)
target_link_libraries(main Boost::sort)

enable_testing()
add_test(main main)

add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
8 changes: 8 additions & 0 deletions test/cmake_install_test/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <boost/sort/spreadsort/integer_sort.hpp>

int main()
{
int v[] = { 1, 2, 3, 0 };
boost::sort::spreadsort::integer_sort( v + 0, v + 4 );
return v[ 0 ];
}
18 changes: 18 additions & 0 deletions test/cmake_subdir_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2018, 2019 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt

cmake_minimum_required(VERSION 3.5...3.16)

project(cmake_subdir_test LANGUAGES CXX)

set(BOOST_INCLUDE_LIBRARIES sort)
add_subdirectory(../../../.. boostorg/boost)

add_executable(main main.cpp)
target_link_libraries(main Boost::sort)

enable_testing()
add_test(main main)

add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
8 changes: 8 additions & 0 deletions test/cmake_subdir_test/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <boost/sort/spreadsort/integer_sort.hpp>

int main()
{
int v[] = { 1, 2, 3, 0 };
boost::sort::spreadsort::integer_sort( v + 0, v + 4 );
return v[ 0 ];
}