diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f1b15c6..78a3a01 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,71 +8,71 @@ on: workflow_dispatch: jobs: - # Test on Linux with multiple C++ standards + # ── Linux x86_64 ────────────────────────────────────────────────── linux: name: Linux (${{ matrix.os }}, C++${{ matrix.cpp_standard }}, ${{ matrix.compiler }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-22.04, ubuntu-24.04] - cpp_standard: [17, 20, 23] - compiler: [gcc, clang] include: - - compiler: gcc - cc: gcc-11 - cxx: g++-11 - - compiler: clang - cc: clang-14 - cxx: clang++-14 - - os: ubuntu-24.04 - cpp_standard: 20 - compiler: clang-19 - cc: clang-19 - cxx: clang++-19 - - os: ubuntu-24.04 - cpp_standard: 23 - compiler: clang-19 - cc: clang-19 - cxx: clang++-19 - # C++26 requires newer compilers (GCC 14+, Clang 19+) - - os: ubuntu-24.04 - cpp_standard: 26 - compiler: gcc-14 - cc: gcc-14 - cxx: g++-14 - - os: ubuntu-24.04 - cpp_standard: 26 - compiler: clang-19 - cc: clang-19 - cxx: clang++-19 - exclude: - # Clang 14 is too old for GCC 14's libstdc++ on Ubuntu 24.04 with C++20/23 - - os: ubuntu-24.04 - compiler: clang - cpp_standard: 20 - - os: ubuntu-24.04 - compiler: clang - cpp_standard: 23 - + # ── Ubuntu 22.04 (pre-installed: GCC 10/11/12, Clang 13/14/15) ── + - { os: ubuntu-22.04, compiler: GCC 11, cc: gcc-11, cxx: g++-11, cpp_standard: 17 } + - { os: ubuntu-22.04, compiler: GCC 11, cc: gcc-11, cxx: g++-11, cpp_standard: 20 } + - { os: ubuntu-22.04, compiler: GCC 11, cc: gcc-11, cxx: g++-11, cpp_standard: 23 } + - { os: ubuntu-22.04, compiler: GCC 12, cc: gcc-12, cxx: g++-12, cpp_standard: 20 } + - { os: ubuntu-22.04, compiler: Clang 14, cc: clang-14, cxx: clang++-14, cpp_standard: 17 } + - { os: ubuntu-22.04, compiler: Clang 14, cc: clang-14, cxx: clang++-14, cpp_standard: 20 } + - { os: ubuntu-22.04, compiler: Clang 14, cc: clang-14, cxx: clang++-14, cpp_standard: 23 } + - { os: ubuntu-22.04, compiler: Clang 15, cc: clang-15, cxx: clang++-15, cpp_standard: 20 } + - { os: ubuntu-22.04, compiler: Clang 15, cc: clang-15, cxx: clang++-15, cpp_standard: 23 } + # ── Ubuntu 24.04 (pre-installed: GCC 12/13/14, Clang 16-19) ───── + - { os: ubuntu-24.04, compiler: GCC 13, cc: gcc-13, cxx: g++-13, cpp_standard: 17 } + - { os: ubuntu-24.04, compiler: GCC 13, cc: gcc-13, cxx: g++-13, cpp_standard: 20 } + - { os: ubuntu-24.04, compiler: GCC 13, cc: gcc-13, cxx: g++-13, cpp_standard: 23 } + - { os: ubuntu-24.04, compiler: GCC 14, cc: gcc-14, cxx: g++-14, cpp_standard: 17 } + - { os: ubuntu-24.04, compiler: GCC 14, cc: gcc-14, cxx: g++-14, cpp_standard: 20 } + - { os: ubuntu-24.04, compiler: GCC 14, cc: gcc-14, cxx: g++-14, cpp_standard: 23 } + - { os: ubuntu-24.04, compiler: GCC 14, cc: gcc-14, cxx: g++-14, cpp_standard: 26 } + - { os: ubuntu-24.04, compiler: GCC 15, cc: gcc-15, cxx: g++-15, cpp_standard: 20 } + - { os: ubuntu-24.04, compiler: GCC 15, cc: gcc-15, cxx: g++-15, cpp_standard: 23 } + - { os: ubuntu-24.04, compiler: GCC 15, cc: gcc-15, cxx: g++-15, cpp_standard: 26 } + - { os: ubuntu-24.04, compiler: Clang 16, cc: clang-16, cxx: clang++-16, cpp_standard: 17 } + - { os: ubuntu-24.04, compiler: Clang 16, cc: clang-16, cxx: clang++-16, cpp_standard: 20 } + - { os: ubuntu-24.04, compiler: Clang 18, cc: clang-18, cxx: clang++-18, cpp_standard: 17 } + - { os: ubuntu-24.04, compiler: Clang 18, cc: clang-18, cxx: clang++-18, cpp_standard: 20 } + - { os: ubuntu-24.04, compiler: Clang 19, cc: clang-19, cxx: clang++-19, cpp_standard: 20 } + - { os: ubuntu-24.04, compiler: Clang 19, cc: clang-19, cxx: clang++-19, cpp_standard: 23 } + - { os: ubuntu-24.04, compiler: Clang 19, cc: clang-19, cxx: clang++-19, cpp_standard: 26 } + - { os: ubuntu-24.04, compiler: Clang 21, cc: clang-21, cxx: clang++-21, cpp_standard: 20 } + - { os: ubuntu-24.04, compiler: Clang 21, cc: clang-21, cxx: clang++-21, cpp_standard: 23 } + - { os: ubuntu-24.04, compiler: Clang 21, cc: clang-21, cxx: clang++-21, cpp_standard: 26 } + steps: - name: Checkout code uses: actions/checkout@v4 - + + - name: Add toolchain PPA (GCC 15) + if: matrix.cc == 'gcc-15' + run: | + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt-get update + + - name: Add LLVM repo (Clang 21) + if: matrix.cc == 'clang-21' + run: | + wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc + echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm-21.list + sudo apt-get update + - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y cmake ninja-build - if [ "${{ matrix.compiler }}" = "gcc" ]; then - sudo apt-get install -y g++-11 g++-12 g++-13 - elif [ "${{ matrix.compiler }}" = "gcc-14" ]; then - sudo apt-get install -y g++-14 - elif [ "${{ matrix.compiler }}" = "clang-19" ]; then - sudo apt-get install -y clang-19 - else - sudo apt-get install -y clang-14 clang-15 - fi - + case "${{ matrix.cxx }}" in + g++*) sudo apt-get install -y cmake ninja-build ${{ matrix.cxx }} ;; + clang++*) sudo apt-get install -y cmake ninja-build ${{ matrix.cc }} ;; + esac + - name: Configure CMake env: CC: ${{ matrix.cc }} @@ -83,18 +83,16 @@ jobs: -DCMAKE_CXX_STANDARD=${{ matrix.cpp_standard }} \ -DTHREADSCHEDULE_BUILD_EXAMPLES=ON \ -DTHREADSCHEDULE_BUILD_TESTS=ON - + - name: Build run: cmake --build build --parallel - + - name: Run tests run: | cd build ctest --output-on-failure --parallel - # Removed macOS job per request - - # Test on Windows + # ── Windows ──────────────────────────────────────────────────────── windows: name: Windows (C++${{ matrix.cpp_standard }}, ${{ matrix.compiler }}, ${{ matrix.image }}) runs-on: ${{ matrix.image }} @@ -104,15 +102,15 @@ jobs: cpp_standard: [17, 20, 23] compiler: [msvc, mingw] image: [windows-latest, windows-2025] - + steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Setup MSVC (Developer Command Prompt) if: matrix.compiler == 'msvc' uses: ilammy/msvc-dev-cmd@v1 - + - name: Setup MinGW if: matrix.compiler == 'mingw' uses: msys2/setup-msys2@v2 @@ -123,16 +121,16 @@ jobs: mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja - + - name: Install Ninja (MSVC) if: matrix.compiler == 'msvc' run: choco install ninja --no-progress --yes - + - name: Configure CMake (MSVC) if: matrix.compiler == 'msvc' run: | cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=${{ matrix.cpp_standard }} -DTHREADSCHEDULE_BUILD_EXAMPLES=ON -DTHREADSCHEDULE_BUILD_TESTS=ON -Dgtest_force_shared_crt=ON - + - name: Configure CMake (MinGW) if: matrix.compiler == 'mingw' shell: msys2 {0} @@ -142,22 +140,22 @@ jobs: -DCMAKE_CXX_STANDARD=${{ matrix.cpp_standard }} \ -DTHREADSCHEDULE_BUILD_EXAMPLES=ON \ -DTHREADSCHEDULE_BUILD_TESTS=ON - + - name: Build (MSVC) if: matrix.compiler == 'msvc' run: cmake --build build --parallel - + - name: Build (MinGW) if: matrix.compiler == 'mingw' shell: msys2 {0} run: cmake --build build --parallel - + - name: Run tests (MSVC) if: matrix.compiler == 'msvc' run: | cd build ctest --output-on-failure --parallel - + - name: Run tests (MinGW) if: matrix.compiler == 'mingw' shell: msys2 {0} @@ -165,19 +163,21 @@ jobs: cd build ctest --output-on-failure --parallel - - # Test on Linux ARM64 (simple config, default compilers) + # ── Linux ARM64 ──────────────────────────────────────────────────── linux-arm: - name: Linux ARM64 (ubuntu-24.04-arm, C++${{ matrix.cpp_standard }}, ${{ matrix.compiler }}) + name: Linux ARM64 (C++${{ matrix.cpp_standard }}, ${{ matrix.compiler }}) runs-on: ubuntu-24.04-arm strategy: fail-fast: false matrix: include: - - cpp_standard: 23 - compiler: g++ - - cpp_standard: 26 - compiler: g++-14 + - { compiler: GCC 13, cxx: g++, cpp_standard: 17 } + - { compiler: GCC 13, cxx: g++, cpp_standard: 20 } + - { compiler: GCC 13, cxx: g++, cpp_standard: 23 } + - { compiler: GCC 14, cxx: g++-14, cpp_standard: 20 } + - { compiler: GCC 14, cxx: g++-14, cpp_standard: 23 } + - { compiler: GCC 14, cxx: g++-14, cpp_standard: 26 } + steps: - name: Checkout code uses: actions/checkout@v4 @@ -185,11 +185,11 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y cmake ninja-build ${{ matrix.compiler }} + sudo apt-get install -y cmake ninja-build ${{ matrix.cxx }} - name: Configure CMake env: - CXX: ${{ matrix.compiler }} + CXX: ${{ matrix.cxx }} run: | cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ @@ -205,7 +205,7 @@ jobs: cd build ctest --output-on-failure --parallel - # C++20 Module build verification + # ── C++20 Module build verification ──────────────────────────────── modules-linux: name: Modules (Linux, C++${{ matrix.cpp_standard }}, ${{ matrix.compiler }}) runs-on: ubuntu-24.04 diff --git a/README.md b/README.md index b87409c..02f395a 100644 --- a/README.md +++ b/README.md @@ -73,43 +73,51 @@ ThreadSchedule is designed to work on any platform with a C++17 (or newer) compiler and standard threading support. The library is **continuously tested** on: -| Platform | Compiler | C++17 | C++20 | C++23 | C++26 | -| ------------------- | --------------- | :---: | :---: | :---: | :---: | -| **Linux (x86_64)** | | | | | | -| Ubuntu 22.04 | GCC 11 | ✅ | ✅ | ✅ | - | -| Ubuntu 22.04 | Clang 14 | ✅ | ✅ | ✅ | - | -| Ubuntu 24.04 | GCC 11 | ✅ | ✅ | ✅ | - | -| Ubuntu 24.04 | GCC 14 | - | - | - | ✅ | -| Ubuntu 24.04 | Clang 14 | ✅ | - | - | - | -| Ubuntu 24.04 | Clang 19 | - | ✅ | ✅ | ✅ | -| **Linux (ARM64)** | | | | | | -| Ubuntu 24.04 ARM64 | GCC (system) | - | - | ✅ | - | -| Ubuntu 24.04 ARM64 | GCC 14 | - | - | - | ✅ | -| **Windows** | | | | | | -| Windows Server 2022 | MSVC 2022 | ✅ | ✅ | ✅ | - | -| Windows Server 2022 | MinGW-w64 (GCC) | ✅ | ✅ | ✅ | - | -| Windows Server 2025 | MSVC 2022 | ✅ | ✅ | ✅ | - | -| Windows Server 2025 | MinGW-w64 (GCC) | ✅ | ✅ | ✅ | - | +| Platform | Compiler | C++17 | C++20 | C++23 | C++26 | +| ------------------- | ----------------- | :---: | :---: | :---: | :---: | +| **Linux (x86_64)** | | | | | | +| Ubuntu 22.04 | GCC 11 | ✅ | ✅ | ✅ | - | +| Ubuntu 22.04 | GCC 12 | - | ✅ | - | - | +| Ubuntu 22.04 | Clang 14 | ✅ | ✅ | ✅ | - | +| Ubuntu 22.04 | Clang 15 | - | ✅ | ✅ | - | +| Ubuntu 24.04 | GCC 13 | ✅ | ✅ | ✅ | - | +| Ubuntu 24.04 | GCC 14 | ✅ | ✅ | ✅ | ✅ | +| Ubuntu 24.04 | GCC 15 | - | ✅ | ✅ | ✅ | +| Ubuntu 24.04 | Clang 16 | ✅ | ✅ | - | - | +| Ubuntu 24.04 | Clang 18 | ✅ | ✅ | - | - | +| Ubuntu 24.04 | Clang 19 | - | ✅ | ✅ | ✅ | +| Ubuntu 24.04 | Clang 21 | - | ✅ | ✅ | ✅ | +| **Linux (ARM64)** | | | | | | +| Ubuntu 24.04 ARM64 | GCC 13 (system) | ✅ | ✅ | ✅ | - | +| Ubuntu 24.04 ARM64 | GCC 14 | - | ✅ | ✅ | ✅ | +| **Windows** | | | | | | +| Windows Server 2022 | MSVC 2022 | ✅ | ✅ | ✅ | - | +| Windows Server 2022 | MinGW-w64 (GCC 15)| ✅ | ✅ | ✅ | - | +| Windows Server 2025 | MSVC 2022 | ✅ | ✅ | ✅ | - | +| Windows Server 2025 | MinGW-w64 (GCC 15)| ✅ | ✅ | ✅ | - | **Additional platforms:** ThreadSchedule should work on other platforms (macOS, FreeBSD, other Linux distributions) with standard C++17+ compilers, but these are not regularly tested in CI. +> **C++23**: GCC 12's libstdc++ lacks monadic `std::expected` operations +> (`and_then`, `transform`, …). Clang 16/18 on Ubuntu 24.04 use GCC 14's +> libstdc++ headers which expose `std::expected` incorrectly to those Clang +> versions. These combinations are therefore only tested up to C++20. +> > **C++26**: Requires GCC 14+ or Clang 19+. MSVC does not yet expose > `cxx_std_26` to CMake; C++26 on Windows is not tested. > -> **Ubuntu 24.04 Clang**: Clang 14 is limited to C++17 on 24.04; for C++20/23, -> Clang 19 is used. +> **GCC 15**: Installed via `ppa:ubuntu-toolchain-r/test` on Ubuntu 24.04. +> +> **Clang 21**: Installed via the official LLVM apt repository +> (`apt.llvm.org`) on Ubuntu 24.04. > > **Windows ARM64**: Not currently covered by GitHub-hosted runners, requires > self-hosted runner for testing. > -> **MinGW**: MinGW-w64 provides full Windows API support including thread naming -> (Windows 10+). - -> ⚠️ **Known Issue (Ubuntu 24.04)**: Older Clang versions with newer GCC -> libstdc++ may have compatibility issues. Use Clang 19 for best C++23/26 -> support on Ubuntu 24.04. +> **MinGW**: MinGW-w64 (MSYS2) ships GCC 15 and provides full Windows API +> support including thread naming (Windows 10+). ## Quick Start