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
31 changes: 25 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
# Generated by `boostdep --cmake sort`
# Copyright 2020 Peter Dimov
# Copyright 2025 Nigel Stewart
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt

cmake_minimum_required(VERSION 3.5...3.16)
message(STATUS "Using cmake version ${CMAKE_VERSION}")

project(boost_sort VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
cmake_minimum_required(VERSION 3.10...3.16)

if(BOOST_SUPERPROJECT_VERSION)
project(boost_sort VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
else()
project(boost_sort LANGUAGES CXX)
endif()

# Test coverage in stand-alone mode requires boost dependencies
if(BUILD_TESTING AND NOT BOOST_SUPERPROJECT_VERSION)
set(Boost_DEBUG ON)
find_package(Boost 1.85 REQUIRED COMPONENTS core range included_test_exec_monitor)
endif()

add_library(boost_sort INTERFACE)
add_library(Boost::sort ALIAS boost_sort)
Expand All @@ -21,11 +34,17 @@ target_link_libraries(boost_sort
Boost::type_traits
)

# Testing
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")

include(CTest)
enable_testing()
add_subdirectory(test)
if(NOT BOOST_SUPERPROJECT_VERSION)
include(CTest)
enable_testing()
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
add_dependencies(check tests)
endif()

# Follow the Boost convention: don't build test targets by default,
# and only when explicitly requested by building target tests
add_subdirectory(test EXCLUDE_FROM_ALL)
endif()

4 changes: 2 additions & 2 deletions benchmark/parallel/runCLANG_benchmark_numbers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ echo "=================================================================="
echo "."
echo "C O M P I L I N G . . . . . . . . . . ."
echo "."
clang++ ./file_generator.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -s -o file_generator
clang++ ./file_generator.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -s -o file_generator

clang++ ./benchmark_numbers.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -pthread -s -lpthread -o benchmark_numbers
clang++ ./benchmark_numbers.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -pthread -s -lpthread -o benchmark_numbers

echo "R U N N I N G . . . . . . . . . . ."
echo "( The time needed is around 10 minutes depending of your machine )"
Expand Down
4 changes: 2 additions & 2 deletions benchmark/parallel/runCLANG_benchmark_objects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ echo "=================================================================="
echo "."
echo "C O M P I L I N G . . . . . . . . . . ."

clang++ ./file_generator.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -s -o file_generator
clang++ ./file_generator.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -s -o file_generator

clang++ ./benchmark_objects.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -pthread -s -lpthread -o benchmark_objects
clang++ ./benchmark_objects.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -pthread -s -lpthread -o benchmark_objects
echo "."
echo "R U N N I N G . . . . . . . . . . ."
echo "( The time needed is around 60 minutes depending of your machine )"
Expand Down
4 changes: 2 additions & 2 deletions benchmark/parallel/runCLANG_benchmark_strings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ echo "=================================================================="
echo "."
echo "C O M P I L I N G . . . . . . . . . . ."
echo "."
g++ ./file_generator.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -s -o file_generator
g++ ./file_generator.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -s -o file_generator

g++ ./benchmark_strings.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -pthread -s -lpthread -o benchmark_strings
g++ ./benchmark_strings.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -pthread -s -lpthread -o benchmark_strings

echo "R U N N I N G . . . . . . . . . . ."
echo "( The time needed is around 10 minutes depending of your machine )"
Expand Down
4 changes: 2 additions & 2 deletions benchmark/parallel/runGCC_benchmark_numbers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ echo "=================================================================="
echo "."
echo "C O M P I L I N G . . . . . . . . . . ."
echo "."
g++ ./file_generator.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -s -o file_generator
g++ ./file_generator.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -s -o file_generator

g++ ./benchmark_numbers.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -pthread -s -lpthread -o benchmark_numbers
g++ ./benchmark_numbers.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -pthread -s -lpthread -o benchmark_numbers

echo "R U N N I N G . . . . . . . . . . ."
echo "( The time needed is around 10 minutes depending of your machine )"
Expand Down
4 changes: 2 additions & 2 deletions benchmark/parallel/runGCC_benchmark_objects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ echo "=================================================================="
echo "."
echo "C O M P I L I N G . . . . . . . . . . ."

g++ ./file_generator.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -s -o file_generator
g++ ./file_generator.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -s -o file_generator

g++ ./benchmark_objects.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -pthread -s -lpthread -o benchmark_objects
g++ ./benchmark_objects.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -pthread -s -lpthread -o benchmark_objects
echo "."
echo "R U N N I N G . . . . . . . . . . ."
echo "( The time needed is around 60 minutes depending of your machine )"
Expand Down
4 changes: 2 additions & 2 deletions benchmark/parallel/runGCC_benchmark_strings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ echo "=================================================================="
echo "."
echo "C O M P I L I N G . . . . . . . . . . ."
echo "."
g++ ./file_generator.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -s -o file_generator
g++ ./file_generator.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -s -o file_generator

g++ ./benchmark_strings.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -pthread -s -lpthread -o benchmark_strings
g++ ./benchmark_strings.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -pthread -s -lpthread -o benchmark_strings

echo "R U N N I N G . . . . . . . . . . ."
echo "( The time needed is around 10 minutes depending of your machine )"
Expand Down
4 changes: 2 additions & 2 deletions benchmark/single/runCLANG_benchmark_numbers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ echo "=================================================================="
echo "."
echo "C O M P I L I N G . . . . . . . . . . ."
echo "."
clang++ ./file_generator.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -s -o file_generator
clang++ ./file_generator.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -s -o file_generator

clang++ ./benchmark_numbers.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -s -o benchmark_numbers
clang++ ./benchmark_numbers.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -s -o benchmark_numbers

echo "R U N N I N G . . . . . . . . . . ."
echo "( The time needed is around 10 minutes depending of your machine )"
Expand Down
4 changes: 2 additions & 2 deletions benchmark/single/runCLANG_benchmark_objects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ echo "=================================================================="
echo "."
echo "C O M P I L I N G . . . . . . . . . . ."

clang++ ./file_generator.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -s -o file_generator
clang++ ./file_generator.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -s -o file_generator

clang++ ./benchmark_objects.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -s -o benchmark_objects
clang++ ./benchmark_objects.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -s -o benchmark_objects
echo "."
echo "R U N N I N G . . . . . . . . . . ."
echo "( The time needed is around 45 minutes depending of your machine )"
Expand Down
4 changes: 2 additions & 2 deletions benchmark/single/runCLANG_benchmark_strings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ echo "=================================================================="
echo "."
echo "C O M P I L I N G . . . . . . . . . . ."
echo "."
clang++ ./file_generator.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -s -o file_generator
clang++ ./file_generator.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -s -o file_generator

clang++ ./benchmark_strings.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -s -o benchmark_strings
clang++ ./benchmark_strings.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -s -o benchmark_strings

echo "R U N N I N G . . . . . . . . . . ."
echo "( The time needed is around 10 minutes depending of your machine )"
Expand Down
4 changes: 2 additions & 2 deletions benchmark/single/runGCC_benchmark_numbers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ echo "=================================================================="
echo "."
echo "C O M P I L I N G . . . . . . . . . . ."
echo "."
g++ ./file_generator.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -s -o file_generator
g++ ./file_generator.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -s -o file_generator

g++ ./benchmark_numbers.cpp -std=c++11 -march=native -w -fno-exceptions -fno-operator-names -O3 -I../../include -s -o benchmark_numbers
g++ ./benchmark_numbers.cpp -std=c++11 -march=native -w -fno-operator-names -O3 -I../../include -s -o benchmark_numbers

echo "R U N N I N G . . . . . . . . . . ."
echo "( The time needed is around 10 minutes depending of your machine )"
Expand Down
Loading