Consistently set clean error codes on success #260
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 | |
| # | |
| # 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/** | |
| 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: | |
| # Self-hosted runner selection is disabled to allow re-running individual | |
| # failed jobs from the GitHub Actions UI. When using dynamic runner selection, | |
| # the runs-on value depends on this job's output, which isn't available when | |
| # re-running a subset of jobs. | |
| # | |
| # runner-selection: | |
| # name: Runner Selection | |
| # runs-on: ${{ github.repository_owner == 'boostorg' && fromJSON('[ "self-hosted", "linux", "x64", "ubuntu-latest-aws" ]') || 'ubuntu-latest' }} | |
| # outputs: | |
| # labelmatrix: ${{ steps.aws_hosted_runners.outputs.labelmatrix }} | |
| # steps: | |
| # - name: AWS Hosted Runners | |
| # id: aws_hosted_runners | |
| # uses: cppalliance/aws-hosted-runners@v1.0.0 | |
| build: | |
| # needs: [ runner-selection ] | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Windows (3 configurations) | |
| - compiler: "msvc" | |
| version: "14.42" | |
| cxxstd: "20" | |
| latest-cxxstd: "20" | |
| runs-on: "windows-2022" | |
| b2-toolset: "msvc-14.4" | |
| generator: "Visual Studio 17 2022" | |
| is-latest: true | |
| name: "MSVC 14.42: C++20" | |
| shared: false | |
| build-type: "Release" | |
| build-cmake: true | |
| - compiler: "msvc" | |
| version: "14.34" | |
| cxxstd: "20" | |
| latest-cxxstd: "20" | |
| runs-on: "windows-2022" | |
| b2-toolset: "msvc-14.3" | |
| generator: "Visual Studio 17 2022" | |
| name: "MSVC 14.34: C++20 (shared)" | |
| shared: true | |
| build-type: "Release" | |
| - compiler: "mingw" | |
| version: "*" | |
| cxxstd: "20" | |
| latest-cxxstd: "20" | |
| cxx: "g++" | |
| cc: "gcc" | |
| runs-on: "windows-2022" | |
| b2-toolset: "gcc" | |
| generator: "MinGW Makefiles" | |
| is-latest: true | |
| is-earliest: true | |
| name: "MinGW: C++20" | |
| shared: false | |
| build-type: "Release" | |
| build-cmake: true | |
| vcpkg-triplet: "x64-mingw-static" | |
| # macOS (2 configurations) | |
| # Uses select backend (kqueue support planned for future) | |
| # Requires -fexperimental-library for std::stop_token support in libc++ | |
| - compiler: "apple-clang" | |
| version: "*" | |
| cxxstd: "20" | |
| latest-cxxstd: "20" | |
| cxx: "clang++" | |
| cc: "clang" | |
| runs-on: "macos-15" | |
| b2-toolset: "clang" | |
| is-latest: true | |
| name: "Apple-Clang (macOS 15, asan+ubsan): C++20" | |
| shared: true | |
| build-type: "RelWithDebInfo" | |
| asan: true | |
| ubsan: true | |
| cxxflags: "-fexperimental-library" | |
| - compiler: "apple-clang" | |
| version: "*" | |
| cxxstd: "20" | |
| latest-cxxstd: "20" | |
| cxx: "clang++" | |
| cc: "clang" | |
| runs-on: "macos-14" | |
| b2-toolset: "clang" | |
| name: "Apple-Clang (macOS 14): C++20" | |
| shared: true | |
| build-type: "Release" | |
| build-cmake: true | |
| cxxflags: "-fexperimental-library" | |
| # Linux GCC (4 configurations) | |
| - compiler: "gcc" | |
| version: "15" | |
| cxxstd: "20" | |
| latest-cxxstd: "20" | |
| cxx: "g++-15" | |
| cc: "gcc-15" | |
| runs-on: "ubuntu-latest" | |
| container: "ubuntu:25.04" | |
| b2-toolset: "gcc" | |
| is-latest: true | |
| name: "GCC 15: C++20" | |
| shared: true | |
| build-type: "Release" | |
| build-cmake: true | |
| - compiler: "gcc" | |
| version: "15" | |
| cxxstd: "20" | |
| latest-cxxstd: "20" | |
| cxx: "g++-15" | |
| cc: "gcc-15" | |
| runs-on: "ubuntu-latest" | |
| container: "ubuntu:25.04" | |
| b2-toolset: "gcc" | |
| is-latest: true | |
| name: "GCC 15: C++20 (asan+ubsan)" | |
| shared: true | |
| asan: true | |
| ubsan: true | |
| build-type: "RelWithDebInfo" | |
| - compiler: "gcc" | |
| version: "12" | |
| cxxstd: "20" | |
| latest-cxxstd: "20" | |
| cxx: "g++-12" | |
| cc: "gcc-12" | |
| runs-on: "ubuntu-latest" | |
| container: "ubuntu:22.04" | |
| b2-toolset: "gcc" | |
| name: "GCC 12: C++20" | |
| shared: true | |
| build-type: "Release" | |
| - compiler: "gcc" | |
| version: "13" | |
| cxxstd: "20" | |
| latest-cxxstd: "20" | |
| cxx: "g++-13" | |
| cc: "gcc-13" | |
| runs-on: "ubuntu-24.04" | |
| b2-toolset: "gcc" | |
| name: "GCC 13: C++20 (coverage)" | |
| shared: false | |
| coverage: true | |
| build-type: "Debug" | |
| cxxflags: "--coverage -fprofile-arcs -ftest-coverage" | |
| ccflags: "--coverage -fprofile-arcs -ftest-coverage" | |
| install: "lcov wget unzip" | |
| # Linux Clang (5 configurations) | |
| - compiler: "clang" | |
| version: "20" | |
| cxxstd: "20,23" | |
| latest-cxxstd: "23" | |
| cxx: "clang++-20" | |
| cc: "clang-20" | |
| runs-on: "ubuntu-latest" | |
| container: "ubuntu:24.04" | |
| b2-toolset: "clang" | |
| is-latest: true | |
| name: "Clang 20: C++20-23" | |
| shared: true | |
| build-type: "Release" | |
| build-cmake: true | |
| - compiler: "clang" | |
| version: "20" | |
| cxxstd: "20" | |
| latest-cxxstd: "20" | |
| cxx: "clang++-20" | |
| cc: "clang-20" | |
| runs-on: "ubuntu-latest" | |
| container: "ubuntu:24.04" | |
| b2-toolset: "clang" | |
| is-latest: true | |
| name: "Clang 20: C++20 (asan+ubsan)" | |
| shared: false | |
| asan: true | |
| ubsan: true | |
| build-type: "RelWithDebInfo" | |
| - compiler: "clang" | |
| version: "17" | |
| cxxstd: "20" | |
| latest-cxxstd: "20" | |
| cxx: "clang++-17" | |
| cc: "clang-17" | |
| runs-on: "ubuntu-24.04" | |
| b2-toolset: "clang" | |
| name: "Clang 17: C++20" | |
| shared: false | |
| build-type: "Release" | |
| - compiler: "clang" | |
| version: "20" | |
| cxxstd: "20,23" | |
| latest-cxxstd: "23" | |
| cxx: "clang++-20" | |
| cc: "clang-20" | |
| runs-on: "ubuntu-latest" | |
| container: "ubuntu:24.04" | |
| b2-toolset: "clang" | |
| is-latest: true | |
| name: "Clang 20: C++20-23 (x86)" | |
| shared: false | |
| x86: true | |
| build-type: "Release" | |
| install: "gcc-multilib g++-multilib" | |
| name: ${{ matrix.name }} | |
| # Skip self-hosted runner selection for now | |
| # runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)[matrix.runs-on] }} | |
| 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 | |
| ${{ matrix.x86 && '' || '' }} | |
| - 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 | |
| # Test dependency of corosio | |
| - name: Clone Filesystem | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: boostorg/filesystem | |
| ref: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }} | |
| path: filesystem-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: 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 | |
| pwd | |
| ls | |
| ls -lah boost-source | |
| # 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 | |
| # Copy cached boost-source to an isolated boost-root | |
| cp -r 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 TLS libraries | |
| # Windows: OpenSSL + WolfSSL from vcpkg | |
| # Linux: system OpenSSL + vcpkg WolfSSL only (system wolfssl package lacks -fPIC) | |
| - name: Create vcpkg.json (Windows) | |
| if: runner.os == 'Windows' | |
| shell: bash | |
| run: | | |
| cat > corosio-root/vcpkg.json << 'EOF' | |
| { | |
| "name": "boost-corosio-deps", | |
| "version": "1.0.0", | |
| "dependencies": ["openssl", "wolfssl"] | |
| } | |
| EOF | |
| - name: Create vcpkg.json (Linux) | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| cat > corosio-root/vcpkg.json << 'EOF' | |
| { | |
| "name": "boost-corosio-deps", | |
| "version": "1.0.0", | |
| "dependencies": ["wolfssl"] | |
| } | |
| EOF | |
| # macOS: OpenSSL from Homebrew (pre-installed), WolfSSL from vcpkg | |
| - name: Create vcpkg.json (macOS) | |
| if: runner.os == '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 | |
| - name: Setup vcpkg | |
| 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: runner.os == 'Windows' | |
| id: vcpkg-paths-windows | |
| shell: bash | |
| run: | | |
| # Determine triplet (mingw uses x64-mingw-static, msvc uses x64-windows) | |
| triplet="${{ matrix.vcpkg-triplet || 'x64-windows' }}" | |
| echo "Using triplet: ${triplet}" | |
| # lukka/run-vcpkg sets VCPKG_INSTALLED_DIR with a UUID-based path | |
| # Use that directly instead of trying to find it | |
| echo "Debug: VCPKG_INSTALLED_DIR=${VCPKG_INSTALLED_DIR:-not set}" | |
| if [ -n "${VCPKG_INSTALLED_DIR}" ] && [ -d "${VCPKG_INSTALLED_DIR}/${triplet}" ]; then | |
| vcpkg_installed="${VCPKG_INSTALLED_DIR}/${triplet}" | |
| else | |
| # Fallback: try common locations | |
| 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!" | |
| echo "VCPKG_INSTALLED_DIR=${VCPKG_INSTALLED_DIR:-not set}" | |
| echo "triplet=${triplet}" | |
| echo "GITHUB_WORKSPACE=${{ github.workspace }}" | |
| find "${{ github.workspace }}" -type d -name "vcpkg_installed" 2>/dev/null || true | |
| exit 1 | |
| fi | |
| # Convert backslashes to forward slashes to avoid escape issues in YAML | |
| vcpkg_installed=$(echo "${vcpkg_installed}" | sed 's|\\|/|g') | |
| echo "Using vcpkg_installed: ${vcpkg_installed}" | |
| ls -la "${vcpkg_installed}/" || true | |
| ls -la "${vcpkg_installed}/include/" || true | |
| ls -la "${vcpkg_installed}/lib/" || true | |
| ls -la "${vcpkg_installed}/bin/" || true | |
| # Add vcpkg bin directory to PATH for DLLs (needed for test discovery POST_BUILD) | |
| echo "${vcpkg_installed}/bin" >> $GITHUB_PATH | |
| # For CMake - tell vcpkg toolchain where packages are installed | |
| echo "CMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV | |
| # Get the parent of vcpkg_installed/<triplet> (i.e., vcpkg_installed/) | |
| vcpkg_installed_dir=$(dirname "${vcpkg_installed}") | |
| echo "VCPKG_INSTALLED_DIR=${vcpkg_installed_dir}" >> $GITHUB_ENV | |
| # For B2 (uses explicit paths) | |
| echo "WOLFSSL_INCLUDE=${vcpkg_installed}/include" >> $GITHUB_ENV | |
| echo "WOLFSSL_LIBRARY_PATH=${vcpkg_installed}/lib" >> $GITHUB_ENV | |
| echo "OPENSSL_INCLUDE=${vcpkg_installed}/include" >> $GITHUB_ENV | |
| echo "OPENSSL_LIBRARY_PATH=${vcpkg_installed}/lib" >> $GITHUB_ENV | |
| # Output for cmake extra-args (use forward slashes to avoid YAML escape issues) | |
| # Use .a extension for MinGW, .lib for MSVC | |
| if [[ "${triplet}" == *"mingw"* ]]; then | |
| echo "wolfssl_include=${vcpkg_installed}/include" >> $GITHUB_OUTPUT | |
| echo "wolfssl_library=${vcpkg_installed}/lib/libwolfssl.a" >> $GITHUB_OUTPUT | |
| echo "openssl_root=${vcpkg_installed}" >> $GITHUB_OUTPUT | |
| else | |
| echo "wolfssl_include=${vcpkg_installed}/include" >> $GITHUB_OUTPUT | |
| echo "wolfssl_library=${vcpkg_installed}/lib/wolfssl.lib" >> $GITHUB_OUTPUT | |
| echo "openssl_root=${vcpkg_installed}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Set vcpkg paths (Linux) | |
| if: runner.os == 'Linux' | |
| id: vcpkg-paths-linux | |
| shell: bash | |
| run: | | |
| # lukka/run-vcpkg sets VCPKG_INSTALLED_DIR with a UUID-based path | |
| # Use that directly instead of trying to find it | |
| echo "Debug: VCPKG_INSTALLED_DIR=${VCPKG_INSTALLED_DIR:-not set}" | |
| if [ -n "${VCPKG_INSTALLED_DIR}" ] && [ -d "${VCPKG_INSTALLED_DIR}/x64-linux" ]; then | |
| vcpkg_installed="${VCPKG_INSTALLED_DIR}/x64-linux" | |
| else | |
| # Fallback: try to find it | |
| 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!" | |
| echo "VCPKG_INSTALLED_DIR=${VCPKG_INSTALLED_DIR:-not set}" | |
| echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" | |
| find "${GITHUB_WORKSPACE}" -type d -name "vcpkg_installed" 2>/dev/null || true | |
| find "/__w" -type d -name "vcpkg_installed" 2>/dev/null || true | |
| exit 1 | |
| fi | |
| echo "Using vcpkg_installed: ${vcpkg_installed}" | |
| ls -la "${vcpkg_installed}/" || true | |
| ls -la "${vcpkg_installed}/include/" || true | |
| ls -la "${vcpkg_installed}/lib/" || true | |
| # Output for CMake steps (to pass WolfSSL paths explicitly) | |
| echo "wolfssl_include=${vcpkg_installed}/include" >> $GITHUB_OUTPUT | |
| echo "wolfssl_library=${vcpkg_installed}/lib/libwolfssl.a" >> $GITHUB_OUTPUT | |
| # For B2 - WolfSSL from vcpkg, OpenSSL from system | |
| echo "WOLFSSL_INCLUDE=${vcpkg_installed}/include" >> $GITHUB_ENV | |
| echo "WOLFSSL_LIBRARY_PATH=${vcpkg_installed}/lib" >> $GITHUB_ENV | |
| - name: Set vcpkg paths (macOS) | |
| if: runner.os == '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}" | |
| # lukka/run-vcpkg sets VCPKG_INSTALLED_DIR with a UUID-based path | |
| echo "Debug: VCPKG_INSTALLED_DIR=${VCPKG_INSTALLED_DIR:-not set}" | |
| if [ -n "${VCPKG_INSTALLED_DIR}" ] && [ -d "${VCPKG_INSTALLED_DIR}/${triplet}" ]; then | |
| vcpkg_installed="${VCPKG_INSTALLED_DIR}/${triplet}" | |
| else | |
| # Fallback: try to find it | |
| 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!" | |
| echo "VCPKG_INSTALLED_DIR=${VCPKG_INSTALLED_DIR:-not set}" | |
| echo "triplet=${triplet}" | |
| echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" | |
| find "${GITHUB_WORKSPACE}" -type d -name "vcpkg_installed" 2>/dev/null || true | |
| exit 1 | |
| fi | |
| echo "Using vcpkg_installed: ${vcpkg_installed}" | |
| ls -la "${vcpkg_installed}/" || true | |
| ls -la "${vcpkg_installed}/include/" || true | |
| ls -la "${vcpkg_installed}/lib/" || true | |
| # Output for CMake steps (to pass WolfSSL paths explicitly) | |
| echo "wolfssl_include=${vcpkg_installed}/include" >> $GITHUB_OUTPUT | |
| echo "wolfssl_library=${vcpkg_installed}/lib/libwolfssl.a" >> $GITHUB_OUTPUT | |
| # 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 | |
| - name: Boost B2 Workflow | |
| uses: alandefreitas/cpp-actions/b2-workflow@v1.9.0 | |
| # TEMP: Skip B2 on Windows to test if CMake builds pass | |
| # if: ${{ !matrix.coverage && runner.os != 'Windows' }} | |
| if: ${{ !matrix.coverage }} | |
| env: | |
| ASAN_OPTIONS: ${{ ((matrix.compiler == 'apple-clang' || matrix.compiler == 'clang') && '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' }} | |
| with: | |
| source-dir: boost-root | |
| modules: corosio | |
| toolset: ${{ matrix.b2-toolset }} | |
| build-variant: ${{ matrix.build-type }} | |
| cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx || '' }} | |
| cxxstd: ${{ matrix.cxxstd }} | |
| address-model: ${{ (matrix.x86 && '32') || '64' }} | |
| asan: ${{ matrix.asan }} | |
| ubsan: ${{ matrix.ubsan }} | |
| shared: ${{ matrix.shared }} | |
| rtti: on | |
| cxxflags: ${{ matrix.cxxflags }} ${{ (matrix.asan && '-fsanitize-address-use-after-scope -fsanitize=pointer-subtract') || '' }} | |
| stop-on-error: true | |
| - name: Boost CMake Workflow | |
| uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0 | |
| if: ${{ matrix.coverage || matrix.build-cmake || matrix.is-earliest }} | |
| 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: tests | |
| run-tests: true | |
| install-prefix: .local | |
| 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 BOOST_INCLUDE_LIBRARIES="${{ steps.patch.outputs.module }}" | |
| ${{ matrix.compiler == 'mingw' && '-D CMAKE_VERBOSE_MAKEFILE=ON' || '' }} | |
| ${{ runner.os == 'Linux' && format('-D WolfSSL_INCLUDE_DIR={0}', steps.vcpkg-paths-linux.outputs.wolfssl_include) || '' }} | |
| ${{ runner.os == 'Linux' && format('-D WolfSSL_LIBRARY={0}', steps.vcpkg-paths-linux.outputs.wolfssl_library) || '' }} | |
| ${{ runner.os == 'macOS' && format('-D WolfSSL_INCLUDE_DIR={0}', steps.vcpkg-paths-macos.outputs.wolfssl_include) || '' }} | |
| ${{ runner.os == 'macOS' && format('-D WolfSSL_LIBRARY={0}', steps.vcpkg-paths-macos.outputs.wolfssl_library) || '' }} | |
| ${{ runner.os == 'Windows' && format('-D WolfSSL_INCLUDE_DIR={0}', steps.vcpkg-paths-windows.outputs.wolfssl_include) || '' }} | |
| ${{ runner.os == 'Windows' && format('-D WolfSSL_LIBRARY={0}', steps.vcpkg-paths-windows.outputs.wolfssl_library) || '' }} | |
| ${{ runner.os == 'Windows' && format('-D OPENSSL_ROOT_DIR={0}', steps.vcpkg-paths-windows.outputs.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 | |
| if: startsWith(matrix.runs-on, 'windows') && matrix.shared | |
| run: echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH | |
| - name: Set LD_LIBRARY_PATH | |
| if: startsWith(matrix.runs-on, 'ubuntu') && matrix.shared | |
| run: | | |
| echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/.local/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV" | |
| - name: Find Package Integration Workflow | |
| uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0 | |
| if: ${{ matrix.build-cmake || matrix.is-earliest }} | |
| 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.15' | |
| extra-args: | | |
| -D BOOST_CI_INSTALL_TEST=ON | |
| -D CMAKE_PREFIX_PATH=${{ steps.patch.outputs.workspace_root }}/.local | |
| ${{ runner.os == 'Linux' && format('-D WolfSSL_INCLUDE_DIR={0}', steps.vcpkg-paths-linux.outputs.wolfssl_include) || '' }} | |
| ${{ runner.os == 'Linux' && format('-D WolfSSL_LIBRARY={0}', steps.vcpkg-paths-linux.outputs.wolfssl_library) || '' }} | |
| ${{ runner.os == 'macOS' && format('-D WolfSSL_INCLUDE_DIR={0}', steps.vcpkg-paths-macos.outputs.wolfssl_include) || '' }} | |
| ${{ runner.os == 'macOS' && format('-D WolfSSL_LIBRARY={0}', steps.vcpkg-paths-macos.outputs.wolfssl_library) || '' }} | |
| ${{ runner.os == 'Windows' && format('-D WolfSSL_INCLUDE_DIR={0}', steps.vcpkg-paths-windows.outputs.wolfssl_include) || '' }} | |
| ${{ runner.os == 'Windows' && format('-D WolfSSL_LIBRARY={0}', steps.vcpkg-paths-windows.outputs.wolfssl_library) || '' }} | |
| ${{ runner.os == 'Windows' && format('-D OPENSSL_ROOT_DIR={0}', steps.vcpkg-paths-windows.outputs.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 Workflow | |
| uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0 | |
| if: ${{ matrix.build-cmake || matrix.is-earliest }} | |
| 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 | |
| ${{ runner.os == 'Linux' && format('-D WolfSSL_INCLUDE_DIR={0}', steps.vcpkg-paths-linux.outputs.wolfssl_include) || '' }} | |
| ${{ runner.os == 'Linux' && format('-D WolfSSL_LIBRARY={0}', steps.vcpkg-paths-linux.outputs.wolfssl_library) || '' }} | |
| ${{ runner.os == 'macOS' && format('-D WolfSSL_INCLUDE_DIR={0}', steps.vcpkg-paths-macos.outputs.wolfssl_include) || '' }} | |
| ${{ runner.os == 'macOS' && format('-D WolfSSL_LIBRARY={0}', steps.vcpkg-paths-macos.outputs.wolfssl_library) || '' }} | |
| ${{ runner.os == 'Windows' && format('-D WolfSSL_INCLUDE_DIR={0}', steps.vcpkg-paths-windows.outputs.wolfssl_include) || '' }} | |
| ${{ runner.os == 'Windows' && format('-D WolfSSL_LIBRARY={0}', steps.vcpkg-paths-windows.outputs.wolfssl_library) || '' }} | |
| ${{ runner.os == 'Windows' && format('-D OPENSSL_ROOT_DIR={0}', steps.vcpkg-paths-windows.outputs.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 | |
| - name: Root Project CMake Workflow | |
| uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0 | |
| if: ${{ matrix.build-cmake || matrix.is-earliest }} | |
| with: | |
| source-dir: boost-root/libs/${{ steps.patch.outputs.module }} | |
| build-dir: __build_root_test__ | |
| build-target: tests | |
| run-tests: true | |
| generator: ${{ matrix.generator }} | |
| generator-toolset: ${{ matrix.generator-toolset }} | |
| build-type: ${{ matrix.build-type }} | |
| 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 | |
| ${{ matrix.compiler == 'mingw' && '-D CMAKE_VERBOSE_MAKEFILE=ON' || '' }} | |
| ${{ runner.os == 'Linux' && format('-D WolfSSL_INCLUDE_DIR={0}', steps.vcpkg-paths-linux.outputs.wolfssl_include) || '' }} | |
| ${{ runner.os == 'Linux' && format('-D WolfSSL_LIBRARY={0}', steps.vcpkg-paths-linux.outputs.wolfssl_library) || '' }} | |
| ${{ runner.os == 'macOS' && format('-D WolfSSL_INCLUDE_DIR={0}', steps.vcpkg-paths-macos.outputs.wolfssl_include) || '' }} | |
| ${{ runner.os == 'macOS' && format('-D WolfSSL_LIBRARY={0}', steps.vcpkg-paths-macos.outputs.wolfssl_library) || '' }} | |
| ${{ runner.os == 'Windows' && format('-D WolfSSL_INCLUDE_DIR={0}', steps.vcpkg-paths-windows.outputs.wolfssl_include) || '' }} | |
| ${{ runner.os == 'Windows' && format('-D WolfSSL_LIBRARY={0}', steps.vcpkg-paths-windows.outputs.wolfssl_library) || '' }} | |
| ${{ runner.os == 'Windows' && format('-D OPENSSL_ROOT_DIR={0}', steps.vcpkg-paths-windows.outputs.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 | |
| # Diagnostic: Compare test executables between workflows | |
| - name: Diagnose Root Project Build (Windows) | |
| if: ${{ (matrix.build-cmake || matrix.is-earliest) && runner.os == 'Windows' }} | |
| shell: bash | |
| run: | | |
| # Helper function to get file size portably | |
| get_size() { | |
| if [ -f "$1" ]; then | |
| wc -c < "$1" | tr -d ' ' | |
| else | |
| echo "0" | |
| fi | |
| } | |
| echo "=== Comparing builds between Boost CMake and Root Project workflows ===" | |
| echo "" | |
| echo "=== PATH ===" | |
| echo "$PATH" | tr ':' '\n' | head -20 | |
| echo "" | |
| echo "=== Root Project test executable ===" | |
| root_exe=$(find boost-root/libs/corosio/__build_root_test__ -name "boost_corosio_tests.exe" 2>/dev/null | head -1 || true) | |
| boost_exe=$(find boost-root/__build_cmake_test__ -name "boost_corosio_tests.exe" 2>/dev/null | head -1 || true) | |
| if [ -n "$root_exe" ] && [ -f "$root_exe" ]; then | |
| echo "Found: $root_exe" | |
| echo "Size: $(get_size "$root_exe") bytes" | |
| echo "" | |
| echo "=== Dependencies (dumpbin) ===" | |
| dumpbin //dependents "$root_exe" 2>/dev/null || echo "dumpbin not available" | |
| else | |
| echo "Root project test executable not found" | |
| fi | |
| echo "" | |
| echo "=== Boost CMake test executable ===" | |
| if [ -n "$boost_exe" ] && [ -f "$boost_exe" ]; then | |
| echo "Found: $boost_exe" | |
| echo "Size: $(get_size "$boost_exe") bytes" | |
| else | |
| echo "Boost CMake test executable not found" | |
| fi | |
| echo "" | |
| echo "=== Size comparison ===" | |
| if [ -n "$root_exe" ] && [ -f "$root_exe" ] && [ -n "$boost_exe" ] && [ -f "$boost_exe" ]; then | |
| root_size=$(get_size "$root_exe") | |
| boost_size=$(get_size "$boost_exe") | |
| echo "Root project: $root_size bytes" | |
| echo "Boost CMake: $boost_size bytes" | |
| if [ "$root_size" != "$boost_size" ]; then | |
| echo "WARNING: Executable sizes differ!" | |
| fi | |
| fi | |
| echo "" | |
| echo "=== Diagnostic complete ===" | |
| - name: Generate Coverage Report | |
| if: ${{ matrix.coverage }} | |
| run: | | |
| set -x | |
| # Generate report | |
| gcov_tool="gcov" | |
| if command -v "gcov-${{ steps.setup-cpp.outputs.version-major }}.${{ steps.setup-cpp.outputs.version-minor }}" &> /dev/null; then | |
| gcov_tool="gcov" | |
| elif 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 "boost-root/__build_cmake_test__/coverage.info" \ | |
| -d "boost-root/__build_cmake_test__" \ | |
| --include "*/boost-root/libs/${{steps.patch.outputs.module}}/include/*" \ | |
| --include "*/boost-root/libs/${{steps.patch.outputs.module}}/src/*" \ | |
| --gcov-tool "$gcov_tool" | |
| - name: Upload to Codecov | |
| if: ${{ matrix.coverage }} | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: boost-root/__build_cmake_test__/coverage.info | |
| 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 | |
| changelog: | |
| # needs: [ runner-selection ] | |
| defaults: | |
| run: | |
| shell: bash | |
| name: Changelog Summary | |
| # Skip self-hosted runner selection for now | |
| # runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)['ubuntu-22.04'] }} | |
| 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-.*\..*\..*' | |
| antora: | |
| # needs: [ runner-selection ] | |
| name: Antora Docs | |
| # Skip self-hosted runner selection for now | |
| # runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)['ubuntu-latest'] }} | |
| runs-on: 'ubuntu-latest' | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Install packages | |
| uses: alandefreitas/cpp-actions/package-install@v1.9.0 | |
| with: | |
| apt-get: git cmake | |
| - 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 | |
| shell: bash | |
| run: | | |
| set -xe | |
| pwd | |
| ls | |
| ls -lah boost-source | |
| # 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 | |
| # Copy cached boost-source to an isolated boost-root | |
| cp -r 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" | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Build Antora Docs | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config --global --add safe.directory "$(pwd)" | |
| BOOST_SRC_DIR="$(pwd)/boost-root" | |
| export BOOST_SRC_DIR | |
| cd boost-root/libs/corosio | |
| cd doc | |
| bash ./build_antora.sh | |
| # Antora returns zero even if it fails, so we check if the site directory exists | |
| if [ ! -d "build/site" ]; then | |
| echo "Antora build failed" | |
| exit 1 | |
| fi | |
| - name: Create Antora Docs Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: antora-docs | |
| path: boost-root/libs/corosio/doc/build/site |