Merge pull request #141 from boostorg/develop #357
This file contains 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
name: CI | |
on: [push, pull_request] | |
jobs: | |
windows: | |
name: "${{matrix.generator}} ${{matrix.toolset}} Boost ${{matrix.boost_version}} ${{matrix.build_type}} ${{matrix.name_args}}" | |
runs-on: ${{matrix.os}} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
boost_version: ["1.81.0"] | |
os: [windows-2019, windows-2022] | |
toolset: [v142, v143] | |
build_type: [Release] | |
generator: ["Visual Studio 16 2019", "Visual Studio 17 2022"] | |
config_args: [""] | |
build_args: [""] | |
name_args: [""] | |
exclude: | |
- { os: windows-2019, toolset: v143 } | |
- { os: windows-2019, generator: "Visual Studio 17 2022" } | |
- { os: windows-2022, generator: "Visual Studio 16 2019" } | |
# The following combinations are not available through install-boost | |
- { boost_version: "1.81.0", toolset: v143 } | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Add boost toolset to environment | |
if: contains(fromJson('["1.81.0"]'), matrix.boost_version) | |
run: echo BOOST_TOOLSET=$(echo "msvc") >> $GITHUB_ENV | |
# The platform_version passed to boost-install determines the msvc toolset version for which static libs are installed. | |
- name: Add boost platform version to environment | |
run: | | |
declare -A toolset_to_platform_version=( [v142]="2019" [v143]="2022" ) | |
key=$(echo "${{matrix.toolset}}") | |
echo BOOST_PLATFORM_VERSION="${toolset_to_platform_version[$key]}" >> $GITHUB_ENV | |
- name: Add boost install path to environment | |
run: echo BOOST_INSTALL_PATH="${GITHUB_WORKSPACE}/boost-${{matrix.boost_version}}${BOOST_TOOLSET}${BOOST_PLATFORM_VERSION}" >> $GITHUB_ENV | |
- name: Add build type configuration to environment | |
run: echo BUILD_CONFIG_ARG="--config ${{matrix.build_type}}" >> $GITHUB_ENV | |
- name: Cache Boost installation | |
id: cache-boost | |
uses: actions/cache@v3 | |
with: | |
path: ${{env.BOOST_INSTALL_PATH}} | |
key: ${{matrix.boost_version}}${{env.BOOST_TOOLSET}}${{env.BOOST_PLATFORM_VERSION}} | |
- name: Install Boost | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
uses: MarkusJx/[email protected] | |
with: | |
boost_version: ${{matrix.boost_version}} | |
toolset: ${{env.BOOST_TOOLSET}} | |
boost_install_dir: ${{env.BOOST_INSTALL_PATH}} | |
platform_version: ${{env.BOOST_PLATFORM_VERSION}} | |
arch: null | |
- name: Install openssl | |
run: choco install openssl | |
- name: Create build directory | |
run: mkdir build | |
- name: Configure | |
working-directory: build | |
run: | | |
cmake -T "${{matrix.toolset}}" \ | |
-G "${{matrix.generator}}" \ | |
${{matrix.config_args}} \ | |
${BOOST_COMPILER_ARG}\ | |
"${GITHUB_WORKSPACE}" | |
env: | |
BOOST_ROOT: ${{env.BOOST_INSTALL_PATH}}/boost | |
- name: Build | |
working-directory: build | |
run: | | |
cmake --build . ${BUILD_CONFIG_ARG} ${{matrix.build_args}} | |
posix: | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { toolset: gcc, compiler: g++-11, install: g++-11, os: ubuntu-22.04, cxxflags: '-std=c++17', ldflags: '' } | |
- { toolset: gcc, compiler: g++-11, install: g++-11, os: ubuntu-22.04, cxxflags: '-std=c++20', ldflags: '' } | |
- { toolset: clang, compiler: clang++-11, install: clang-11, os: ubuntu-22.04, cxxflags: '-std=c++17', ldflags: '' } | |
- { toolset: clang, compiler: clang++-11, install: clang-11, os: ubuntu-22.04, cxxflags: '-std=c++20', ldflags: '' } | |
- { toolset: clang, compiler: clang++-13, install: clang-13, os: ubuntu-22.04, cxxflags: '-std=c++17', ldflags: '' } | |
- { toolset: clang, compiler: clang++-13, install: clang-13, os: ubuntu-22.04, cxxflags: '-std=c++20', ldflags: '' } | |
- { toolset: clang, compiler: clang++-14, install: 'clang-14 libc++-14-dev libc++abi-14-dev', os: ubuntu-22.04, cxxflags: '-std=c++17 -stdlib=libc++', ldflags: '-lc++' } | |
- { toolset: clang, compiler: clang++-14, install: 'clang-14 libc++-14-dev libc++abi-14-dev', os: ubuntu-22.04, cxxflags: '-std=c++20 -stdlib=libc++', ldflags: '-lc++' } | |
runs-on: ${{ matrix.os }} | |
env: | |
CXXFLAGS: -g -O0 ${{matrix.cxxflags}} -Wall -Wextra | |
LDFLAGS: ${{matrix.ldflags}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install CMake | |
run: sudo apt-get -y install cmake | |
- name: Install protobuf | |
run: sudo apt-get -y install protobuf-compiler | |
- name: Install compiler | |
run: sudo apt-get install -y ${{ matrix.install }} | |
- name: Install Redis | |
run: sudo apt-get install -y redis-server | |
- name: Install boost | |
uses: MarkusJx/[email protected] | |
id: install-boost | |
with: | |
boost_version: 1.81.0 | |
platform_version: 22.04 | |
- name: Run CMake | |
run: | | |
BOOST_ROOT=${{steps.install-boost.outputs.BOOST_ROOT}} cmake -DCMAKE_CXX_COMPILER="${{matrix.compiler}}" -DCMAKE_CXX_FLAGS="${{env.CXXFLAGS}}" -DCMAKE_EXE_LINKER_FLAGS="${{env.LDFLAGS}}" | |
- name: Build | |
run: make | |
- name: Check | |
run: ctest --output-on-failure |