From 1db3e791019a50ef46b5d140b2e99ff65ee91fdd Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 1 Dec 2025 11:17:26 +0100 Subject: [PATCH 1/8] Containerize builds using deprecated OSes --- .github/workflows/ci.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c4b95f4..c97f8a5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,11 +47,11 @@ jobs: # Linux, gcc - { compiler: gcc-5, cxxstd: '03,11,14,1z', os: ubuntu-22.04, container: 'ubuntu:18.04' } - { compiler: gcc-6, cxxstd: '03,11,14,17', os: ubuntu-22.04, container: 'ubuntu:18.04' } - - { compiler: gcc-7, cxxstd: '03,11,14,17', os: ubuntu-20.04 } - - { compiler: gcc-8, cxxstd: '03,11,14,17,2a', os: ubuntu-20.04 } - - { compiler: gcc-9, cxxstd: '03,11,14,17,2a', os: ubuntu-20.04 } - - { compiler: gcc-10, cxxstd: '03,11,14,17,20', os: ubuntu-20.04 } - - { compiler: gcc-11, cxxstd: '03,11,14,17,20', os: ubuntu-20.04 } + - { compiler: gcc-7, cxxstd: '03,11,14,17', os: ubuntu-24.04, container: 'ubuntu-20.04' } + - { compiler: gcc-8, cxxstd: '03,11,14,17,2a', os: ubuntu-24.04, container: 'ubuntu-20.04' } + - { compiler: gcc-9, cxxstd: '03,11,14,17,2a', os: ubuntu-24.04, container: 'ubuntu-20.04' } + - { compiler: gcc-10, cxxstd: '03,11,14,17,20', os: ubuntu-24.04, container: 'ubuntu-20.04' } + - { compiler: gcc-11, cxxstd: '03,11,14,17,20', os: ubuntu-24.04, container: 'ubuntu-20.04' } - { compiler: gcc-12, cxxstd: '03,11,14,17,20', os: ubuntu-22.04 } - { name: GCC w/ sanitizers, sanitize: yes, compiler: gcc-12, cxxstd: '03,11,14,17,20', os: ubuntu-22.04 } @@ -64,10 +64,10 @@ jobs: - { compiler: clang-7, cxxstd: '03,11,14,17', os: ubuntu-22.04, container: 'ubuntu:18.04' } # Note: clang-8 does not fully support C++20, so it is not compatible with some libstdc++ versions in this mode - { compiler: clang-8, cxxstd: '03,11,14,17,2a', os: ubuntu-22.04, container: 'ubuntu:18.04', install: 'clang-8 g++-7', gcc_toolchain: 7 } - - { compiler: clang-9, cxxstd: '03,11,14,17,2a', os: ubuntu-20.04 } - - { compiler: clang-10, cxxstd: '03,11,14,17,20', os: ubuntu-20.04 } - - { compiler: clang-11, cxxstd: '03,11,14,17,20', os: ubuntu-20.04 } - - { compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-20.04 } + - { compiler: clang-9, cxxstd: '03,11,14,17,2a', os: ubuntu-24.04, container: 'ubuntu-20.04' } + - { compiler: clang-10, cxxstd: '03,11,14,17,20', os: ubuntu-24.04, container: 'ubuntu-20.04' } + - { compiler: clang-11, cxxstd: '03,11,14,17,20', os: ubuntu-24.04, container: 'ubuntu-20.04' } + - { compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-24.04, container: 'ubuntu-20.04' } # Clang isn't compatible with libstdc++-13, so use the slightly older one - { compiler: clang-13, cxxstd: '03,11,14,17,20', os: ubuntu-22.04, install: 'clang-13 g++-12', gcc_toolchain: 12 } - { compiler: clang-14, cxxstd: '03,11,14,17,20', os: ubuntu-22.04, install: 'clang-14 g++-12', gcc_toolchain: 12 } @@ -77,14 +77,15 @@ jobs: # libc++ - { compiler: clang-6.0, cxxstd: '03,11,14', os: ubuntu-22.04, container: 'ubuntu:18.04', stdlib: libc++, install: 'clang-6.0 libc++-dev libc++abi-dev' } - - { compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-20.04, stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev' } + - { compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-24.04, container: 'ubuntu-20.04', stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev' } - { name: Clang w/ sanitizers, sanitize: yes, - compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-20.04, stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev' } + compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-24.04, container: 'ubuntu-20.04', stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev' } # OSX, clang - - { compiler: clang, cxxstd: '03,11,14,17,20', os: macos-12 } + - { compiler: clang, cxxstd: '03,11,14,17,20', os: macos-14 } + - { compiler: clang, cxxstd: '03,11,14,17,20', os: macos-15 } - { name: MacOS w/ clang and sanitizers, - compiler: clang, cxxstd: '03,11,14,17,20,2b', os: macos-13, sanitize: yes } + compiler: clang, cxxstd: '03,11,14,17,20,2b', os: macos-15, sanitize: yes } timeout-minutes: 120 runs-on: ${{matrix.os}} @@ -225,7 +226,6 @@ jobs: fail-fast: false matrix: include: - - { toolset: msvc-14.2, cxxstd: '14,17,20', addrmd: '32,64', os: windows-2019 } - { toolset: msvc-14.3, cxxstd: '14,17,20,latest',addrmd: '32,64', os: windows-2022 } #- { name: Collect coverage, coverage: yes, # toolset: msvc-14.3, cxxstd: 'latest', addrmd: '64', os: windows-2022 } From 5956695e7abfaad8db18c9fa6520a2281a4f4bd0 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 1 Dec 2025 11:20:34 +0100 Subject: [PATCH 2/8] Completely replace posix runs --- .github/workflows/ci.yml | 583 +++++++++++++++++++++++++++++---------- 1 file changed, 442 insertions(+), 141 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c97f8a5c..b7ffad33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,179 +44,480 @@ jobs: fail-fast: false matrix: include: - # Linux, gcc - - { compiler: gcc-5, cxxstd: '03,11,14,1z', os: ubuntu-22.04, container: 'ubuntu:18.04' } - - { compiler: gcc-6, cxxstd: '03,11,14,17', os: ubuntu-22.04, container: 'ubuntu:18.04' } - - { compiler: gcc-7, cxxstd: '03,11,14,17', os: ubuntu-24.04, container: 'ubuntu-20.04' } - - { compiler: gcc-8, cxxstd: '03,11,14,17,2a', os: ubuntu-24.04, container: 'ubuntu-20.04' } - - { compiler: gcc-9, cxxstd: '03,11,14,17,2a', os: ubuntu-24.04, container: 'ubuntu-20.04' } - - { compiler: gcc-10, cxxstd: '03,11,14,17,20', os: ubuntu-24.04, container: 'ubuntu-20.04' } - - { compiler: gcc-11, cxxstd: '03,11,14,17,20', os: ubuntu-24.04, container: 'ubuntu-20.04' } - - { compiler: gcc-12, cxxstd: '03,11,14,17,20', os: ubuntu-22.04 } - - { name: GCC w/ sanitizers, sanitize: yes, - compiler: gcc-12, cxxstd: '03,11,14,17,20', os: ubuntu-22.04 } - #- { name: Collect coverage, coverage: yes, - # compiler: gcc-8, cxxstd: '03,11', os: ubuntu-20.04, install: 'g++-8-multilib', address-model: '32,64' } + - toolset: gcc-5 + cxxstd: "03,11,14,1z" + address_model: 32,64 + os: ubuntu-latest + container: ubuntu:16.04 + install: + - g++-5-multilib + - toolset: gcc-5 + cxxstd: "03-gnu,11-gnu,14-gnu,1z-gnu" + address_model: 32,64 + os: ubuntu-latest + container: ubuntu:16.04 + install: + - g++-5-multilib + - toolset: gcc-6 + cxxstd: "03,11,14,1z" + address_model: 32,64 + os: ubuntu-latest + container: ubuntu:18.04 + install: + - g++-6-multilib + - toolset: gcc-7 + cxxstd: "03,11,14,17" + address_model: 32,64 + os: ubuntu-latest + container: ubuntu:18.04 + install: + - g++-7-multilib + - toolset: gcc-8 + cxxstd: "03,11,14,17,2a" + address_model: 32,64 + os: ubuntu-latest + container: ubuntu:18.04 + install: + - g++-8-multilib + - toolset: gcc-9 + cxxstd: "03,11,14,17,2a" + address_model: 32,64 + os: ubuntu-latest + container: ubuntu:20.04 + install: + - g++-9-multilib + - toolset: gcc-9 + cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,2a-gnu" + address_model: 32,64 + os: ubuntu-latest + container: ubuntu:20.04 + install: + - g++-9-multilib + - toolset: gcc-10 + cxxstd: "03,11,14,17,20" + address_model: 32,64 + os: ubuntu-latest + container: ubuntu:20.04 + install: + - g++-10-multilib + - toolset: gcc-11 + cxxstd: "03,11,14,17,20,23" + address_model: 32,64 + os: ubuntu-latest + container: ubuntu:22.04 + install: + - g++-11-multilib + - toolset: gcc-12 + cxxstd: "03,11,14,17,20,23" + address_model: 32,64 + os: ubuntu-latest + container: ubuntu:22.04 + install: + - g++-12-multilib + - toolset: gcc-12 + cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,23-gnu" + address_model: 32,64 + os: ubuntu-latest + container: ubuntu:22.04 + install: + - g++-12-multilib + - name: UBSAN + toolset: gcc-12 + cxxstd: "03,11,14,17,20,23" + address_model: 32,64 + ubsan: 1 + os: ubuntu-latest + container: ubuntu:22.04 + install: + - g++-12-multilib + - toolset: gcc-13 + cxxstd: "03,11,14,17,20,23" + address_model: 32,64 + os: ubuntu-24.04 + install: + - g++-13-multilib + cxxflags: -fexcess-precision=fast # Linux, clang - - { compiler: clang-5.0, cxxstd: '03,11,14,1z', os: ubuntu-22.04, container: 'ubuntu:18.04' } - - { compiler: clang-6.0, cxxstd: '03,11,14,17', os: ubuntu-22.04, container: 'ubuntu:18.04' } - - { compiler: clang-7, cxxstd: '03,11,14,17', os: ubuntu-22.04, container: 'ubuntu:18.04' } - # Note: clang-8 does not fully support C++20, so it is not compatible with some libstdc++ versions in this mode - - { compiler: clang-8, cxxstd: '03,11,14,17,2a', os: ubuntu-22.04, container: 'ubuntu:18.04', install: 'clang-8 g++-7', gcc_toolchain: 7 } - - { compiler: clang-9, cxxstd: '03,11,14,17,2a', os: ubuntu-24.04, container: 'ubuntu-20.04' } - - { compiler: clang-10, cxxstd: '03,11,14,17,20', os: ubuntu-24.04, container: 'ubuntu-20.04' } - - { compiler: clang-11, cxxstd: '03,11,14,17,20', os: ubuntu-24.04, container: 'ubuntu-20.04' } - - { compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-24.04, container: 'ubuntu-20.04' } - # Clang isn't compatible with libstdc++-13, so use the slightly older one - - { compiler: clang-13, cxxstd: '03,11,14,17,20', os: ubuntu-22.04, install: 'clang-13 g++-12', gcc_toolchain: 12 } - - { compiler: clang-14, cxxstd: '03,11,14,17,20', os: ubuntu-22.04, install: 'clang-14 g++-12', gcc_toolchain: 12 } - - { compiler: clang-15, cxxstd: '03,11,14,17,20', os: ubuntu-22.04, install: 'clang-15 g++-12', gcc_toolchain: 12 } - - { compiler: clang-16, cxxstd: '11,14,17,20,2b', os: ubuntu-latest, container: 'ubuntu:23.04' } - - { compiler: clang-17, cxxstd: '11,14,17,20,2b', os: ubuntu-latest, container: 'ubuntu:23.10' } - - # libc++ - - { compiler: clang-6.0, cxxstd: '03,11,14', os: ubuntu-22.04, container: 'ubuntu:18.04', stdlib: libc++, install: 'clang-6.0 libc++-dev libc++abi-dev' } - - { compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-24.04, container: 'ubuntu-20.04', stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev' } - - { name: Clang w/ sanitizers, sanitize: yes, - compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-24.04, container: 'ubuntu-20.04', stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev' } - - # OSX, clang - - { compiler: clang, cxxstd: '03,11,14,17,20', os: macos-14 } - - { compiler: clang, cxxstd: '03,11,14,17,20', os: macos-15 } - - { name: MacOS w/ clang and sanitizers, - compiler: clang, cxxstd: '03,11,14,17,20,2b', os: macos-15, sanitize: yes } - - timeout-minutes: 120 + - toolset: clang + compiler: clang++-3.8 + cxxstd: "03,11,14" + os: ubuntu-latest + container: ubuntu:16.04 + install: + - clang-3.8 + - toolset: clang + compiler: clang++-3.9 + cxxstd: "03,11,14" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-3.9 + - toolset: clang + compiler: clang++-4.0 + cxxstd: "03,11,14" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-4.0 + - toolset: clang + compiler: clang++-5.0 + cxxstd: "03,11,14,1z" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-5.0 + - toolset: clang + compiler: clang++-6.0 + cxxstd: "03,11,14,17" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-6.0 + - toolset: clang + compiler: clang++-7 + cxxstd: "03,11,14,17" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-7 + # Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode + - toolset: clang + compiler: clang++-8 + cxxstd: "03,11,14,17,2a" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-8 + - g++-7 + gcc_toolchain: 7 + - toolset: clang + compiler: clang++-9 + cxxstd: "03,11,14,17,2a" + os: ubuntu-latest + container: ubuntu:20.04 + install: + - clang-9 + - toolset: clang + compiler: clang++-10 + cxxstd: "03,11,14,17,20" + os: ubuntu-latest + container: ubuntu:20.04 + install: + - clang-10 + - toolset: clang + compiler: clang++-11 + cxxstd: "03,11,14,17,20" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-11 + - toolset: clang + compiler: clang++-12 + cxxstd: "03,11,14,17,20" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-12 + - toolset: clang + compiler: clang++-13 + cxxstd: "03,11,14,17,20" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-13 + - toolset: clang + compiler: clang++-14 + cxxstd: "03,11,14,17,20" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-14 + - toolset: clang + compiler: clang++-14 + cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-14 + - toolset: clang + compiler: clang++-15 + cxxstd: "03,11,14,17,20" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-15 + sources: + - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" + source_keys: + - "https://apt.llvm.org/llvm-snapshot.gpg.key" + - toolset: clang + compiler: clang++-15 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-15 + - libc++-15-dev + - libc++abi-15-dev + sources: + - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" + source_keys: + - "https://apt.llvm.org/llvm-snapshot.gpg.key" + cxxflags: -stdlib=libc++ + linkflags: -stdlib=libc++ + - toolset: clang + compiler: clang++-16 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-16 + sources: + - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" + source_keys: + - "https://apt.llvm.org/llvm-snapshot.gpg.key" + - toolset: clang + compiler: clang++-17 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-17 + sources: + - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" + source_keys: + - "https://apt.llvm.org/llvm-snapshot.gpg.key" + - name: UBSAN + toolset: clang + compiler: clang++-14 + cxxstd: "03,11,14,17,20,2b" + cxxflags: -stdlib=libc++ + linkflags: -stdlib=libc++ + ubsan: 1 + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-14 + - libc++-14-dev + - libc++abi-14-dev + + - toolset: clang + cxxstd: "03,11,14,17,20,2b" + os: macos-14 + - toolset: clang + cxxstd: "03,11,14,17,20,2b" + os: macos-15 + + timeout-minutes: 60 runs-on: ${{matrix.os}} - container: ${{matrix.container}} - env: {B2_USE_CCACHE: 1} + container: + image: ${{matrix.container}} + volumes: + - /node20217:/node20217:rw,rshared + - ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }} steps: - name: Setup environment run: | - if [ -f "/etc/debian_version" ]; then + if [ -f "/etc/debian_version" ] + then echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV export DEBIAN_FRONTEND=noninteractive fi - if [ -n "${{matrix.container}}" ] && [ -f "/etc/debian_version" ]; then - apt-get -o Acquire::Retries=$NET_RETRY_COUNT update - apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common curl - # Need (newer) git, and the older Ubuntu container may require requesting the key manually using port 80 - curl -sSL --retry ${NET_RETRY_COUNT:-5} 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xE1DD270288B4E6030699E45FA1715D88E1DF1F24' | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/git-core_ubuntu_ppa.gpg - for i in {1..${NET_RETRY_COUNT:-3}}; do sudo -E add-apt-repository -y ppa:git-core/ppa && break || sleep 10; done - apt-get -o Acquire::Retries=$NET_RETRY_COUNT update - osver=$(lsb_release -sr | cut -f1 -d.) - pkgs="g++ git" - # Ubuntu 22+ has only Python 3 in the repos - if [ -n "$osver" ] && [ "$osver" -ge "22" ]; then - pkgs+=" python-is-python3 libpython3-dev" - else - pkgs+=" python libpython-dev" + if [ -n "${{matrix.container}}" ] + then + echo "GHA_CONTAINER=${{matrix.container}}" >> $GITHUB_ENV + if [ -f "/etc/debian_version" ] + then + apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + if [ "$(apt-cache search "^python-is-python3$" | wc -l)" -ne 0 ] + then + PYTHON_PACKAGE="python-is-python3" + else + PYTHON_PACKAGE="python" + fi + apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ $PYTHON_PACKAGE python3 perl git cmake + fi + if [[ "${{matrix.container}}" == "ubuntu:1"* ]]; then + # Node 20 doesn't work with Ubuntu 16/18 glibc: https://github.com/actions/checkout/issues/1590 + curl -sL https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20217 fi - apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y $pkgs - fi - # For jobs not compatible with ccache, use "ccache: no" in the matrix - if [[ "${{ matrix.ccache }}" == "no" ]]; then - echo "B2_USE_CCACHE=0" >> $GITHUB_ENV fi git config --global pack.threads 0 - - - uses: actions/checkout@v3 - with: - # For coverage builds fetch the whole history, else only 1 commit using a 'fake ternary' - fetch-depth: ${{ matrix.coverage && '0' || '1' }} - - - name: Cache ccache - uses: actions/cache@v3 - if: env.B2_USE_CCACHE - with: - path: ~/.ccache - key: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-${{github.sha}} - restore-keys: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}- - - - name: Fetch Boost.CI - uses: actions/checkout@v3 - with: - repository: boostorg/boost-ci - ref: master - path: boost-ci-cloned - - - name: Get CI scripts folder - run: | - # Copy ci folder if not testing Boost.CI - [[ "$GITHUB_REPOSITORY" =~ "boost-ci" ]] || cp -r boost-ci-cloned/ci . - rm -rf boost-ci-cloned + - uses: actions/checkout@v4 - name: Install packages - if: startsWith(matrix.os, 'ubuntu') + if: matrix.install run: | - SOURCE_KEYS=(${{join(matrix.source_keys, ' ')}}) - SOURCES=(${{join(matrix.sources, ' ')}}) - # Add this by default - SOURCES+=(ppa:ubuntu-toolchain-r/test) - for key in "${SOURCE_KEYS[@]}"; do - for i in {1..$NET_RETRY_COUNT}; do - keyfilename=$(basename -s .key $key) - curl -sSL --retry ${NET_RETRY_COUNT:-5} "$key" | sudo gpg --dearmor > /etc/apt/trusted.gpg.d/${keyfilename} && break || sleep 10 + declare -a SOURCE_KEYS SOURCES + if [ -n "${{join(matrix.source_keys, ' ')}}" ] + then + SOURCE_KEYS=("${{join(matrix.source_keys, '" "')}}") + fi + if [ -n "${{join(matrix.sources, ' ')}}" ] + then + SOURCES=("${{join(matrix.sources, '" "')}}") + fi + for key in "${SOURCE_KEYS[@]}" + do + for i in {1..$NET_RETRY_COUNT} + do + echo "Adding key: $key" + wget -O - "$key" | sudo apt-key add - && break || sleep 2 done done - for source in "${SOURCES[@]}"; do - for i in {1..$NET_RETRY_COUNT}; do - sudo add-apt-repository $source && break || sleep 10 + if [ ${#SOURCES[@]} -gt 0 ] + then + APT_ADD_REPO_COMMON_ARGS=("-y") + APT_ADD_REPO_SUPPORTED_ARGS="$(apt-add-repository --help | perl -ne 'if (/^\s*-n/) { print "n"; } elsif (/^\s*-P/) { print "P"; } elsif (/^\s*-S/) { print "S"; } elsif (/^\s*-U/) { print "U"; }')" + if [ -n "$APT_ADD_REPO_SUPPORTED_ARGS" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*n*}" ] + then + APT_ADD_REPO_COMMON_ARGS+=("-n") + fi + APT_ADD_REPO_HAS_SOURCE_ARGS="$([ -n "$APT_ADD_REPO_SUPPORTED_ARGS" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*P*}" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*S*}" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*U*}" ] && echo 1 || echo 0)" + for source in "${SOURCES[@]}" + do + for i in {1..$NET_RETRY_COUNT} + do + APT_ADD_REPO_ARGS=("${APT_ADD_REPO_COMMON_ARGS[@]}") + if [ $APT_ADD_REPO_HAS_SOURCE_ARGS -ne 0 ] + then + case "$source" in + "ppa:"*) + APT_ADD_REPO_ARGS+=("-P") + ;; + "deb "*) + APT_ADD_REPO_ARGS+=("-S") + ;; + *) + APT_ADD_REPO_ARGS+=("-U") + ;; + esac + fi + APT_ADD_REPO_ARGS+=("$source") + echo "apt-add-repository ${APT_ADD_REPO_ARGS[@]}" + sudo -E apt-add-repository "${APT_ADD_REPO_ARGS[@]}" && break || sleep 2 + done done - done - sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update - if [[ -z "${{matrix.install}}" ]]; then - pkgs="${{matrix.compiler}}" - pkgs="${pkgs/gcc-/g++-}" - else - pkgs="${{matrix.install}}" fi - sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y $pkgs - + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y ${{join(matrix.install, ' ')}} locales + sudo locale-gen de_DE.UTF-8 + sudo update-locale - name: Setup GCC Toolchain if: matrix.gcc_toolchain run: | GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain" - echo "GCC_TOOLCHAIN_ROOT=$GCC_TOOLCHAIN_ROOT" >> $GITHUB_ENV - if ! command -v dpkg-architecture; then - apt-get install -y dpkg-dev - fi + echo "GCC_TOOLCHAIN_ROOT=\"$GCC_TOOLCHAIN_ROOT\"" >> $GITHUB_ENV MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" mkdir -p "$GCC_TOOLCHAIN_ROOT" ln -s /usr/include "$GCC_TOOLCHAIN_ROOT/include" ln -s /usr/bin "$GCC_TOOLCHAIN_ROOT/bin" mkdir -p "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET" ln -s "/usr/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" - - name: Setup Boost - env: - B2_ADDRESS_MODEL: ${{matrix.address-model}} - B2_COMPILER: ${{matrix.compiler}} - B2_CXXSTD: ${{matrix.cxxstd}} - B2_SANITIZE: ${{matrix.sanitize}} - B2_STDLIB: ${{matrix.stdlib}} - # More entries can be added in the same way, see the B2_ARGS assignment in ci/enforce.sh for the possible keys. - # B2_DEFINES: ${{matrix.defines}} - # Variables set here (to non-empty) will override the top-level environment variables, e.g. - # B2_VARIANT: ${{matrix.variant}} - # Set the (B2) target(s) to build, defaults to the test folder of the current library - # Can alternatively be done like this in the build step or in the build command of the build step, e.g. `run: B2_TARGETS=libs/$SELF/doc ci/build.sh` - # B2_TARGETS: libs/foo/test//bar - run: source ci/github/install.sh - - #- name: Setup coverage collection - # if: matrix.coverage - # run: ci/github/codecov.sh "setup" - + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + BUILD_JOBS=$((nproc || sysctl -n hw.ncpu) 2> /dev/null) + echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV + echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV + DEPINST_ARGS=() + GIT_VERSION="$(git --version | sed -e 's/git version //')" + GIT_HAS_JOBS=1 + if [ -f "/etc/debian_version" ] + then + if $(dpkg --compare-versions "$GIT_VERSION" lt 2.8.0) + then + GIT_HAS_JOBS=0 + fi + else + declare -a GIT_VER=(${GIT_VERSION//./ }) + declare -a GIT_MIN_VER=(2 8 0) + for ((i=0; i<${#GIT_VER[@]}; i++)) + do + if [ -z "${GIT_MIN_VER[i]}" ] + then + GIT_MIN_VER[i]=0 + fi + if [ "${GIT_VER[i]}" -lt "${GIT_MIN_VER[i]}" ] + then + GIT_HAS_JOBS=0 + break + fi + done + fi + if [ "$GIT_HAS_JOBS" -ne 0 ] + then + DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS") + fi + cd .. + git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root" + cd boost-root + mkdir -p libs/$LIBRARY + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY + git submodule update --init tools/boostdep + DEPINST_ARGS+=("$LIBRARY") + python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}" + if [ -z "${{matrix.cmake_tests}}" ] + then + ./bootstrap.sh + ./b2 headers + if [ -n "${{matrix.compiler}}" -o -n "$GCC_TOOLCHAIN_ROOT" ] + then + echo -n "using ${{matrix.toolset}} : : ${{matrix.compiler}}" > ~/user-config.jam + if [ -n "$GCC_TOOLCHAIN_ROOT" ] + then + echo -n " : \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\" \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\"" >> ~/user-config.jam + fi + echo " ;" >> ~/user-config.jam + fi + fi - name: Run tests - if: '!matrix.coverity' - run: ci/build.sh - - #- name: Upload coverage - # if: matrix.coverage - # run: ci/codecov.sh "upload" + if: matrix.cmake_tests == '' + run: | + cd ../boost-root + B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}" "link=static,shared") + if [ -n "${{matrix.build_variant}}" ] + then + B2_ARGS+=("variant=${{matrix.build_variant}}") + else + B2_ARGS+=("variant=$DEFAULT_BUILD_VARIANT") + fi + if [ -n "${{matrix.threading}}" ] + then + B2_ARGS+=("threading=${{matrix.threading}}") + fi + if [ -n "${{matrix.ubsan}}" ] + then + export UBSAN_OPTIONS="print_stacktrace=1" + B2_ARGS+=("cxxflags=-fsanitize=undefined -fno-sanitize-recover=undefined" "linkflags=-fsanitize=undefined -fuse-ld=gold" "define=UBSAN=1" "debug-symbols=on" "visibility=global") + fi + if [ -n "${{matrix.cxxflags}}" ] + then + B2_ARGS+=("cxxflags=${{matrix.cxxflags}}") + fi + if [ -n "${{matrix.linkflags}}" ] + then + B2_ARGS+=("linkflags=${{matrix.linkflags}}") + fi + if [ -n "${{matrix.address_model}}" ] + then + B2_ARGS+=("address-model=${{matrix.address_model}}") + fi + B2_ARGS+=("libs/$LIBRARY/test") + set -x + ./b2 "${B2_ARGS[@]}" windows: defaults: From ffa8864edfb385a139afbeb50a5e85d9752f46f1 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 1 Dec 2025 11:41:13 +0100 Subject: [PATCH 3/8] Replace everything with boost CI --- .github/workflows/ci.yml | 615 ++------------------------------------- 1 file changed, 25 insertions(+), 590 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7ffad33..71ab2f64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,20 @@ +# # Copyright 2020-2021 Peter Dimov # Copyright 2021 Andrey Semashev -# Copyright 2021 Alexander Grund -# Copyright 2022 James E. King III -# Copyright 2023 Matt Borland +# Copyright 2021-2024 Alexander Grund +# Copyright 2022-2025 James E. King III # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) +# +# This workflow uses the Boost.CI reusable workflow which builds a variety of +# configurations of your project, runs tests, and generates code coverage reports. +# +# To use it, copy this file into your repository as `.github/workflows/ci.yml` and +# customize it appropriately. +# --- -name: CI +name: Boost.CI on: pull_request: @@ -18,592 +25,20 @@ on: - bugfix/** - feature/** - fix/** + - github/** - pr/** - -concurrency: - group: ${{format('{0}:{1}', github.repository, github.ref)}} - cancel-in-progress: true - -env: - GIT_FETCH_JOBS: 8 - NET_RETRY_COUNT: 5 - B2_CI_VERSION: 1 - B2_VARIANT: debug,release - B2_LINK: shared,static - LCOV_BRANCH_COVERAGE: 0 - CODECOV_NAME: Github Actions - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true + paths-ignore: + - LICENSE + - meta/** + - README.md jobs: - posix: - defaults: - run: - shell: bash - - strategy: - fail-fast: false - matrix: - include: - - toolset: gcc-5 - cxxstd: "03,11,14,1z" - address_model: 32,64 - os: ubuntu-latest - container: ubuntu:16.04 - install: - - g++-5-multilib - - toolset: gcc-5 - cxxstd: "03-gnu,11-gnu,14-gnu,1z-gnu" - address_model: 32,64 - os: ubuntu-latest - container: ubuntu:16.04 - install: - - g++-5-multilib - - toolset: gcc-6 - cxxstd: "03,11,14,1z" - address_model: 32,64 - os: ubuntu-latest - container: ubuntu:18.04 - install: - - g++-6-multilib - - toolset: gcc-7 - cxxstd: "03,11,14,17" - address_model: 32,64 - os: ubuntu-latest - container: ubuntu:18.04 - install: - - g++-7-multilib - - toolset: gcc-8 - cxxstd: "03,11,14,17,2a" - address_model: 32,64 - os: ubuntu-latest - container: ubuntu:18.04 - install: - - g++-8-multilib - - toolset: gcc-9 - cxxstd: "03,11,14,17,2a" - address_model: 32,64 - os: ubuntu-latest - container: ubuntu:20.04 - install: - - g++-9-multilib - - toolset: gcc-9 - cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,2a-gnu" - address_model: 32,64 - os: ubuntu-latest - container: ubuntu:20.04 - install: - - g++-9-multilib - - toolset: gcc-10 - cxxstd: "03,11,14,17,20" - address_model: 32,64 - os: ubuntu-latest - container: ubuntu:20.04 - install: - - g++-10-multilib - - toolset: gcc-11 - cxxstd: "03,11,14,17,20,23" - address_model: 32,64 - os: ubuntu-latest - container: ubuntu:22.04 - install: - - g++-11-multilib - - toolset: gcc-12 - cxxstd: "03,11,14,17,20,23" - address_model: 32,64 - os: ubuntu-latest - container: ubuntu:22.04 - install: - - g++-12-multilib - - toolset: gcc-12 - cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu,23-gnu" - address_model: 32,64 - os: ubuntu-latest - container: ubuntu:22.04 - install: - - g++-12-multilib - - name: UBSAN - toolset: gcc-12 - cxxstd: "03,11,14,17,20,23" - address_model: 32,64 - ubsan: 1 - os: ubuntu-latest - container: ubuntu:22.04 - install: - - g++-12-multilib - - toolset: gcc-13 - cxxstd: "03,11,14,17,20,23" - address_model: 32,64 - os: ubuntu-24.04 - install: - - g++-13-multilib - cxxflags: -fexcess-precision=fast - - # Linux, clang - - toolset: clang - compiler: clang++-3.8 - cxxstd: "03,11,14" - os: ubuntu-latest - container: ubuntu:16.04 - install: - - clang-3.8 - - toolset: clang - compiler: clang++-3.9 - cxxstd: "03,11,14" - os: ubuntu-latest - container: ubuntu:18.04 - install: - - clang-3.9 - - toolset: clang - compiler: clang++-4.0 - cxxstd: "03,11,14" - os: ubuntu-latest - container: ubuntu:18.04 - install: - - clang-4.0 - - toolset: clang - compiler: clang++-5.0 - cxxstd: "03,11,14,1z" - os: ubuntu-latest - container: ubuntu:18.04 - install: - - clang-5.0 - - toolset: clang - compiler: clang++-6.0 - cxxstd: "03,11,14,17" - os: ubuntu-latest - container: ubuntu:18.04 - install: - - clang-6.0 - - toolset: clang - compiler: clang++-7 - cxxstd: "03,11,14,17" - os: ubuntu-latest - container: ubuntu:18.04 - install: - - clang-7 - # Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode - - toolset: clang - compiler: clang++-8 - cxxstd: "03,11,14,17,2a" - os: ubuntu-latest - container: ubuntu:18.04 - install: - - clang-8 - - g++-7 - gcc_toolchain: 7 - - toolset: clang - compiler: clang++-9 - cxxstd: "03,11,14,17,2a" - os: ubuntu-latest - container: ubuntu:20.04 - install: - - clang-9 - - toolset: clang - compiler: clang++-10 - cxxstd: "03,11,14,17,20" - os: ubuntu-latest - container: ubuntu:20.04 - install: - - clang-10 - - toolset: clang - compiler: clang++-11 - cxxstd: "03,11,14,17,20" - os: ubuntu-latest - container: ubuntu:22.04 - install: - - clang-11 - - toolset: clang - compiler: clang++-12 - cxxstd: "03,11,14,17,20" - os: ubuntu-latest - container: ubuntu:22.04 - install: - - clang-12 - - toolset: clang - compiler: clang++-13 - cxxstd: "03,11,14,17,20" - os: ubuntu-latest - container: ubuntu:22.04 - install: - - clang-13 - - toolset: clang - compiler: clang++-14 - cxxstd: "03,11,14,17,20" - os: ubuntu-latest - container: ubuntu:22.04 - install: - - clang-14 - - toolset: clang - compiler: clang++-14 - cxxstd: "03-gnu,11-gnu,14-gnu,17-gnu,20-gnu" - os: ubuntu-latest - container: ubuntu:22.04 - install: - - clang-14 - - toolset: clang - compiler: clang++-15 - cxxstd: "03,11,14,17,20" - os: ubuntu-latest - container: ubuntu:22.04 - install: - - clang-15 - sources: - - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" - source_keys: - - "https://apt.llvm.org/llvm-snapshot.gpg.key" - - toolset: clang - compiler: clang++-15 - cxxstd: "03,11,14,17,20,2b" - os: ubuntu-latest - container: ubuntu:22.04 - install: - - clang-15 - - libc++-15-dev - - libc++abi-15-dev - sources: - - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" - source_keys: - - "https://apt.llvm.org/llvm-snapshot.gpg.key" - cxxflags: -stdlib=libc++ - linkflags: -stdlib=libc++ - - toolset: clang - compiler: clang++-16 - cxxstd: "03,11,14,17,20,2b" - os: ubuntu-latest - container: ubuntu:22.04 - install: - - clang-16 - sources: - - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" - source_keys: - - "https://apt.llvm.org/llvm-snapshot.gpg.key" - - toolset: clang - compiler: clang++-17 - cxxstd: "03,11,14,17,20,2b" - os: ubuntu-latest - container: ubuntu:22.04 - install: - - clang-17 - sources: - - "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" - source_keys: - - "https://apt.llvm.org/llvm-snapshot.gpg.key" - - name: UBSAN - toolset: clang - compiler: clang++-14 - cxxstd: "03,11,14,17,20,2b" - cxxflags: -stdlib=libc++ - linkflags: -stdlib=libc++ - ubsan: 1 - os: ubuntu-latest - container: ubuntu:22.04 - install: - - clang-14 - - libc++-14-dev - - libc++abi-14-dev - - - toolset: clang - cxxstd: "03,11,14,17,20,2b" - os: macos-14 - - toolset: clang - cxxstd: "03,11,14,17,20,2b" - os: macos-15 - - timeout-minutes: 60 - runs-on: ${{matrix.os}} - container: - image: ${{matrix.container}} - volumes: - - /node20217:/node20217:rw,rshared - - ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }} - - steps: - - name: Setup environment - run: | - if [ -f "/etc/debian_version" ] - then - echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV - export DEBIAN_FRONTEND=noninteractive - fi - if [ -n "${{matrix.container}}" ] - then - echo "GHA_CONTAINER=${{matrix.container}}" >> $GITHUB_ENV - if [ -f "/etc/debian_version" ] - then - apt-get -o Acquire::Retries=$NET_RETRY_COUNT update - if [ "$(apt-cache search "^python-is-python3$" | wc -l)" -ne 0 ] - then - PYTHON_PACKAGE="python-is-python3" - else - PYTHON_PACKAGE="python" - fi - apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ $PYTHON_PACKAGE python3 perl git cmake - fi - if [[ "${{matrix.container}}" == "ubuntu:1"* ]]; then - # Node 20 doesn't work with Ubuntu 16/18 glibc: https://github.com/actions/checkout/issues/1590 - curl -sL https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20217 - fi - fi - git config --global pack.threads 0 - - uses: actions/checkout@v4 - - - name: Install packages - if: matrix.install - run: | - declare -a SOURCE_KEYS SOURCES - if [ -n "${{join(matrix.source_keys, ' ')}}" ] - then - SOURCE_KEYS=("${{join(matrix.source_keys, '" "')}}") - fi - if [ -n "${{join(matrix.sources, ' ')}}" ] - then - SOURCES=("${{join(matrix.sources, '" "')}}") - fi - for key in "${SOURCE_KEYS[@]}" - do - for i in {1..$NET_RETRY_COUNT} - do - echo "Adding key: $key" - wget -O - "$key" | sudo apt-key add - && break || sleep 2 - done - done - if [ ${#SOURCES[@]} -gt 0 ] - then - APT_ADD_REPO_COMMON_ARGS=("-y") - APT_ADD_REPO_SUPPORTED_ARGS="$(apt-add-repository --help | perl -ne 'if (/^\s*-n/) { print "n"; } elsif (/^\s*-P/) { print "P"; } elsif (/^\s*-S/) { print "S"; } elsif (/^\s*-U/) { print "U"; }')" - if [ -n "$APT_ADD_REPO_SUPPORTED_ARGS" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*n*}" ] - then - APT_ADD_REPO_COMMON_ARGS+=("-n") - fi - APT_ADD_REPO_HAS_SOURCE_ARGS="$([ -n "$APT_ADD_REPO_SUPPORTED_ARGS" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*P*}" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*S*}" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*U*}" ] && echo 1 || echo 0)" - for source in "${SOURCES[@]}" - do - for i in {1..$NET_RETRY_COUNT} - do - APT_ADD_REPO_ARGS=("${APT_ADD_REPO_COMMON_ARGS[@]}") - if [ $APT_ADD_REPO_HAS_SOURCE_ARGS -ne 0 ] - then - case "$source" in - "ppa:"*) - APT_ADD_REPO_ARGS+=("-P") - ;; - "deb "*) - APT_ADD_REPO_ARGS+=("-S") - ;; - *) - APT_ADD_REPO_ARGS+=("-U") - ;; - esac - fi - APT_ADD_REPO_ARGS+=("$source") - echo "apt-add-repository ${APT_ADD_REPO_ARGS[@]}" - sudo -E apt-add-repository "${APT_ADD_REPO_ARGS[@]}" && break || sleep 2 - done - done - fi - sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update - sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y ${{join(matrix.install, ' ')}} locales - sudo locale-gen de_DE.UTF-8 - sudo update-locale - - name: Setup GCC Toolchain - if: matrix.gcc_toolchain - run: | - GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain" - echo "GCC_TOOLCHAIN_ROOT=\"$GCC_TOOLCHAIN_ROOT\"" >> $GITHUB_ENV - MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" - mkdir -p "$GCC_TOOLCHAIN_ROOT" - ln -s /usr/include "$GCC_TOOLCHAIN_ROOT/include" - ln -s /usr/bin "$GCC_TOOLCHAIN_ROOT/bin" - mkdir -p "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET" - ln -s "/usr/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" - - name: Setup Boost - run: | - echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY - LIBRARY=${GITHUB_REPOSITORY#*/} - echo LIBRARY: $LIBRARY - echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV - echo GITHUB_BASE_REF: $GITHUB_BASE_REF - echo GITHUB_REF: $GITHUB_REF - REF=${GITHUB_BASE_REF:-$GITHUB_REF} - REF=${REF#refs/heads/} - echo REF: $REF - BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true - echo BOOST_BRANCH: $BOOST_BRANCH - BUILD_JOBS=$((nproc || sysctl -n hw.ncpu) 2> /dev/null) - echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV - echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV - DEPINST_ARGS=() - GIT_VERSION="$(git --version | sed -e 's/git version //')" - GIT_HAS_JOBS=1 - if [ -f "/etc/debian_version" ] - then - if $(dpkg --compare-versions "$GIT_VERSION" lt 2.8.0) - then - GIT_HAS_JOBS=0 - fi - else - declare -a GIT_VER=(${GIT_VERSION//./ }) - declare -a GIT_MIN_VER=(2 8 0) - for ((i=0; i<${#GIT_VER[@]}; i++)) - do - if [ -z "${GIT_MIN_VER[i]}" ] - then - GIT_MIN_VER[i]=0 - fi - if [ "${GIT_VER[i]}" -lt "${GIT_MIN_VER[i]}" ] - then - GIT_HAS_JOBS=0 - break - fi - done - fi - if [ "$GIT_HAS_JOBS" -ne 0 ] - then - DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS") - fi - cd .. - git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root" - cd boost-root - mkdir -p libs/$LIBRARY - cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY - git submodule update --init tools/boostdep - DEPINST_ARGS+=("$LIBRARY") - python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}" - if [ -z "${{matrix.cmake_tests}}" ] - then - ./bootstrap.sh - ./b2 headers - if [ -n "${{matrix.compiler}}" -o -n "$GCC_TOOLCHAIN_ROOT" ] - then - echo -n "using ${{matrix.toolset}} : : ${{matrix.compiler}}" > ~/user-config.jam - if [ -n "$GCC_TOOLCHAIN_ROOT" ] - then - echo -n " : \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\" \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\"" >> ~/user-config.jam - fi - echo " ;" >> ~/user-config.jam - fi - fi - - name: Run tests - if: matrix.cmake_tests == '' - run: | - cd ../boost-root - B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}" "link=static,shared") - if [ -n "${{matrix.build_variant}}" ] - then - B2_ARGS+=("variant=${{matrix.build_variant}}") - else - B2_ARGS+=("variant=$DEFAULT_BUILD_VARIANT") - fi - if [ -n "${{matrix.threading}}" ] - then - B2_ARGS+=("threading=${{matrix.threading}}") - fi - if [ -n "${{matrix.ubsan}}" ] - then - export UBSAN_OPTIONS="print_stacktrace=1" - B2_ARGS+=("cxxflags=-fsanitize=undefined -fno-sanitize-recover=undefined" "linkflags=-fsanitize=undefined -fuse-ld=gold" "define=UBSAN=1" "debug-symbols=on" "visibility=global") - fi - if [ -n "${{matrix.cxxflags}}" ] - then - B2_ARGS+=("cxxflags=${{matrix.cxxflags}}") - fi - if [ -n "${{matrix.linkflags}}" ] - then - B2_ARGS+=("linkflags=${{matrix.linkflags}}") - fi - if [ -n "${{matrix.address_model}}" ] - then - B2_ARGS+=("address-model=${{matrix.address_model}}") - fi - B2_ARGS+=("libs/$LIBRARY/test") - set -x - ./b2 "${B2_ARGS[@]}" - - windows: - defaults: - run: - shell: cmd - strategy: - fail-fast: false - matrix: - include: - - { toolset: msvc-14.3, cxxstd: '14,17,20,latest',addrmd: '32,64', os: windows-2022 } - #- { name: Collect coverage, coverage: yes, - # toolset: msvc-14.3, cxxstd: 'latest', addrmd: '64', os: windows-2022 } - - { toolset: clang-win, cxxstd: '14,17,latest', addrmd: '32,64', os: windows-2022 } - #- { toolset: gcc, cxxstd: '03,11,14,17,2a', addrmd: '64', os: windows-2019 } - - runs-on: ${{matrix.os}} - - steps: - - uses: actions/checkout@v3 - - - name: Fetch Boost.CI - uses: actions/checkout@v3 - with: - repository: boostorg/boost-ci - ref: master - path: boost-ci-cloned - - name: Get CI scripts folder - run: | - REM Copy ci folder if not testing Boost.CI - if "%GITHUB_REPOSITORY%" == "%GITHUB_REPOSITORY:boost-ci=%" xcopy /s /e /q /i /y boost-ci-cloned\ci .\ci - rmdir /s /q boost-ci-cloned - - - name: Setup Boost - run: ci\github\install.bat - - - name: Run tests - if: '!matrix.coverage' - run: ci\build.bat - env: - B2_TOOLSET: ${{matrix.toolset}} - B2_CXXSTD: ${{matrix.cxxstd}} - B2_ADDRESS_MODEL: ${{matrix.addrmd}} - - MSYS2: - defaults: - run: - shell: msys2 {0} - strategy: - fail-fast: false - matrix: - include: - # - { sys: MINGW32, compiler: gcc, cxxstd: '03,11,17,20' } - - { sys: MINGW64, compiler: gcc, cxxstd: '03,11,17,20' } - - runs-on: windows-latest - - steps: - - uses: actions/checkout@v3 - - - name: Setup MSYS2 environment - uses: msys2/setup-msys2@v2 - with: - msystem: ${{matrix.sys}} - update: true - install: git python - pacboy: gcc:p cmake:p ninja:p - - - name: Fetch Boost.CI - uses: actions/checkout@v3 - with: - repository: boostorg/boost-ci - ref: master - path: boost-ci-cloned - - name: Get CI scripts folder - run: | - # Copy ci folder if not testing Boost.CI - [[ "$GITHUB_REPOSITORY" =~ "boost-ci" ]] || cp -r boost-ci-cloned/ci . - rm -rf boost-ci-cloned - - - name: Setup Boost - env: - B2_COMPILER: ${{matrix.compiler}} - B2_CXXSTD: ${{matrix.cxxstd}} - B2_SANITIZE: ${{matrix.sanitize}} - B2_STDLIB: ${{matrix.stdlib}} - run: ci/github/install.sh - - - name: Run tests - run: ci/build.sh + call-boost-ci: + name: Run Boost.CI + uses: boostorg/boost-ci/.github/workflows/reusable.yml@master + # Example of customization: + # with: + # enable_reflection: true + # enable_windows: false + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From d3469b04e8f2dc663535977332a09bfb44424776 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 1 Dec 2025 12:29:17 +0100 Subject: [PATCH 4/8] Update exclusions --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71ab2f64..0a20e689 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,5 +40,8 @@ jobs: # with: # enable_reflection: true # enable_windows: false + with: + exclude_compiler: 'icpx-2025' # Invalid commands errors + exclude_cxxstd: '2b' # Clang-16 + 2b has issues with libstdc++ compat secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 0b0859e4dd41c30423c2c345cb8003c245eaa6d9 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 1 Dec 2025 12:57:23 +0100 Subject: [PATCH 5/8] Disable CMake as its not currently supported --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a20e689..f6ebb5af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,5 +43,6 @@ jobs: with: exclude_compiler: 'icpx-2025' # Invalid commands errors exclude_cxxstd: '2b' # Clang-16 + 2b has issues with libstdc++ compat + enable_cmake: 'false' secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 452254e66a1b5e55a18a6114ecadf9784856e6ae Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 1 Dec 2025 13:01:33 +0100 Subject: [PATCH 6/8] Fix syntax --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6ebb5af..fa734046 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,6 @@ jobs: with: exclude_compiler: 'icpx-2025' # Invalid commands errors exclude_cxxstd: '2b' # Clang-16 + 2b has issues with libstdc++ compat - enable_cmake: 'false' + enable_cmake: false secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 0e0027abc6c0875a481465dd8e6b5221246101b0 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 1 Dec 2025 15:37:52 +0100 Subject: [PATCH 7/8] Exclude cygwin since tests are too large --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa734046..7cdecc95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,5 +44,6 @@ jobs: exclude_compiler: 'icpx-2025' # Invalid commands errors exclude_cxxstd: '2b' # Clang-16 + 2b has issues with libstdc++ compat enable_cmake: false + enable_cygwin : false secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 4ab90647f686bc06003d45050b95df2d6037fd14 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 1 Dec 2025 16:56:42 +0100 Subject: [PATCH 8/8] Disable stalling s390x runner --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cdecc95..ba143fa3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,5 +45,6 @@ jobs: exclude_cxxstd: '2b' # Clang-16 + 2b has issues with libstdc++ compat enable_cmake: false enable_cygwin : false + enable_multiarch: false secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}