diff --git a/.drone.star b/.drone.star new file mode 100644 index 00000000..ea7871df --- /dev/null +++ b/.drone.star @@ -0,0 +1,66 @@ +# +# Copyright (c) 2019-2025 Ruben Perez Hidalgo (rubenperez038 at gmail dot com) +# +# 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) +# + +_triggers = { "branch": [ "master", "develop" ] } + + +def pipeline( + name, + toolset, + build_type, + cxxstd, + generator, + build_shared_libs, + cxxflags = "" +): + + common_args = "--build-type {} --cxxstd {} --toolset {} --generator '{}' --build-shared-libs {} --cxxflags={}".format( + build_type, cxxstd, toolset, generator, build_shared_libs, cxxflags) + + return { + "name": name, + "kind": "pipeline", + "type": "docker", + "trigger": _triggers, + "platform": { + "os": "windows" + }, + "clone": { + "retries": 5 + }, + "node": {}, + "environment": { + "OPENSSL_ROOT_DIR": "C:/Program Files/OpenSSL-Win64", + }, + "steps": [{ + "name": "Build and run", + "image": "cppalliance/dronevs2019:2", + "pull": "if-not-exists", + "commands": [ + "choco install -y --no-progress openssl", + "python tools/ci.py setup-boost --source-dir=$Env:DRONE_WORKSPACE", + # "python tools/ci.py build-b2-distro --toolset {}".format(toolset), + "python tools/ci.py build-cmake-distro {} --integration-tests 0".format(common_args), + "python tools/ci.py run-cmake-add-subdirectory-tests {}".format(common_args), + "python tools/ci.py run-cmake-find-package-tests {}".format(common_args), + "python tools/ci.py run-cmake-b2-find-package-tests {}".format(common_args), + ] + }] + } + + +def main(ctx): + return [ + pipeline( + name = "MSVC 14.2", + toolset = "msvc-14.2", + build_type = "Release", + cxxstd = "20", + generator = "Visual Studio 16 2019", + build_shared_libs = 0, + ), + ] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ae26571..cc651211 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,584 +1,584 @@ -# CI script to verify that CMake and B2 builds work. -# B2 builds include only tests that don't require a DB server, to avoid race conditions. -# CMake tests include the actual project tests and all the CMake integration workflows -# recommended by Boost.CI. -# Windows CMake jobs build the code but don't run the tests, -# since we don't have a way to set up a Redis server on Windows (yet). -# Subcommands are implemented by the tools/ci.py script in a platform-independent manner. - -name: CI - -on: [push, pull_request] - -jobs: - windows-cmake: - name: "CMake ${{matrix.toolset}} ${{matrix.build-type}} C++${{matrix.cxxstd}}" - runs-on: ${{matrix.os}} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - include: - #- { toolset: msvc-14.2, os: windows-2019, generator: "Visual Studio 16 2019", cxxstd: '17', build-type: 'Debug', build-shared-libs: 1 } - #- { toolset: msvc-14.2, os: windows-2019, generator: "Visual Studio 16 2019", cxxstd: '17', build-type: 'Release', build-shared-libs: 0 } - - { toolset: msvc-14.3, os: windows-2022, generator: "Visual Studio 17 2022", cxxstd: '20', build-type: 'Debug', build-shared-libs: 0 } - - { toolset: msvc-14.3, os: windows-2022, generator: "Visual Studio 17 2022", cxxstd: '20', build-type: 'Release', build-shared-libs: 1 } - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup Boost - run: python3 tools/ci.py setup-boost --source-dir=$(pwd) - - - name: Build a Boost distribution using B2 - run: | - python3 tools/ci.py build-b2-distro \ - --toolset ${{ matrix.toolset }} - - # No Redis server is available on this job, so integration tests are skipped. - # Unit tests are built and run via the CMake superproject build. - # Double backslash '//' prevents MSYS from interpreting flags as paths - - name: Build a Boost distribution and run the tests using CMake - run: | - python3 tools/ci.py build-cmake-distro \ - --build-type ${{ matrix.build-type }} \ - --cxxstd ${{ matrix.cxxstd }} \ - --toolset ${{ matrix.toolset }} \ - --generator "${{ matrix.generator }}" \ - --build-shared-libs ${{ matrix.build-shared-libs }} \ - --integration-tests 0 \ - "--cxxflags=//WX" - - - name: Run add_subdirectory tests - run: | - python3 tools/ci.py run-cmake-add-subdirectory-tests \ - --build-type ${{ matrix.build-type }} \ - --cxxstd ${{ matrix.cxxstd }} \ - --toolset ${{ matrix.toolset }} \ - --generator "${{ matrix.generator }}" \ - --build-shared-libs ${{ matrix.build-shared-libs }} \ - "--cxxflags=//WX" - - - name: Run find_package tests with the built cmake distribution - run: | - python3 tools/ci.py run-cmake-find-package-tests \ - --build-type ${{ matrix.build-type }} \ - --cxxstd ${{ matrix.cxxstd }} \ - --toolset ${{ matrix.toolset }} \ - --generator "${{ matrix.generator }}" \ - --build-shared-libs ${{ matrix.build-shared-libs }} \ - "--cxxflags=//WX" - - - name: Run find_package tests with the built b2 distribution - run: | - python3 tools/ci.py run-cmake-b2-find-package-tests \ - --build-type ${{ matrix.build-type }} \ - --cxxstd ${{ matrix.cxxstd }} \ - --toolset ${{ matrix.toolset }} \ - --generator "${{ matrix.generator }}" \ - --build-shared-libs ${{ matrix.build-shared-libs }} \ - "--cxxflags=//WX" - - windows-b2: - name: "B2 ${{matrix.toolset}}" - runs-on: ${{matrix.os}} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - include: - #- { toolset: msvc-14.2, os: windows-2019 } - - { toolset: msvc-14.3, os: windows-2022 } - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup user-config.jam - run: cp tools/user-config-win-gha.jam "${HOMEDRIVE}${HOMEPATH}/user-config.jam" - - - name: Setup Boost - run: python3 tools/ci.py setup-boost --source-dir=$(pwd) +# # CI script to verify that CMake and B2 builds work. +# # B2 builds include only tests that don't require a DB server, to avoid race conditions. +# # CMake tests include the actual project tests and all the CMake integration workflows +# # recommended by Boost.CI. +# # Windows CMake jobs build the code but don't run the tests, +# # since we don't have a way to set up a Redis server on Windows (yet). +# # Subcommands are implemented by the tools/ci.py script in a platform-independent manner. + +# name: CI + +# on: [push, pull_request] + +# jobs: +# windows-cmake: +# name: "CMake ${{matrix.toolset}} ${{matrix.build-type}} C++${{matrix.cxxstd}}" +# runs-on: ${{matrix.os}} +# defaults: +# run: +# shell: bash +# strategy: +# fail-fast: false +# matrix: +# include: +# #- { toolset: msvc-14.2, os: windows-2019, generator: "Visual Studio 16 2019", cxxstd: '17', build-type: 'Debug', build-shared-libs: 1 } +# #- { toolset: msvc-14.2, os: windows-2019, generator: "Visual Studio 16 2019", cxxstd: '17', build-type: 'Release', build-shared-libs: 0 } +# - { toolset: msvc-14.3, os: windows-2022, generator: "Visual Studio 17 2022", cxxstd: '20', build-type: 'Debug', build-shared-libs: 0 } +# - { toolset: msvc-14.3, os: windows-2022, generator: "Visual Studio 17 2022", cxxstd: '20', build-type: 'Release', build-shared-libs: 1 } +# steps: +# - name: Checkout +# uses: actions/checkout@v6 + +# - name: Setup Boost +# run: python3 tools/ci.py setup-boost --source-dir=$(pwd) + +# - name: Build a Boost distribution using B2 +# run: | +# python3 tools/ci.py build-b2-distro \ +# --toolset ${{ matrix.toolset }} + +# # No Redis server is available on this job, so integration tests are skipped. +# # Unit tests are built and run via the CMake superproject build. +# # Double backslash '//' prevents MSYS from interpreting flags as paths +# - name: Build a Boost distribution and run the tests using CMake +# run: | +# python3 tools/ci.py build-cmake-distro \ +# --build-type ${{ matrix.build-type }} \ +# --cxxstd ${{ matrix.cxxstd }} \ +# --toolset ${{ matrix.toolset }} \ +# --generator "${{ matrix.generator }}" \ +# --build-shared-libs ${{ matrix.build-shared-libs }} \ +# --integration-tests 0 \ +# "--cxxflags=//WX" + +# - name: Run add_subdirectory tests +# run: | +# python3 tools/ci.py run-cmake-add-subdirectory-tests \ +# --build-type ${{ matrix.build-type }} \ +# --cxxstd ${{ matrix.cxxstd }} \ +# --toolset ${{ matrix.toolset }} \ +# --generator "${{ matrix.generator }}" \ +# --build-shared-libs ${{ matrix.build-shared-libs }} \ +# "--cxxflags=//WX" + +# - name: Run find_package tests with the built cmake distribution +# run: | +# python3 tools/ci.py run-cmake-find-package-tests \ +# --build-type ${{ matrix.build-type }} \ +# --cxxstd ${{ matrix.cxxstd }} \ +# --toolset ${{ matrix.toolset }} \ +# --generator "${{ matrix.generator }}" \ +# --build-shared-libs ${{ matrix.build-shared-libs }} \ +# "--cxxflags=//WX" + +# - name: Run find_package tests with the built b2 distribution +# run: | +# python3 tools/ci.py run-cmake-b2-find-package-tests \ +# --build-type ${{ matrix.build-type }} \ +# --cxxstd ${{ matrix.cxxstd }} \ +# --toolset ${{ matrix.toolset }} \ +# --generator "${{ matrix.generator }}" \ +# --build-shared-libs ${{ matrix.build-shared-libs }} \ +# "--cxxflags=//WX" + +# windows-b2: +# name: "B2 ${{matrix.toolset}}" +# runs-on: ${{matrix.os}} +# defaults: +# run: +# shell: bash +# strategy: +# fail-fast: false +# matrix: +# include: +# #- { toolset: msvc-14.2, os: windows-2019 } +# - { toolset: msvc-14.3, os: windows-2022 } +# steps: +# - name: Checkout +# uses: actions/checkout@v6 + +# - name: Setup user-config.jam +# run: cp tools/user-config-win-gha.jam "${HOMEDRIVE}${HOMEPATH}/user-config.jam" + +# - name: Setup Boost +# run: python3 tools/ci.py setup-boost --source-dir=$(pwd) - - name: Build and run project tests using B2 - run: | - python3 tools/ci.py run-b2-tests \ - --toolset ${{ matrix.toolset }} \ - --cxxstd 17,20 \ - --variant debug,release - - linux-cmake: - name: "CMake ${{ matrix.toolset }} ${{ matrix.cxxstd }} ${{ matrix.build-type }} ${{ matrix.cxxflags }}" - defaults: - run: - shell: bash - - strategy: - fail-fast: false - matrix: - include: - # gcc-11 is the default in Ubuntu 22.04, defaults to c++17 - - toolset: gcc-11 - install: g++-11 - container: ubuntu:22.04 - cxxstd: '17' - build-type: 'Debug' - server: "redis:8.2.1-alpine" - corosio-tests: '0' - - - toolset: gcc-11 - install: g++-11 - container: ubuntu:22.04 - cxxstd: '20' - build-type: 'Debug' - server: "valkey/valkey:8.1.3-alpine" - corosio-tests: '0' - - - toolset: gcc-11 - install: g++-11 - container: ubuntu:22.04 - cxxstd: '20' - build-type: 'Release' - server: "redis:7.4.5-alpine" - corosio-tests: '0' - - - toolset: gcc-12 - install: g++-12 - container: ubuntu:22.04 - cxxstd: '23' - build-type: 'Debug' - server: "redis:8.2.1-alpine" - - # gcc-13 is the default in Ubuntu 24.04, defaults to c++17 - - toolset: gcc-13 - install: g++-13 - container: ubuntu:24.04 - cxxstd: '17' - build-type: 'Debug' - server: "valkey/valkey:8.1.3-alpine" - corosio-tests: '0' - - - toolset: gcc-13 - install: g++-13 - container: ubuntu:24.04 - cxxstd: '23' - build-type: 'Debug' - server: "redis:7.4.5-alpine" - - - toolset: gcc-13 - install: g++-13 - container: ubuntu:24.04 - cxxstd: '23' - build-type: 'Release' - server: "redis:8.2.1-alpine" - - - toolset: gcc-14 - install: g++-14 - container: ubuntu:24.04 - cxxstd: '23' - build-type: 'Debug' - server: "valkey/valkey:8.1.3-alpine" - - # gcc-15 is the default in Ubuntu 26.04, defaults to c++17 - - toolset: gcc-15 - install: g++-15 - container: ubuntu:26.04 - cxxstd: '17' - build-type: 'Debug' - server: "redis:7.4.5-alpine" - corosio-tests: '0' - - - toolset: gcc-15 - install: g++-15 - container: ubuntu:26.04 - cxxstd: '26' - build-type: 'Debug' - cxxflags: '-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all' - ldflags: '-fsanitize=address -fsanitize=undefined' - server: "valkey/valkey:8.1.3-alpine" - - - toolset: gcc-15 - install: g++-15 - container: ubuntu:26.04 - cxxstd: '26' - build-type: 'Release' - server: "redis:7.4.5-alpine" - - - toolset: clang-11 - install: clang-11 - container: ubuntu:22.04 - cxxstd: '20' - build-type: 'Debug' - server: "redis:7.4.5-alpine" - corosio-tests: '0' - - - toolset: clang-12 - install: clang-12 - container: ubuntu:22.04 - cxxstd: '20' - build-type: 'Debug' - server: "redis:8.2.1-alpine" - corosio-tests: '0' - - - toolset: clang-13 - install: clang-13 - container: ubuntu:22.04 - cxxstd: '20' - build-type: 'Debug' - server: "valkey/valkey:8.1.3-alpine" - corosio-tests: '0' - - # clang-14 is the default in Ubuntu 22.04 - - toolset: clang-14 - install: clang-14 - container: ubuntu:22.04 - cxxstd: '20' - build-type: 'Debug' - server: "redis:7.4.5-alpine" - corosio-tests: '0' - - - toolset: clang-14 - install: 'clang-14 libc++-14-dev libc++abi-14-dev' - container: ubuntu:22.04 - cxxstd: '20' - build-type: 'Debug' - cxxflags: '-stdlib=libc++' - ldflags: '-lc++' - server: "redis:8.2.1-alpine" - corosio-tests: '0' - - - toolset: clang-14 - install: 'clang-14 libc++-14-dev libc++abi-14-dev' - container: ubuntu:22.04 - cxxstd: '20' - build-type: 'Release' - cxxflags: '-stdlib=libc++' - ldflags: '-lc++' - server: "valkey/valkey:8.1.3-alpine" - - - toolset: clang-15 - install: clang-15 - container: ubuntu:22.04 - cxxstd: '20' - build-type: 'Debug' - server: "redis:7.4.5-alpine" - corosio-tests: '0' - - - toolset: clang-16 - install: clang-16 - container: ubuntu:24.04 - cxxstd: '20' - build-type: 'Debug' - cxxflags: '-DBOOST_ASIO_DISABLE_LOCAL_SOCKETS=1' # If a system has no UNIX socket support, we build correctly - server: "redis:8.2.1-alpine" - corosio-tests: '0' - - - toolset: clang-17 - install: clang-17 - container: ubuntu:24.04 - cxxstd: '20' - build-type: 'Debug' - server: "valkey/valkey:8.1.3-alpine" - - # clang-18 is the default in Ubuntu 24.04 - - toolset: clang-18 - install: clang-18 - container: ubuntu:24.04 - cxxstd: '20' - build-type: 'Debug' - server: "redis:7.4.5-alpine" - - - toolset: clang-18 - install: 'clang-18 libc++-18-dev libc++abi-18-dev' - container: ubuntu:24.04 - cxxstd: '20' - build-type: 'Release' - cxxflags: '-stdlib=libc++' - ldflags: '-lc++' - server: "valkey/valkey:8.1.3-alpine" - - - toolset: clang-18 - install: 'clang-18 libc++-18-dev libc++abi-18-dev' - container: ubuntu:24.04 - cxxstd: '23' - build-type: 'Debug' - cxxflags: '-stdlib=libc++' - ldflags: '-lc++' - server: "redis:8.2.1-alpine" - - - toolset: clang-19 - install: clang-19 - container: ubuntu:24.04 - cxxstd: '23' - build-type: 'Debug' - server: "redis:7.4.5-alpine" - - - toolset: clang-20 - install: clang-20 - container: ubuntu:24.04 - cxxstd: '23' - build-type: 'Debug' - server: "redis:8.2.1-alpine" - - # clang-21 is the default in Ubuntu 26.04 - - toolset: clang-21 - install: 'clang-21 libclang-rt-21-dev' - container: ubuntu:26.04 - cxxstd: '23' - build-type: 'Debug' - cxxflags: '-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all' - ldflags: '-fsanitize=address -fsanitize=undefined' - server: "valkey/valkey:8.1.3-alpine" - - - toolset: clang-21 - install: 'clang-21 libc++-21-dev libc++abi-21-dev' - container: ubuntu:26.04 - cxxstd: '23' - build-type: 'Debug' - cxxflags: '-stdlib=libc++' - ldflags: '-lc++' - server: "redis:7.4.5-alpine" - - - toolset: clang-21 - install: 'clang-21 libc++-21-dev libc++abi-21-dev' - container: ubuntu:26.04 - cxxstd: '23' - build-type: 'Release' - cxxflags: '-stdlib=libc++' - ldflags: '-lc++' - server: "redis:8.2.1-alpine" - - - toolset: clang-22 - install: clang-22 - container: ubuntu:26.04 - cxxstd: '23' - build-type: 'Debug' - server: "valkey/valkey:8.1.3-alpine" - - runs-on: ubuntu-latest +# - name: Build and run project tests using B2 +# run: | +# python3 tools/ci.py run-b2-tests \ +# --toolset ${{ matrix.toolset }} \ +# --cxxstd 17,20 \ +# --variant debug,release + +# linux-cmake: +# name: "CMake ${{ matrix.toolset }} ${{ matrix.cxxstd }} ${{ matrix.build-type }} ${{ matrix.cxxflags }}" +# defaults: +# run: +# shell: bash + +# strategy: +# fail-fast: false +# matrix: +# include: +# # gcc-11 is the default in Ubuntu 22.04, defaults to c++17 +# - toolset: gcc-11 +# install: g++-11 +# container: ubuntu:22.04 +# cxxstd: '17' +# build-type: 'Debug' +# server: "redis:8.2.1-alpine" +# corosio-tests: '0' + +# - toolset: gcc-11 +# install: g++-11 +# container: ubuntu:22.04 +# cxxstd: '20' +# build-type: 'Debug' +# server: "valkey/valkey:8.1.3-alpine" +# corosio-tests: '0' + +# - toolset: gcc-11 +# install: g++-11 +# container: ubuntu:22.04 +# cxxstd: '20' +# build-type: 'Release' +# server: "redis:7.4.5-alpine" +# corosio-tests: '0' + +# - toolset: gcc-12 +# install: g++-12 +# container: ubuntu:22.04 +# cxxstd: '23' +# build-type: 'Debug' +# server: "redis:8.2.1-alpine" + +# # gcc-13 is the default in Ubuntu 24.04, defaults to c++17 +# - toolset: gcc-13 +# install: g++-13 +# container: ubuntu:24.04 +# cxxstd: '17' +# build-type: 'Debug' +# server: "valkey/valkey:8.1.3-alpine" +# corosio-tests: '0' + +# - toolset: gcc-13 +# install: g++-13 +# container: ubuntu:24.04 +# cxxstd: '23' +# build-type: 'Debug' +# server: "redis:7.4.5-alpine" + +# - toolset: gcc-13 +# install: g++-13 +# container: ubuntu:24.04 +# cxxstd: '23' +# build-type: 'Release' +# server: "redis:8.2.1-alpine" + +# - toolset: gcc-14 +# install: g++-14 +# container: ubuntu:24.04 +# cxxstd: '23' +# build-type: 'Debug' +# server: "valkey/valkey:8.1.3-alpine" + +# # gcc-15 is the default in Ubuntu 26.04, defaults to c++17 +# - toolset: gcc-15 +# install: g++-15 +# container: ubuntu:26.04 +# cxxstd: '17' +# build-type: 'Debug' +# server: "redis:7.4.5-alpine" +# corosio-tests: '0' + +# - toolset: gcc-15 +# install: g++-15 +# container: ubuntu:26.04 +# cxxstd: '26' +# build-type: 'Debug' +# cxxflags: '-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all' +# ldflags: '-fsanitize=address -fsanitize=undefined' +# server: "valkey/valkey:8.1.3-alpine" + +# - toolset: gcc-15 +# install: g++-15 +# container: ubuntu:26.04 +# cxxstd: '26' +# build-type: 'Release' +# server: "redis:7.4.5-alpine" + +# - toolset: clang-11 +# install: clang-11 +# container: ubuntu:22.04 +# cxxstd: '20' +# build-type: 'Debug' +# server: "redis:7.4.5-alpine" +# corosio-tests: '0' + +# - toolset: clang-12 +# install: clang-12 +# container: ubuntu:22.04 +# cxxstd: '20' +# build-type: 'Debug' +# server: "redis:8.2.1-alpine" +# corosio-tests: '0' + +# - toolset: clang-13 +# install: clang-13 +# container: ubuntu:22.04 +# cxxstd: '20' +# build-type: 'Debug' +# server: "valkey/valkey:8.1.3-alpine" +# corosio-tests: '0' + +# # clang-14 is the default in Ubuntu 22.04 +# - toolset: clang-14 +# install: clang-14 +# container: ubuntu:22.04 +# cxxstd: '20' +# build-type: 'Debug' +# server: "redis:7.4.5-alpine" +# corosio-tests: '0' + +# - toolset: clang-14 +# install: 'clang-14 libc++-14-dev libc++abi-14-dev' +# container: ubuntu:22.04 +# cxxstd: '20' +# build-type: 'Debug' +# cxxflags: '-stdlib=libc++' +# ldflags: '-lc++' +# server: "redis:8.2.1-alpine" +# corosio-tests: '0' + +# - toolset: clang-14 +# install: 'clang-14 libc++-14-dev libc++abi-14-dev' +# container: ubuntu:22.04 +# cxxstd: '20' +# build-type: 'Release' +# cxxflags: '-stdlib=libc++' +# ldflags: '-lc++' +# server: "valkey/valkey:8.1.3-alpine" + +# - toolset: clang-15 +# install: clang-15 +# container: ubuntu:22.04 +# cxxstd: '20' +# build-type: 'Debug' +# server: "redis:7.4.5-alpine" +# corosio-tests: '0' + +# - toolset: clang-16 +# install: clang-16 +# container: ubuntu:24.04 +# cxxstd: '20' +# build-type: 'Debug' +# cxxflags: '-DBOOST_ASIO_DISABLE_LOCAL_SOCKETS=1' # If a system has no UNIX socket support, we build correctly +# server: "redis:8.2.1-alpine" +# corosio-tests: '0' + +# - toolset: clang-17 +# install: clang-17 +# container: ubuntu:24.04 +# cxxstd: '20' +# build-type: 'Debug' +# server: "valkey/valkey:8.1.3-alpine" + +# # clang-18 is the default in Ubuntu 24.04 +# - toolset: clang-18 +# install: clang-18 +# container: ubuntu:24.04 +# cxxstd: '20' +# build-type: 'Debug' +# server: "redis:7.4.5-alpine" + +# - toolset: clang-18 +# install: 'clang-18 libc++-18-dev libc++abi-18-dev' +# container: ubuntu:24.04 +# cxxstd: '20' +# build-type: 'Release' +# cxxflags: '-stdlib=libc++' +# ldflags: '-lc++' +# server: "valkey/valkey:8.1.3-alpine" + +# - toolset: clang-18 +# install: 'clang-18 libc++-18-dev libc++abi-18-dev' +# container: ubuntu:24.04 +# cxxstd: '23' +# build-type: 'Debug' +# cxxflags: '-stdlib=libc++' +# ldflags: '-lc++' +# server: "redis:8.2.1-alpine" + +# - toolset: clang-19 +# install: clang-19 +# container: ubuntu:24.04 +# cxxstd: '23' +# build-type: 'Debug' +# server: "redis:7.4.5-alpine" + +# - toolset: clang-20 +# install: clang-20 +# container: ubuntu:24.04 +# cxxstd: '23' +# build-type: 'Debug' +# server: "redis:8.2.1-alpine" + +# # clang-21 is the default in Ubuntu 26.04 +# - toolset: clang-21 +# install: 'clang-21 libclang-rt-21-dev' +# container: ubuntu:26.04 +# cxxstd: '23' +# build-type: 'Debug' +# cxxflags: '-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all' +# ldflags: '-fsanitize=address -fsanitize=undefined' +# server: "valkey/valkey:8.1.3-alpine" + +# - toolset: clang-21 +# install: 'clang-21 libc++-21-dev libc++abi-21-dev' +# container: ubuntu:26.04 +# cxxstd: '23' +# build-type: 'Debug' +# cxxflags: '-stdlib=libc++' +# ldflags: '-lc++' +# server: "redis:7.4.5-alpine" + +# - toolset: clang-21 +# install: 'clang-21 libc++-21-dev libc++abi-21-dev' +# container: ubuntu:26.04 +# cxxstd: '23' +# build-type: 'Release' +# cxxflags: '-stdlib=libc++' +# ldflags: '-lc++' +# server: "redis:8.2.1-alpine" + +# - toolset: clang-22 +# install: clang-22 +# container: ubuntu:26.04 +# cxxstd: '23' +# build-type: 'Debug' +# server: "valkey/valkey:8.1.3-alpine" + +# runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v6 +# steps: +# - name: Checkout +# uses: actions/checkout@v6 - - name: Generate TLS certificates - run: | - ./tools/gen-certificates.sh +# - name: Generate TLS certificates +# run: | +# ./tools/gen-certificates.sh - - name: Set up the required containers - run: | - BUILDER_IMAGE=${{ matrix.container }} SERVER_IMAGE=${{ matrix.server }} docker compose -f tools/docker-compose.yml up -d --wait || (docker compose logs; exit 1) +# - name: Set up the required containers +# run: | +# BUILDER_IMAGE=${{ matrix.container }} SERVER_IMAGE=${{ matrix.server }} docker compose -f tools/docker-compose.yml up -d --wait || (docker compose logs; exit 1) - - name: Install dependencies - run: | - docker exec builder apt-get update - docker exec --env DEBIAN_FRONTEND=noninteractive builder apt-get -y --no-install-recommends install \ - git \ - g++ \ - libssl-dev \ - make \ - ca-certificates \ - cmake \ - protobuf-compiler \ - python3 \ - ${{ matrix.install }} - - - name: Setup Boost - run: docker exec builder /boost-redis/tools/ci.py setup-boost --source-dir=/boost-redis - - - name: Build a Boost distribution using B2 - run: | - docker exec builder /boost-redis/tools/ci.py build-b2-distro \ - --toolset ${{ matrix.toolset }} - - # The CMake superproject build also drives the project tests, including - # integration tests against the Redis server set up above. - - name: Build a Boost distribution and run the tests using CMake - run: | - docker exec builder /boost-redis/tools/ci.py build-cmake-distro \ - --build-type ${{ matrix.build-type }} \ - --cxxstd ${{ matrix.cxxstd }} \ - --toolset ${{ matrix.toolset }} \ - "--cxxflags=${{ matrix.cxxflags }} -Werror" \ - "--ldflags=${{ matrix.ldflags }}" - - - name: Run add_subdirectory tests - run: | - docker exec builder /boost-redis/tools/ci.py run-cmake-add-subdirectory-tests \ - --build-type ${{ matrix.build-type }} \ - --cxxstd ${{ matrix.cxxstd }} \ - --toolset ${{ matrix.toolset }} \ - "--cxxflags=${{ matrix.cxxflags }} -Werror" \ - "--ldflags=${{ matrix.ldflags }}" - - - name: Run find_package tests with the built cmake distribution - run: | - docker exec builder /boost-redis/tools/ci.py run-cmake-find-package-tests \ - --build-type ${{ matrix.build-type }} \ - --cxxstd ${{ matrix.cxxstd }} \ - --toolset ${{ matrix.toolset }} \ - "--cxxflags=${{ matrix.cxxflags }} -Werror" \ - "--ldflags=${{ matrix.ldflags }}" - - - name: Run find_package tests with the built b2 distribution - run: | - docker exec builder /boost-redis/tools/ci.py run-cmake-b2-find-package-tests \ - --build-type ${{ matrix.build-type }} \ - --cxxstd ${{ matrix.cxxstd }} \ - --toolset ${{ matrix.toolset }} \ - "--cxxflags=${{ matrix.cxxflags }} -Werror" \ - "--ldflags=${{ matrix.ldflags }}" - - linux-b2: - name: "B2 ${{ matrix.toolset }}" - defaults: - run: - shell: bash - - strategy: - fail-fast: false - matrix: - include: - # We don't have integration tests here, so we only test the compilers - # that get installed by default in Ubuntu 22.04, 24.04 and 26.04 - - toolset: gcc-11 - install: g++-11 - cxxstd: "11,17,20" # Having C++11 shouldn't break the build - container: ubuntu:22.04 - - toolset: gcc-13 - install: g++-13 - cxxstd: "17,20,23" - container: ubuntu:24.04 - - toolset: gcc-15 - install: g++-15 - cxxstd: "17,20,23" - container: ubuntu:26.04 - - toolset: clang-18 - install: clang-18 - cxxstd: "11,17,20" - container: ubuntu:24.04 - - toolset: clang-21 - install: clang-21 - cxxstd: "17,20,23" - container: ubuntu:26.04 - runs-on: ubuntu-latest - container: ${{matrix.container}} - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup container environment - if: matrix.container - run: | - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get -y install python3 git g++ libssl-dev ${{ matrix.install }} - - - name: Setup Boost - run: ./tools/ci.py setup-boost --source-dir=$(pwd) +# - name: Install dependencies +# run: | +# docker exec builder apt-get update +# docker exec --env DEBIAN_FRONTEND=noninteractive builder apt-get -y --no-install-recommends install \ +# git \ +# g++ \ +# libssl-dev \ +# make \ +# ca-certificates \ +# cmake \ +# protobuf-compiler \ +# python3 \ +# ${{ matrix.install }} + +# - name: Setup Boost +# run: docker exec builder /boost-redis/tools/ci.py setup-boost --source-dir=/boost-redis + +# - name: Build a Boost distribution using B2 +# run: | +# docker exec builder /boost-redis/tools/ci.py build-b2-distro \ +# --toolset ${{ matrix.toolset }} + +# # The CMake superproject build also drives the project tests, including +# # integration tests against the Redis server set up above. +# - name: Build a Boost distribution and run the tests using CMake +# run: | +# docker exec builder /boost-redis/tools/ci.py build-cmake-distro \ +# --build-type ${{ matrix.build-type }} \ +# --cxxstd ${{ matrix.cxxstd }} \ +# --toolset ${{ matrix.toolset }} \ +# "--cxxflags=${{ matrix.cxxflags }} -Werror" \ +# "--ldflags=${{ matrix.ldflags }}" + +# - name: Run add_subdirectory tests +# run: | +# docker exec builder /boost-redis/tools/ci.py run-cmake-add-subdirectory-tests \ +# --build-type ${{ matrix.build-type }} \ +# --cxxstd ${{ matrix.cxxstd }} \ +# --toolset ${{ matrix.toolset }} \ +# "--cxxflags=${{ matrix.cxxflags }} -Werror" \ +# "--ldflags=${{ matrix.ldflags }}" + +# - name: Run find_package tests with the built cmake distribution +# run: | +# docker exec builder /boost-redis/tools/ci.py run-cmake-find-package-tests \ +# --build-type ${{ matrix.build-type }} \ +# --cxxstd ${{ matrix.cxxstd }} \ +# --toolset ${{ matrix.toolset }} \ +# "--cxxflags=${{ matrix.cxxflags }} -Werror" \ +# "--ldflags=${{ matrix.ldflags }}" + +# - name: Run find_package tests with the built b2 distribution +# run: | +# docker exec builder /boost-redis/tools/ci.py run-cmake-b2-find-package-tests \ +# --build-type ${{ matrix.build-type }} \ +# --cxxstd ${{ matrix.cxxstd }} \ +# --toolset ${{ matrix.toolset }} \ +# "--cxxflags=${{ matrix.cxxflags }} -Werror" \ +# "--ldflags=${{ matrix.ldflags }}" + +# linux-b2: +# name: "B2 ${{ matrix.toolset }}" +# defaults: +# run: +# shell: bash + +# strategy: +# fail-fast: false +# matrix: +# include: +# # We don't have integration tests here, so we only test the compilers +# # that get installed by default in Ubuntu 22.04, 24.04 and 26.04 +# - toolset: gcc-11 +# install: g++-11 +# cxxstd: "11,17,20" # Having C++11 shouldn't break the build +# container: ubuntu:22.04 +# - toolset: gcc-13 +# install: g++-13 +# cxxstd: "17,20,23" +# container: ubuntu:24.04 +# - toolset: gcc-15 +# install: g++-15 +# cxxstd: "17,20,23" +# container: ubuntu:26.04 +# - toolset: clang-18 +# install: clang-18 +# cxxstd: "11,17,20" +# container: ubuntu:24.04 +# - toolset: clang-21 +# install: clang-21 +# cxxstd: "17,20,23" +# container: ubuntu:26.04 +# runs-on: ubuntu-latest +# container: ${{matrix.container}} +# steps: +# - name: Checkout +# uses: actions/checkout@v6 + +# - name: Setup container environment +# if: matrix.container +# run: | +# export DEBIAN_FRONTEND=noninteractive +# apt-get update +# apt-get -y install python3 git g++ libssl-dev ${{ matrix.install }} + +# - name: Setup Boost +# run: ./tools/ci.py setup-boost --source-dir=$(pwd) - - name: Build and run project tests using B2 - run: | - python3 tools/ci.py run-b2-tests \ - --toolset ${{ matrix.toolset }} \ - --cxxstd ${{ matrix.cxxstd }} \ - --variant debug,release +# - name: Build and run project tests using B2 +# run: | +# python3 tools/ci.py run-b2-tests \ +# --toolset ${{ matrix.toolset }} \ +# --cxxstd ${{ matrix.cxxstd }} \ +# --variant debug,release - osx-cmake: - name: "CMake OSX" +# osx-cmake: +# name: "CMake OSX" - runs-on: macos-latest +# runs-on: macos-latest - steps: - - name: Checkout - uses: actions/checkout@v6 +# steps: +# - name: Checkout +# uses: actions/checkout@v6 - - name: Setup Boost - run: ./tools/ci.py setup-boost --source-dir=$(pwd) - - - name: Build a Boost distribution using B2 - run: | - ./tools/ci.py build-b2-distro \ - --toolset clang - - - name: Build a Boost distribution and run the tests using CMake - run: | - ./tools/ci.py build-cmake-distro \ - --build-type Debug \ - --cxxstd 20 \ - --toolset clang \ - "--cxxflags=-Werror" \ - --integration-tests 0 - - - name: Run add_subdirectory tests - run: | - ./tools/ci.py run-cmake-add-subdirectory-tests \ - --build-type Debug \ - --cxxstd 20 \ - --toolset clang \ - "--cxxflags=-Werror" - - - name: Run find_package tests with the built cmake distribution - run: | - ./tools/ci.py run-cmake-find-package-tests \ - --build-type Debug \ - --cxxstd 20 \ - --toolset clang \ - "--cxxflags=-Werror" - - - name: Run find_package tests with the built b2 distribution - run: | - ./tools/ci.py run-cmake-b2-find-package-tests \ - --build-type Debug \ - --cxxstd 20 \ - --toolset clang \ - "--cxxflags=-Werror" - - osx-b2: - name: "B2 ${{ matrix.os }}" - defaults: - run: - shell: bash - - runs-on: macos-latest - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup user-config.jam - run: cp tools/user-config-osx-gha.jam ~/user-config.jam - - - name: Setup Boost - run: ./tools/ci.py setup-boost --source-dir=$(pwd) +# - name: Setup Boost +# run: ./tools/ci.py setup-boost --source-dir=$(pwd) + +# - name: Build a Boost distribution using B2 +# run: | +# ./tools/ci.py build-b2-distro \ +# --toolset clang + +# - name: Build a Boost distribution and run the tests using CMake +# run: | +# ./tools/ci.py build-cmake-distro \ +# --build-type Debug \ +# --cxxstd 20 \ +# --toolset clang \ +# "--cxxflags=-Werror" \ +# --integration-tests 0 + +# - name: Run add_subdirectory tests +# run: | +# ./tools/ci.py run-cmake-add-subdirectory-tests \ +# --build-type Debug \ +# --cxxstd 20 \ +# --toolset clang \ +# "--cxxflags=-Werror" + +# - name: Run find_package tests with the built cmake distribution +# run: | +# ./tools/ci.py run-cmake-find-package-tests \ +# --build-type Debug \ +# --cxxstd 20 \ +# --toolset clang \ +# "--cxxflags=-Werror" + +# - name: Run find_package tests with the built b2 distribution +# run: | +# ./tools/ci.py run-cmake-b2-find-package-tests \ +# --build-type Debug \ +# --cxxstd 20 \ +# --toolset clang \ +# "--cxxflags=-Werror" + +# osx-b2: +# name: "B2 ${{ matrix.os }}" +# defaults: +# run: +# shell: bash + +# runs-on: macos-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v6 + +# - name: Setup user-config.jam +# run: cp tools/user-config-osx-gha.jam ~/user-config.jam + +# - name: Setup Boost +# run: ./tools/ci.py setup-boost --source-dir=$(pwd) - - name: Build and run project tests using B2 - run: | - ./tools/ci.py run-b2-tests \ - --toolset clang \ - --cxxstd 20 \ - --variant debug,release +# - name: Build and run project tests using B2 +# run: | +# ./tools/ci.py run-b2-tests \ +# --toolset clang \ +# --cxxstd 20 \ +# --variant debug,release - # Checks that we don't have any errors in docs - check-docs: - name: Check docs - defaults: - run: - shell: bash +# # Checks that we don't have any errors in docs +# check-docs: +# name: Check docs +# defaults: +# run: +# shell: bash - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v6 +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v6 - - name: Setup Boost - run: ./tools/ci.py setup-boost --source-dir=$(pwd) +# - name: Setup Boost +# run: ./tools/ci.py setup-boost --source-dir=$(pwd) - - name: Build docs - run: | - cd ~/boost-root - ./b2 libs/redis/doc - [ -f ~/boost-root/libs/redis/doc/html/index.html ] +# - name: Build docs +# run: | +# cd ~/boost-root +# ./b2 libs/redis/doc +# [ -f ~/boost-root/libs/redis/doc/html/index.html ] diff --git a/tools/ci.py b/tools/ci.py index 26ea8592..0b35a517 100755 --- a/tools/ci.py +++ b/tools/ci.py @@ -11,6 +11,7 @@ from shutil import rmtree, copytree, ignore_patterns import argparse import multiprocessing +import sys # Variables @@ -94,6 +95,13 @@ def _deduce_boost_branch() -> str: ref = os.environ.get('DRONE_BRANCH', '') ci = 'Drone' res = 'master' if ref == 'master' else 'develop' + elif os.environ.get('APPVEYOR') is not None: + # APPVEYOR_REPO_BRANCH holds the target branch for both regular builds + # and PR builds (the PR's base branch), so it's the right analogue of + # GitHub's GITHUB_BASE_REF. + ref = os.environ.get('APPVEYOR_REPO_BRANCH', '') + ci = 'AppVeyor' + res = 'master' if ref == 'master' else 'develop' else: ci = 'Unknown' ref = '' @@ -131,7 +139,7 @@ def _setup_boost( # Install Boost dependencies _run(["git", "config", "submodule.fetchJobs", "8"]) _run(["git", "submodule", "update", "-q", "--init", "tools/boostdep"]) - _run(["python3", "tools/boostdep/depinst/depinst.py", "--include", "example", "redis"]) + _run([sys.executable, "tools/boostdep/depinst/depinst.py", "--include", "example", "redis"]) # Bootstrap if _is_windows: