Fix signal_set::cancel() having no effect when called before wait() #633
Workflow file for this run
This file contains hidden or 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
| # | |
| # Copyright (c) 2026 Steve Gerbino | |
| # Copyright (c) 2026 Michael Vandeberg | |
| # | |
| # 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) | |
| # | |
| # Official repository: https://github.com/cppalliance/corosio/ | |
| # | |
| name: CI | |
| on: | |
| pull_request: | |
| branches: [ master, develop ] | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| - develop | |
| - bugfix/** | |
| - feature/** | |
| - fix/** | |
| - pr/** | |
| - ci-fixes | |
| concurrency: | |
| group: ${{format('{0}:{1}', github.repository, github.ref)}} | |
| cancel-in-progress: true | |
| env: | |
| GIT_FETCH_JOBS: 8 | |
| NET_RETRY_COUNT: 5 | |
| DEFAULT_BUILD_VARIANT: debug,release | |
| UBSAN_OPTIONS: "print_stacktrace=1" | |
| DEBIAN_FRONTEND: "noninteractive" | |
| TZ: "Europe/London" | |
| jobs: | |
| generate-matrix: | |
| name: Generate Matrix | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| matrix: ${{ steps.generate.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: generate | |
| run: | | |
| matrix=$(python3 .github/generate-matrix.py) | |
| echo "matrix={\"include\":$matrix}" >> "$GITHUB_OUTPUT" | |
| build: | |
| needs: [generate-matrix] | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.runs-on }} | |
| container: | |
| image: ${{ matrix.container }} | |
| options: --privileged | |
| timeout-minutes: 120 | |
| steps: | |
| - name: Clone Boost.Corosio | |
| uses: actions/checkout@v4 | |
| with: | |
| path: corosio-root | |
| - name: Setup C++ | |
| uses: alandefreitas/cpp-actions/setup-cpp@v1.9.0 | |
| id: setup-cpp | |
| with: | |
| compiler: ${{ matrix.compiler }} | |
| version: ${{ matrix.version }} | |
| check-latest: true | |
| trace-commands: true | |
| - name: Install packages | |
| uses: alandefreitas/cpp-actions/package-install@v1.9.0 | |
| id: package-install | |
| with: | |
| apt-get-add-architecture: ${{ matrix.x86 && 'i386' || '' }} | |
| apt-get: >- | |
| ${{ matrix.install }} | |
| build-essential | |
| libssl-dev | |
| curl zip unzip tar pkg-config | |
| - name: Clone Capy | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: cppalliance/capy | |
| ref: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }} | |
| path: capy-root | |
| # Test dependency of corosio | |
| - name: Clone Asio | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: boostorg/asio | |
| ref: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }} | |
| path: asio-root | |
| - name: Setup MSYS2 (MinGW Clang) | |
| if: matrix.compiler == 'mingw' | |
| shell: bash | |
| run: | | |
| /c/msys64/usr/bin/pacman.exe -S --noconfirm mingw-w64-clang-x86_64-clang | |
| echo "C:/msys64/clang64/bin" >> "$GITHUB_PATH" | |
| - name: Clone Boost | |
| uses: alandefreitas/cpp-actions/boost-clone@v1.9.0 | |
| id: boost-clone | |
| with: | |
| branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }} | |
| boost-dir: boost-source | |
| modules-exclude-paths: '' | |
| scan-modules-dir: corosio-root | |
| scan-modules-ignore: corosio, capy | |
| - name: ASLR Fix | |
| if: ${{ startsWith(matrix.runs-on, 'ubuntu') }} | |
| run: | | |
| sysctl vm.mmap_rnd_bits=28 | |
| - name: Patch Boost | |
| id: patch | |
| shell: bash | |
| run: | | |
| set -xe | |
| # Identify boost module being tested | |
| module=${GITHUB_REPOSITORY#*/} | |
| echo "module=$module" >> $GITHUB_OUTPUT | |
| # Identify GitHub workspace root | |
| workspace_root=$(echo "$GITHUB_WORKSPACE" | sed 's/\\/\//g') | |
| echo -E "workspace_root=$workspace_root" >> $GITHUB_OUTPUT | |
| # Remove module from boost-source | |
| rm -r "boost-source/libs/$module" || true | |
| rm -r "boost-source/libs/capy" || true | |
| # Disable sparse checkout for superproject CMake builds | |
| # (needed so CMakeLists.txt files in sibling boost libraries are available) | |
| if [ "${{ matrix.superproject-cmake }}" = "true" ]; then | |
| cd boost-source | |
| if git sparse-checkout list > /dev/null 2>&1; then | |
| git sparse-checkout disable | |
| git fetch origin --no-tags | |
| git checkout | |
| fi | |
| cd .. | |
| fi | |
| # Copy cached boost-source to an isolated boost-root | |
| cp -rL boost-source boost-root | |
| # Set boost-root output | |
| cd boost-root | |
| boost_root="$(pwd)" | |
| boost_root=$(echo "$boost_root" | sed 's/\\/\//g') | |
| echo -E "boost_root=$boost_root" >> $GITHUB_OUTPUT | |
| # Patch boost-root with workspace module | |
| cp -r "$workspace_root"/corosio-root "libs/$module" | |
| # Patch boost-root with capy dependency | |
| cp -r "$workspace_root"/capy-root "libs/capy" | |
| # Use vcpkg for WolfSSL only (system wolfssl package lacks -fPIC on Linux). | |
| # OpenSSL: system-installed on all platforms | |
| # - Windows MSVC: C:\Program Files\OpenSSL (pre-installed on runner) | |
| # - Windows MinGW: C:\msys64\mingw64 (installed via pacman) | |
| # - Linux: system libssl-dev | |
| # ARM builds skip vcpkg/WolfSSL (no container support, system libssl-dev still available) | |
| - name: Create vcpkg.json | |
| if: ${{ !contains(matrix.runs-on, 'arm') }} | |
| shell: bash | |
| run: | | |
| cat > corosio-root/vcpkg.json << 'EOF' | |
| { | |
| "name": "boost-corosio-deps", | |
| "version": "1.0.0", | |
| "dependencies": [ | |
| { "name": "wolfssl", "default-features": false } | |
| ] | |
| } | |
| EOF | |
| # macOS: OpenSSL from Homebrew (pre-installed), WolfSSL from vcpkg | |
| - name: Create vcpkg.json (macOS) | |
| if: ${{ matrix.macos }} | |
| shell: bash | |
| run: | | |
| cat > corosio-root/vcpkg.json << 'EOF' | |
| { | |
| "name": "boost-corosio-deps", | |
| "version": "1.0.0", | |
| "dependencies": ["wolfssl"] | |
| } | |
| EOF | |
| - name: Set vcpkg triplet | |
| if: matrix.vcpkg-triplet | |
| shell: bash | |
| run: | | |
| echo "VCPKG_DEFAULT_TRIPLET=${{ matrix.vcpkg-triplet }}" >> $GITHUB_ENV | |
| # Install OpenSSL for MinGW via MSYS2 (pre-built, fast) | |
| # MSVC uses the pre-installed OpenSSL at C:\Program Files\OpenSSL | |
| - name: Install OpenSSL (MinGW) | |
| if: matrix.compiler == 'mingw' | |
| shell: bash | |
| run: | | |
| C:/msys64/usr/bin/pacman.exe -S --noconfirm mingw-w64-x86_64-openssl | |
| # Add MSYS2 bin to PATH so OpenSSL DLLs can be found | |
| echo "C:/msys64/mingw64/bin" >> $GITHUB_PATH | |
| - name: Setup vcpkg | |
| if: ${{ !contains(matrix.runs-on, 'arm') }} | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgDirectory: ${{ github.workspace }}/vcpkg | |
| vcpkgGitCommitId: bd52fac7114fdaa2208de8dd1227212a6683e562 | |
| vcpkgJsonGlob: '**/corosio-root/vcpkg.json' | |
| runVcpkgInstall: true | |
| - name: Set vcpkg paths (Windows) | |
| if: ${{ matrix.windows }} | |
| id: vcpkg-paths-windows | |
| shell: bash | |
| run: | | |
| triplet="${{ matrix.vcpkg-triplet || 'x64-windows' }}" | |
| if [ -n "${VCPKG_INSTALLED_DIR}" ] && [ -d "${VCPKG_INSTALLED_DIR}/${triplet}" ]; then | |
| vcpkg_installed="${VCPKG_INSTALLED_DIR}/${triplet}" | |
| else | |
| vcpkg_installed="${{ github.workspace }}/corosio-root/vcpkg_installed/${triplet}" | |
| if [ ! -d "${vcpkg_installed}" ]; then | |
| vcpkg_installed=$(find "${{ github.workspace }}" -type d -path "*/vcpkg_installed/${triplet}" 2>/dev/null | head -1) | |
| fi | |
| fi | |
| if [ -z "${vcpkg_installed}" ] || [ ! -d "${vcpkg_installed}" ]; then | |
| echo "ERROR: Could not find vcpkg installed directory for triplet ${triplet}" | |
| exit 1 | |
| fi | |
| vcpkg_installed=$(echo "${vcpkg_installed}" | sed 's|\\|/|g') | |
| echo "${vcpkg_installed}/bin" >> $GITHUB_PATH | |
| # CMake toolchain for WolfSSL | |
| echo "CMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV | |
| echo "VCPKG_INSTALLED_DIR=$(dirname "${vcpkg_installed}")" >> $GITHUB_ENV | |
| # WolfSSL from vcpkg | |
| echo "WOLFSSL_INCLUDE=${vcpkg_installed}/include" >> $GITHUB_ENV | |
| echo "WOLFSSL_LIBRARY_PATH=${vcpkg_installed}/lib" >> $GITHUB_ENV | |
| # OpenSSL from system (different paths for MSVC vs MinGW) | |
| if [[ "${triplet}" == *"mingw"* ]]; then | |
| openssl_root="C:/msys64/mingw64" | |
| openssl_libpath="${openssl_root}/lib" | |
| else | |
| # MSVC: Probe known OpenSSL installation paths | |
| openssl_root="" | |
| for candidate in "C:/Program Files/OpenSSL-Win64" "C:/Program Files/OpenSSL"; do | |
| if [ -d "${candidate}" ]; then | |
| openssl_root="${candidate}" | |
| break | |
| fi | |
| done | |
| if [ -z "${openssl_root}" ]; then | |
| echo "ERROR: OpenSSL not found. Checked:" | |
| echo " - C:/Program Files/OpenSSL-Win64" | |
| echo " - C:/Program Files/OpenSSL" | |
| exit 1 | |
| fi | |
| echo "Found OpenSSL at: ${openssl_root}" | |
| # Win64 OpenSSL installer puts libs in lib/VC/x64/MD/ | |
| if [ -d "${openssl_root}/lib/VC/x64/MD" ]; then | |
| openssl_libpath="${openssl_root}/lib/VC/x64/MD" | |
| elif [ -d "${openssl_root}/lib" ]; then | |
| openssl_libpath="${openssl_root}/lib" | |
| else | |
| echo "ERROR: OpenSSL lib directory not found in ${openssl_root}" | |
| exit 1 | |
| fi | |
| fi | |
| # Outputs for B2 | |
| echo "openssl_root=${openssl_root}" >> $GITHUB_OUTPUT | |
| echo "openssl_libpath=${openssl_libpath}" >> $GITHUB_OUTPUT | |
| # CMake TLS configuration (used by all cmake-workflow steps) | |
| echo "CMAKE_WOLFSSL_INCLUDE=${vcpkg_installed}/include" >> $GITHUB_ENV | |
| if [[ "${triplet}" == *"mingw"* ]]; then | |
| echo "CMAKE_WOLFSSL_LIBRARY=${vcpkg_installed}/lib/libwolfssl.a" >> $GITHUB_ENV | |
| else | |
| echo "CMAKE_WOLFSSL_LIBRARY=${vcpkg_installed}/lib/wolfssl.lib" >> $GITHUB_ENV | |
| fi | |
| echo "CMAKE_OPENSSL_ROOT=${openssl_root}" >> $GITHUB_ENV | |
| - name: Set vcpkg paths (Linux) | |
| if: ${{ matrix.linux && !contains(matrix.runs-on, 'arm') }} | |
| id: vcpkg-paths-linux | |
| shell: bash | |
| run: | | |
| if [ -n "${VCPKG_INSTALLED_DIR}" ] && [ -d "${VCPKG_INSTALLED_DIR}/x64-linux" ]; then | |
| vcpkg_installed="${VCPKG_INSTALLED_DIR}/x64-linux" | |
| else | |
| vcpkg_installed=$(find "${GITHUB_WORKSPACE}" -type d -path "*/vcpkg_installed/x64-linux" 2>/dev/null | head -1) | |
| if [ -z "${vcpkg_installed}" ]; then | |
| vcpkg_installed=$(find "/__w" -type d -path "*/vcpkg_installed/x64-linux" 2>/dev/null | head -1) | |
| fi | |
| fi | |
| if [ -z "${vcpkg_installed}" ] || [ ! -d "${vcpkg_installed}" ]; then | |
| echo "ERROR: Could not find vcpkg installed directory for x64-linux" | |
| exit 1 | |
| fi | |
| # For B2 - WolfSSL from vcpkg, OpenSSL from system libssl-dev | |
| echo "WOLFSSL_INCLUDE=${vcpkg_installed}/include" >> $GITHUB_ENV | |
| echo "WOLFSSL_LIBRARY_PATH=${vcpkg_installed}/lib" >> $GITHUB_ENV | |
| # CMake TLS configuration (used by all cmake-workflow steps) | |
| echo "CMAKE_WOLFSSL_INCLUDE=${vcpkg_installed}/include" >> $GITHUB_ENV | |
| echo "CMAKE_WOLFSSL_LIBRARY=${vcpkg_installed}/lib/libwolfssl.a" >> $GITHUB_ENV | |
| # Linux uses system OpenSSL via libssl-dev, no explicit path needed | |
| echo "CMAKE_OPENSSL_ROOT=" >> $GITHUB_ENV | |
| - name: Set vcpkg paths (macOS) | |
| if: ${{ matrix.macos }} | |
| id: vcpkg-paths-macos | |
| shell: bash | |
| run: | | |
| # Determine triplet based on architecture | |
| if [[ "$(uname -m)" == "arm64" ]]; then | |
| triplet="arm64-osx" | |
| else | |
| triplet="x64-osx" | |
| fi | |
| echo "Using triplet: ${triplet}" | |
| if [ -n "${VCPKG_INSTALLED_DIR}" ] && [ -d "${VCPKG_INSTALLED_DIR}/${triplet}" ]; then | |
| vcpkg_installed="${VCPKG_INSTALLED_DIR}/${triplet}" | |
| else | |
| vcpkg_installed=$(find "${GITHUB_WORKSPACE}" -type d -path "*/vcpkg_installed/${triplet}" 2>/dev/null | head -1) | |
| fi | |
| if [ -z "${vcpkg_installed}" ] || [ ! -d "${vcpkg_installed}" ]; then | |
| echo "ERROR: Could not find vcpkg installed directory for ${triplet}" | |
| exit 1 | |
| fi | |
| echo "Using vcpkg_installed: ${vcpkg_installed}" | |
| # For B2 - WolfSSL from vcpkg, OpenSSL from Homebrew | |
| echo "WOLFSSL_INCLUDE=${vcpkg_installed}/include" >> $GITHUB_ENV | |
| echo "WOLFSSL_LIBRARY_PATH=${vcpkg_installed}/lib" >> $GITHUB_ENV | |
| # CMake TLS configuration (used by all cmake-workflow steps) | |
| echo "CMAKE_WOLFSSL_INCLUDE=${vcpkg_installed}/include" >> $GITHUB_ENV | |
| echo "CMAKE_WOLFSSL_LIBRARY=${vcpkg_installed}/lib/libwolfssl.a" >> $GITHUB_ENV | |
| # macOS uses Homebrew OpenSSL, CMake finds it automatically | |
| echo "CMAKE_OPENSSL_ROOT=" >> $GITHUB_ENV | |
| # OpenSSL user-config needed for Windows (system install) and macOS (Homebrew) | |
| # WolfSSL reads WOLFSSL_INCLUDE and WOLFSSL_LIBRARY_PATH env vars automatically | |
| # Linux uses system OpenSSL which B2 finds automatically | |
| - name: Create B2 user-config for OpenSSL (Windows) | |
| if: ${{ matrix.windows }} | |
| shell: bash | |
| run: | | |
| openssl_root="${{ steps.vcpkg-paths-windows.outputs.openssl_root }}" | |
| openssl_libpath="${{ steps.vcpkg-paths-windows.outputs.openssl_libpath }}" | |
| triplet="${{ matrix.vcpkg-triplet }}" | |
| echo "OpenSSL root: ${openssl_root}" | |
| echo "OpenSSL lib path: ${openssl_libpath}" | |
| echo "WolfSSL include (env): ${WOLFSSL_INCLUDE}" | |
| echo "WolfSSL lib path (env): ${WOLFSSL_LIBRARY_PATH}" | |
| { | |
| echo "# OpenSSL configuration for B2 (system-installed)" | |
| echo "# WolfSSL uses WOLFSSL_INCLUDE and WOLFSSL_LIBRARY_PATH env vars" | |
| if [[ "${triplet}" == *"mingw"* ]]; then | |
| # MinGW: OpenSSL from MSYS2, default lib names work | |
| echo "using openssl : : <include>\"${openssl_root}/include\" <search>\"${openssl_libpath}\" ;" | |
| else | |
| # MSVC: OpenSSL from Win64 installer | |
| echo "using openssl : : <include>\"${openssl_root}/include\" <search>\"${openssl_libpath}\" <ssl-name>libssl <crypto-name>libcrypto ;" | |
| fi | |
| } > boost-root/user-config.jam | |
| echo "Created user-config.jam:" | |
| cat boost-root/user-config.jam | |
| - name: Create B2 user-config for OpenSSL (macOS) | |
| if: ${{ matrix.macos }} | |
| shell: bash | |
| run: | | |
| # Homebrew OpenSSL location depends on architecture | |
| # Check openssl@3 paths first (explicit), then generic openssl symlink | |
| if [[ "$(uname -m)" == "arm64" ]]; then | |
| candidates=( | |
| "/opt/homebrew/opt/openssl@3" | |
| "/opt/homebrew/opt/openssl" | |
| ) | |
| else | |
| candidates=( | |
| "/usr/local/opt/openssl@3" | |
| "/usr/local/opt/openssl" | |
| ) | |
| fi | |
| openssl_root="" | |
| for candidate in "${candidates[@]}"; do | |
| if [ -d "${candidate}" ]; then | |
| openssl_root="${candidate}" | |
| break | |
| fi | |
| done | |
| # Fallback: use brew --prefix if available | |
| if [ -z "${openssl_root}" ] && command -v brew &> /dev/null; then | |
| openssl_root=$(brew --prefix openssl 2>/dev/null || true) | |
| if [ -n "${openssl_root}" ] && [ ! -d "${openssl_root}" ]; then | |
| openssl_root="" | |
| fi | |
| fi | |
| if [ -z "${openssl_root}" ]; then | |
| echo "ERROR: OpenSSL not found. Checked:" | |
| for candidate in "${candidates[@]}"; do | |
| echo " - ${candidate}" | |
| done | |
| echo "Also tried: brew --prefix openssl" | |
| exit 1 | |
| fi | |
| echo "Found OpenSSL at: ${openssl_root}" | |
| echo "WolfSSL include (env): ${WOLFSSL_INCLUDE}" | |
| echo "WolfSSL lib path (env): ${WOLFSSL_LIBRARY_PATH}" | |
| { | |
| echo "# OpenSSL configuration for B2 (Homebrew)" | |
| echo "# WolfSSL uses WOLFSSL_INCLUDE and WOLFSSL_LIBRARY_PATH env vars" | |
| echo "using openssl : : <include>\"${openssl_root}/include\" <search>\"${openssl_root}/lib\" ;" | |
| } > boost-root/user-config.jam | |
| echo "Created user-config.jam:" | |
| cat boost-root/user-config.jam | |
| - name: Boost B2 Workflow | |
| uses: alandefreitas/cpp-actions/b2-workflow@v1.9.0 | |
| if: ${{ !matrix.coverage && !matrix.time-trace && !matrix.superproject-cmake && !matrix.clang-tidy }} | |
| env: | |
| ASAN_OPTIONS: ${{ ((matrix.compiler == 'apple-clang' || matrix.compiler == 'clang' || matrix.compiler == 'mingw') && 'detect_invalid_pointer_pairs=0:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1') || 'detect_invalid_pointer_pairs=2:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1' }} | |
| TSAN_OPTIONS: ${{ matrix.tsan && 'halt_on_error=1:second_deadlock_stack=1' || '' }} | |
| with: | |
| source-dir: boost-root | |
| modules: corosio | |
| toolset: ${{ matrix.b2-toolset }} | |
| build-variant: ${{ (matrix.compiler == 'msvc' && 'debug,release') || matrix.build-type }} | |
| cxx: ${{ matrix.cxx || steps.setup-cpp.outputs.cxx || '' }} | |
| cxxstd: ${{ matrix.cxxstd }} | |
| address-model: ${{ (matrix.x86 && '32') || '64' }} | |
| asan: ${{ matrix.asan }} | |
| ubsan: ${{ matrix.ubsan }} | |
| tsan: ${{ matrix.tsan }} | |
| shared: ${{ matrix.shared }} | |
| rtti: on | |
| cxxflags: ${{ (matrix.asan && matrix.compiler != 'msvc' && matrix.compiler != 'clang-cl' && '-fsanitize-address-use-after-scope -fsanitize=pointer-subtract') || '' }} | |
| stop-on-error: true | |
| extra-args: ${{ (matrix.valgrind && 'testing.launcher=valgrind' || '' )}} | |
| - name: Boost CMake Workflow | |
| uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0 | |
| if: ${{ matrix.superproject-cmake }} | |
| with: | |
| source-dir: boost-root | |
| build-dir: __build_cmake_test__ | |
| generator: ${{ matrix.generator }} | |
| generator-toolset: ${{ matrix.generator-toolset }} | |
| build-type: ${{ matrix.build-type }} | |
| build-target: boost_corosio_tests | |
| run-tests: true | |
| cxxstd: ${{ matrix.cmake-cxxstd || matrix.cxxstd }} | |
| cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }} | |
| ccflags: ${{ matrix.ccflags }} | |
| cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }} | |
| cxxflags: ${{ matrix.cxxflags }} | |
| shared: ${{ matrix.shared }} | |
| cmake-version: '>=3.20' | |
| install: true | |
| install-prefix: ${{ steps.patch.outputs.workspace_root }}/.local | |
| extra-args: | | |
| -D Boost_VERBOSE=ON | |
| -D BOOST_INCLUDE_LIBRARIES="${{ steps.patch.outputs.module }}" | |
| ${{ matrix.compiler == 'mingw' && '-D CMAKE_VERBOSE_MAKEFILE=ON' || '' }} | |
| ${{ contains(matrix.generator || '', 'Visual Studio') && format('-D CMAKE_CONFIGURATION_TYPES={0}', matrix.build-type) || '' }} | |
| ${{ env.CMAKE_WOLFSSL_INCLUDE && format('-D WolfSSL_INCLUDE_DIR={0}', env.CMAKE_WOLFSSL_INCLUDE) || '' }} | |
| ${{ env.CMAKE_WOLFSSL_LIBRARY && format('-D WolfSSL_LIBRARY={0}', env.CMAKE_WOLFSSL_LIBRARY) || '' }} | |
| ${{ env.CMAKE_OPENSSL_ROOT && format('-D OPENSSL_ROOT_DIR="{0}"', env.CMAKE_OPENSSL_ROOT) || '' }} | |
| ${{ matrix.vcpkg-triplet && format('-D VCPKG_TARGET_TRIPLET={0}', matrix.vcpkg-triplet) || '' }} | |
| # CMAKE_TOOLCHAIN_FILE and VCPKG_INSTALLED_DIR are set via environment variables | |
| toolchain: ${{ env.CMAKE_TOOLCHAIN_FILE }} | |
| package: false | |
| package-artifact: false | |
| ref-source-dir: boost-root/libs/corosio | |
| - name: Set Path (Windows Shared) | |
| if: ${{ matrix.windows && matrix.shared }} | |
| run: echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH | |
| - name: Set LD_LIBRARY_PATH (Linux Shared) | |
| if: ${{ matrix.linux && matrix.shared }} | |
| run: | | |
| echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/.local/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV" | |
| - name: Find Package Integration Test | |
| uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0 | |
| if: ${{ matrix.superproject-cmake }} | |
| with: | |
| source-dir: boost-root/libs/${{ steps.patch.outputs.module }}/test/cmake_test | |
| build-dir: __build_cmake_install_test__ | |
| generator: ${{ matrix.generator }} | |
| generator-toolset: ${{ matrix.generator-toolset }} | |
| build-type: ${{ matrix.build-type }} | |
| cxxstd: ${{ matrix.latest-cxxstd }} | |
| cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }} | |
| ccflags: ${{ matrix.ccflags }} | |
| cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }} | |
| cxxflags: ${{ matrix.cxxflags }} | |
| shared: ${{ matrix.shared }} | |
| install: false | |
| cmake-version: '>=3.20' | |
| extra-args: | | |
| -D BOOST_CI_INSTALL_TEST=ON | |
| -D CMAKE_PREFIX_PATH=${{ steps.patch.outputs.workspace_root }}/.local | |
| ${{ contains(matrix.generator || '', 'Visual Studio') && format('-D CMAKE_CONFIGURATION_TYPES={0}', matrix.build-type) || '' }} | |
| ${{ env.CMAKE_WOLFSSL_INCLUDE && format('-D WolfSSL_INCLUDE_DIR={0}', env.CMAKE_WOLFSSL_INCLUDE) || '' }} | |
| ${{ env.CMAKE_WOLFSSL_LIBRARY && format('-D WolfSSL_LIBRARY={0}', env.CMAKE_WOLFSSL_LIBRARY) || '' }} | |
| ${{ env.CMAKE_OPENSSL_ROOT && format('-D OPENSSL_ROOT_DIR="{0}"', env.CMAKE_OPENSSL_ROOT) || '' }} | |
| ${{ matrix.vcpkg-triplet && format('-D VCPKG_TARGET_TRIPLET={0}', matrix.vcpkg-triplet) || '' }} | |
| toolchain: ${{ env.CMAKE_TOOLCHAIN_FILE }} | |
| ref-source-dir: boost-root/libs/corosio | |
| trace-commands: true | |
| - name: Subdirectory Integration Test | |
| uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0 | |
| if: ${{ matrix.superproject-cmake }} | |
| with: | |
| source-dir: boost-root/libs/${{ steps.patch.outputs.module }}/test/cmake_test | |
| build-dir: __build_cmake_subdir_test__ | |
| generator: ${{ matrix.generator }} | |
| generator-toolset: ${{ matrix.generator-toolset }} | |
| build-type: ${{ matrix.build-type }} | |
| cxxstd: ${{ matrix.latest-cxxstd }} | |
| cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }} | |
| ccflags: ${{ matrix.ccflags }} | |
| cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }} | |
| cxxflags: ${{ matrix.cxxflags }} | |
| shared: ${{ matrix.shared }} | |
| install: false | |
| cmake-version: '>=3.15' | |
| extra-args: | | |
| -D BOOST_CI_INSTALL_TEST=OFF | |
| ${{ contains(matrix.generator || '', 'Visual Studio') && format('-D CMAKE_CONFIGURATION_TYPES={0}', matrix.build-type) || '' }} | |
| ${{ env.CMAKE_WOLFSSL_INCLUDE && format('-D WolfSSL_INCLUDE_DIR={0}', env.CMAKE_WOLFSSL_INCLUDE) || '' }} | |
| ${{ env.CMAKE_WOLFSSL_LIBRARY && format('-D WolfSSL_LIBRARY={0}', env.CMAKE_WOLFSSL_LIBRARY) || '' }} | |
| ${{ env.CMAKE_OPENSSL_ROOT && format('-D OPENSSL_ROOT_DIR="{0}"', env.CMAKE_OPENSSL_ROOT) || '' }} | |
| ${{ matrix.vcpkg-triplet && format('-D VCPKG_TARGET_TRIPLET={0}', matrix.vcpkg-triplet) || '' }} | |
| toolchain: ${{ env.CMAKE_TOOLCHAIN_FILE }} | |
| ref-source-dir: boost-root/libs/corosio/test/cmake_test | |
| # Standalone root-project builds (build-cmake, coverage, clang-tidy) | |
| # need the consumer to provide Boost::capy. Inject it via | |
| # CMAKE_PROJECT_boost_corosio_INCLUDE so the already-cloned capy-root | |
| # is added as a subdirectory at configure time. | |
| - name: Create capy provider for standalone builds | |
| if: ${{ matrix.build-cmake || matrix.coverage || matrix.clang-tidy }} | |
| shell: bash | |
| run: | | |
| workspace_root=$(echo "$GITHUB_WORKSPACE" | sed 's/\\/\//g') | |
| cat > "${workspace_root}/provide-capy.cmake" << 'EOF' | |
| set(BOOST_CAPY_BUILD_TESTS OFF CACHE BOOL "" FORCE) | |
| set(BOOST_CAPY_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) | |
| # Co-locate DLLs with executables so post-build test discovery works | |
| if(BUILD_SHARED_LIBS) | |
| set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") | |
| endif() | |
| add_subdirectory("${COROSIO_CI_CAPY_SOURCE_DIR}" | |
| "${CMAKE_BINARY_DIR}/_deps/capy-build" EXCLUDE_FROM_ALL) | |
| EOF | |
| echo "COROSIO_CI_PROVIDE_CAPY=${workspace_root}/provide-capy.cmake" >> $GITHUB_ENV | |
| echo "COROSIO_CI_CAPY_DIR=${workspace_root}/capy-root" >> $GITHUB_ENV | |
| - name: Root Project CMake Workflow | |
| uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0 | |
| if: ${{ matrix.build-cmake || matrix.coverage }} | |
| with: | |
| source-dir: corosio-root | |
| build-dir: __build__ | |
| generator: ${{ matrix.generator }} | |
| generator-toolset: ${{ matrix.generator-toolset }} | |
| build-type: ${{ matrix.build-type }} | |
| run-tests: true | |
| install: false | |
| cxxstd: ${{ matrix.latest-cxxstd }} | |
| cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }} | |
| ccflags: ${{ matrix.ccflags }} | |
| cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }} | |
| cxxflags: ${{ matrix.cxxflags }} | |
| shared: ${{ matrix.shared }} | |
| cmake-version: '>=3.20' | |
| extra-args: | | |
| -D Boost_VERBOSE=ON | |
| -D CMAKE_PROJECT_boost_corosio_INCLUDE=${{ env.COROSIO_CI_PROVIDE_CAPY }} | |
| -D COROSIO_CI_CAPY_SOURCE_DIR=${{ env.COROSIO_CI_CAPY_DIR }} | |
| ${{ matrix.compiler == 'mingw' && '-D CMAKE_VERBOSE_MAKEFILE=ON' || '' }} | |
| ${{ contains(matrix.generator || '', 'Visual Studio') && format('-D CMAKE_CONFIGURATION_TYPES={0}', matrix.build-type) || '' }} | |
| ${{ env.CMAKE_WOLFSSL_INCLUDE && format('-D WolfSSL_INCLUDE_DIR={0}', env.CMAKE_WOLFSSL_INCLUDE) || '' }} | |
| ${{ env.CMAKE_WOLFSSL_LIBRARY && format('-D WolfSSL_LIBRARY={0}', env.CMAKE_WOLFSSL_LIBRARY) || '' }} | |
| ${{ env.CMAKE_OPENSSL_ROOT && format('-D OPENSSL_ROOT_DIR="{0}"', env.CMAKE_OPENSSL_ROOT) || '' }} | |
| ${{ matrix.vcpkg-triplet && format('-D VCPKG_TARGET_TRIPLET={0}', matrix.vcpkg-triplet) || '' }} | |
| toolchain: ${{ env.CMAKE_TOOLCHAIN_FILE }} | |
| package: false | |
| package-artifact: false | |
| ref-source-dir: boost-root | |
| - name: Configure for clang-tidy | |
| uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0 | |
| if: ${{ matrix.clang-tidy }} | |
| with: | |
| source-dir: corosio-root | |
| build-dir: __build__ | |
| generator: ${{ matrix.generator }} | |
| cxxstd: ${{ matrix.latest-cxxstd }} | |
| cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }} | |
| cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }} | |
| cmake-version: '>=3.20' | |
| extra-args: | | |
| -D CMAKE_EXPORT_COMPILE_COMMANDS=ON | |
| -D CMAKE_PROJECT_boost_corosio_INCLUDE=${{ env.COROSIO_CI_PROVIDE_CAPY }} | |
| -D COROSIO_CI_CAPY_SOURCE_DIR=${{ env.COROSIO_CI_CAPY_DIR }} | |
| ${{ env.CMAKE_WOLFSSL_INCLUDE && format('-D WolfSSL_INCLUDE_DIR={0}', env.CMAKE_WOLFSSL_INCLUDE) || '' }} | |
| ${{ env.CMAKE_WOLFSSL_LIBRARY && format('-D WolfSSL_LIBRARY={0}', env.CMAKE_WOLFSSL_LIBRARY) || '' }} | |
| ${{ env.CMAKE_OPENSSL_ROOT && format('-D OPENSSL_ROOT_DIR="{0}"', env.CMAKE_OPENSSL_ROOT) || '' }} | |
| toolchain: ${{ env.CMAKE_TOOLCHAIN_FILE }} | |
| build: false | |
| run-tests: false | |
| install: false | |
| ref-source-dir: corosio-root | |
| - name: Run clang-tidy | |
| if: ${{ matrix.clang-tidy }} | |
| run: | | |
| python3 -c "import json; [print(e['file']) for e in json.load(open('corosio-root/__build__/compile_commands.json'))]" \ | |
| | grep '/corosio-root/\(src\|include\)/' \ | |
| | xargs -r clang-tidy-${{ matrix.version }} \ | |
| -p corosio-root/__build__ \ | |
| --warnings-as-errors='*' | |
| - name: FlameGraph | |
| uses: alandefreitas/cpp-actions/flamegraph@v1.9.0 | |
| if: matrix.time-trace | |
| with: | |
| source-dir: corosio-root | |
| build-dir: corosio-root/__build__ | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate Coverage Report | |
| if: ${{ matrix.coverage && matrix.linux }} | |
| run: | | |
| set -x | |
| gcov_tool="gcov" | |
| if command -v "gcov-${{ steps.setup-cpp.outputs.version-major }}" &> /dev/null; then | |
| gcov_tool="gcov-${{ steps.setup-cpp.outputs.version-major }}" | |
| fi | |
| lcov -c -q -o "corosio-root/__build__/coverage.info" -d "corosio-root/__build__" \ | |
| --include "$(pwd)/corosio-root/include/*" \ | |
| --include "$(pwd)/corosio-root/src/*" \ | |
| --gcov-tool "$gcov_tool" | |
| - name: Generate Coverage Report (macOS) | |
| if: ${{ matrix.coverage && matrix.macos }} | |
| run: | | |
| pip3 install --break-system-packages gcovr | |
| gcovr \ | |
| --gcov-executable "xcrun llvm-cov gcov" \ | |
| -r corosio-root \ | |
| --filter ".*/corosio-root/include/.*" \ | |
| --filter ".*/corosio-root/src/.*" \ | |
| --lcov -o "corosio-root/__build__/coverage.info" | |
| - name: Generate Coverage Report (Windows) | |
| if: ${{ matrix.coverage && matrix.windows }} | |
| run: | | |
| pip3 install gcovr | |
| gcovr \ | |
| -r corosio-root \ | |
| --filter ".*/corosio-root/include/.*" \ | |
| --filter ".*/corosio-root/src/.*" \ | |
| --lcov -o "corosio-root/__build__/coverage.info" | |
| - name: Upload to Codecov | |
| if: ${{ matrix.coverage }} | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: corosio-root/__build__/coverage.info | |
| flags: ${{ matrix.coverage-flag }} | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| verbose: true | |
| disable_search: true | |
| plugins: noop | |
| - name: Coverage Summary | |
| if: ${{ matrix.coverage }} | |
| run: | | |
| echo "# Coverage" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "[](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Commit: [](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Branch: [](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| freebsd: | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - version: "14.3" | |
| name: "FreeBSD 14.3 (Clang): C++20" | |
| - version: "15.0" | |
| name: "FreeBSD 15.0 (Clang): C++20" | |
| build-cmake: true | |
| name: ${{ matrix.name }} | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 120 | |
| steps: | |
| - name: Clone Boost.Corosio | |
| uses: actions/checkout@v4 | |
| with: | |
| path: corosio-root | |
| - name: Clone Capy | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: cppalliance/capy | |
| ref: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }} | |
| path: capy-root | |
| - name: Clone Boost | |
| uses: alandefreitas/cpp-actions/boost-clone@v1.9.0 | |
| id: boost-clone | |
| with: | |
| branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }} | |
| boost-dir: boost-source | |
| modules-exclude-paths: '' | |
| scan-modules-dir: corosio-root | |
| scan-modules-ignore: corosio,capy | |
| - name: Patch Boost | |
| id: patch | |
| run: | | |
| set -xe | |
| module=${GITHUB_REPOSITORY#*/} | |
| echo "module=$module" >> $GITHUB_OUTPUT | |
| workspace_root=$(echo "$GITHUB_WORKSPACE" | sed 's/\\/\//g') | |
| rm -r "boost-source/libs/$module" || true | |
| rm -r "boost-source/libs/capy" || true | |
| cp -rL boost-source boost-root | |
| cd boost-root | |
| boost_root="$(pwd)" | |
| echo -E "boost_root=$boost_root" >> $GITHUB_OUTPUT | |
| cp -r "$workspace_root"/corosio-root "libs/$module" | |
| cp -r "$workspace_root"/capy-root "libs/capy" | |
| - name: Boost B2 Workflow (FreeBSD) | |
| uses: vmactions/freebsd-vm@v1 | |
| with: | |
| release: ${{ matrix.version }} | |
| usesh: true | |
| run: | | |
| set -xe | |
| cd boost-root | |
| ./bootstrap.sh | |
| ./b2 libs/${{ steps.patch.outputs.module }}/test \ | |
| toolset=clang \ | |
| cxxstd=20 \ | |
| variant=release \ | |
| link=shared \ | |
| rtti=on \ | |
| -q \ | |
| -j$(sysctl -n hw.ncpu) | |
| - name: Boost CMake Workflow (FreeBSD) | |
| if: ${{ matrix.build-cmake }} | |
| uses: vmactions/freebsd-vm@v1 | |
| with: | |
| release: ${{ matrix.version }} | |
| usesh: true | |
| prepare: | | |
| pkg install -y cmake | |
| run: | | |
| set -xe | |
| cd boost-root | |
| cmake -S . -B build \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DBOOST_INCLUDE_LIBRARIES="${{ steps.patch.outputs.module }}" \ | |
| -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
| cmake --build build --target tests -j$(sysctl -n hw.ncpu) | |
| ctest --test-dir build --output-on-failure | |
| changelog: | |
| defaults: | |
| run: | |
| shell: bash | |
| name: Changelog Summary | |
| runs-on: 'ubuntu-22.04' | |
| timeout-minutes: 120 | |
| steps: | |
| - name: Clone Boost.Corosio | |
| uses: actions/checkout@v4 | |
| with: | |
| # Avoid the common API rate limit exceeded error in boostorg by including 100 latest commits in any case | |
| fetch-depth: 100 | |
| - name: Changelog | |
| uses: alandefreitas/cpp-actions/create-changelog@v1.9.0 | |
| with: | |
| thank-non-regular: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| limit: 200 | |
| tag-pattern: 'boost-.*\..*\..*' |