diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index c4a3d126..31cf75b5 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -21,27 +21,29 @@ jobs: - name: Build run: | - brew install gcc@14 lcov ninja binutils + brew install gcc@15 lcov ninja binutils brew link --force binutils - cmake -E make_directory ${{runner.workspace}}/build - cd ${{runner.workspace}}/build - cmake ${GITHUB_WORKSPACE} -GNinja -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_CXX_FLAGS="--coverage" -DCMAKE_EXE_LINKER_FLAGS="--coverage" - cmake --build . + cmake -B build -GNinja \ + -DCMAKE_CXX_COMPILER=g++-15 \ + -DCMAKE_CXX_FLAGS="--coverage" \ + -DCMAKE_EXE_LINKER_FLAGS="--coverage" \ + -DFLUX_BUILD_EXAMPLES=Off + cmake --build build - name: Run tests - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest - name: Generate coverage report - working-directory: ${{runner.workspace}}/build/test/CMakeFiles/test-flux.dir + working-directory: ${{github.workspace}}/build/test/CMakeFiles/test-flux.dir run: | - lcov --directory . --capture --gcov gcov-14 --output-file coverage.info + lcov --directory . --capture --gcov gcov-15 --output-file coverage.info lcov --remove coverage.info '*/test/*' --output-file coverage.info - name: Upload coverage report uses: codecov/codecov-action@v4 with: - files: ${{runner.workspace}}/build/test/CMakeFiles/test-flux.dir/coverage.info + files: ${{github.workspace}}/build/test/CMakeFiles/test-flux.dir/coverage.info token: ${{secrets.CODECOV_TOKEN}} verbose: true diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7dbc789e..b40036db 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -23,7 +23,7 @@ on: jobs: analyze: name: Analyze - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest permissions: actions: read contents: read @@ -42,38 +42,36 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} + build-mode: manual # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. - + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs # queries: security-extended,security-and-quality - + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 + # - name: Autobuild + # uses: github/codeql-action/autobuild@v4 # â„šī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - # If the Autobuild fails above, remove it and uncomment the following three lines. + # If the Autobuild fails above, remove it and uncomment the following three lines. # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. # - run: | # echo "Run, Build Application using script" # ./location_of_script_within_repo/buildscript.sh - #- run: | - # ${{matrix.install}} - # cmake -E make_directory ${{runner.workspace}}/build - # cd ${{runner.workspace}}/build - # cmake ${GITHUB_WORKSPACE} -GNinja -DCMAKE_CXX_COMPILER=g++-13 - # cmake --build . - + - run: | + cmake -B build -GNinja + cmake --build build + - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 diff --git a/.github/workflows/generate-single-header.yml b/.github/workflows/generate-single-header.yml index 454e156d..fb8ea2c9 100644 --- a/.github/workflows/generate-single-header.yml +++ b/.github/workflows/generate-single-header.yml @@ -9,7 +9,7 @@ jobs: run: name: Generate runs-on: ubuntu-latest - + permissions: contents: write @@ -24,20 +24,18 @@ jobs: - name: Build run: | - brew install gcc@14 binutils + brew install gcc@15 binutils brew link --force binutils - cmake -E make_directory ${{runner.workspace}}/build - cd ${{runner.workspace}}/build - cmake ${GITHUB_WORKSPACE} -DCMAKE_CXX_COMPILER=g++-14 -DFLUX_BUILD_TOOLS=On - cmake --build . --target make_single_header + cmake -B build -DCMAKE_CXX_COMPILER=g++-14 -DFLUX_BUILD_TOOLS=On + cmake --build build --target make_single_header - name: Run - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ./tools/make_single_header ${GITHUB_WORKSPACE}/include/flux.hpp ${GITHUB_WORKSPACE}/single_include/flux.hpp - name: Upload - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@v6 with: commit_message: Update single header file_pattern: 'single_include/*' diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 9754d523..0e6845e9 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,4 +1,4 @@ -name: linux +name: Linux CI on: push: @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - compiler: [GCC-12, GCC-13, GCC-14, GCC-15, Clang-17, Clang-18, Clang-19, Clang-20] + compiler: [GCC-12, GCC-13, GCC-14, GCC-15, Clang-17, Clang-18, Clang-19, Clang-20, Clang-21] test_with: [Headers, Module] build_type: [Debug, Release] @@ -22,8 +22,6 @@ jobs: test_with: Module - compiler: GCC-14 test_with: Module - - compiler: GCC-15 - test_with: Module - compiler: Clang-17 test_with: Module @@ -68,6 +66,11 @@ jobs: install: | brew install llvm@20 ninja binutils brew link --force binutils + - compiler: Clang-21 + cxx: $(brew --prefix llvm@21)/bin/clang++ + install: | + brew install llvm@21 ninja binutils + brew link --force binutils steps: - uses: actions/checkout@master @@ -78,23 +81,22 @@ jobs: - name: Create Build Environment run: | ${{matrix.install}} - cmake -E make_directory ${{runner.workspace}}/build - name: Configure - working-directory: ${{runner.workspace}}/build run: | - cmake -GNinja -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=${{matrix.cxx}} \ + cmake -B build -GNinja \ + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ + -DCMAKE_CXX_COMPILER=${{matrix.cxx}} \ + -DCMAKE_CXX_EXTENSIONS=Off \ -DFLUX_BUILD_BENCHMARKS=${{matrix.build_type == 'Release'}} \ -DFLUX_BUILD_MODULE=${{matrix.test_with == 'Module'}} \ - -DFLUX_BUILD_TESTS_USING_MODULE=${{matrix.test_with == 'Module'}} \ - $GITHUB_WORKSPACE + -DFLUX_BUILD_TESTS_USING_MODULE=${{matrix.test_with == 'Module'}} - name: Build - working-directory: ${{runner.workspace}}/build - run: cmake --build . + run: cmake --build build - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest -C ${{matrix.build_type}} env: CTEST_OUTPUT_ON_FAILURE: True diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2cf0ff5b..ab561034 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,7 +1,7 @@ # Based on macos.yml from {fmt} # https://github.com/fmtlib/fmt/blob/master/.github/workflows/macos.yml -name: macos +name: MacOS CI on: push: @@ -14,7 +14,7 @@ jobs: runs-on: macos-15 strategy: matrix: - compiler: [AppleClang, LLVM-Clang-16, LLVM-Clang-17, LLVM-Clang-18, LLVM-Clang-19, LLVM-Clang-20] + compiler: [AppleClang, LLVM-Clang-16, LLVM-Clang-17, LLVM-Clang-18, LLVM-Clang-19, LLVM-Clang-20, LLVM-Clang-21] test_with: [Headers, Module] build_type: [Debug, Release] @@ -50,6 +50,12 @@ jobs: install: | brew update brew install llvm@20 ninja + - compiler: LLVM-Clang-21 + cxx: $(brew --prefix llvm@21)/bin/clang++ + ldflags: -L$(brew --prefix llvm@21)/lib/c++ + install: | + brew update + brew install llvm@21 ninja steps: @@ -58,23 +64,24 @@ jobs: - name: Create Build Environment run: | ${{matrix.install}} - cmake -E make_directory ${{runner.workspace}}/build - name: Configure - working-directory: ${{runner.workspace}}/build run: | - cmake -GNinja -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=${{matrix.cxx}} \ - -DFLUX_BUILD_BENCHMARKS=${{matrix.build_type == 'Release'}} \ - -DFLUX_BUILD_MODULE=${{matrix.test_with == 'Module'}} \ - -DFLUX_BUILD_TESTS_USING_MODULE=${{matrix.test_with == 'Module'}} \ - $GITHUB_WORKSPACE + cmake -B build -GNinja \ + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ + -DCMAKE_CXX_COMPILER=${{matrix.cxx}} \ + -DCMAKE_EXE_LINKER_FLAGS=${{matrix.ldflags}} \ + -DCMAKE_OSX_SYSROOT=$(xcrun --sdk macosx --show-sdk-path) \ + -DCMAKE_CXX_EXTENSIONS=Off \ + -DFLUX_BUILD_BENCHMARKS=${{matrix.build_type == 'Release'}} \ + -DFLUX_BUILD_MODULE=${{matrix.test_with == 'Module'}} \ + -DFLUX_BUILD_TESTS_USING_MODULE=${{matrix.test_with == 'Module'}} - name: Build - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config ${{matrix.build_type}} + run: cmake --build build --config ${{matrix.build_type}} - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest -C ${{matrix.build_type}} env: CTEST_OUTPUT_ON_FAILURE: True diff --git a/.github/workflows/santizers.yml b/.github/workflows/santizers.yml index 834084ce..11fb6410 100644 --- a/.github/workflows/santizers.yml +++ b/.github/workflows/santizers.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - sanitizer: [ubsan, asan] + sanitizer: [address, undefined] build_type: [Debug, Release] include: - - cxx: g++-14 + - cxx: g++-15 install: | - brew install gcc@14 ninja binutils + brew install gcc@15 ninja binutils brew link --force binutils steps: @@ -28,23 +28,21 @@ jobs: - name: Create Build Environment run: | ${{matrix.install}} - cmake -E make_directory ${{runner.workspace}}/build - name: Configure - working-directory: ${{runner.workspace}}/build run: | - cmake -GNinja \ - -DFLUX_ENABLE_ASAN=${{matrix.sanitizer == 'asan'}} \ - -DFLUX_ENABLE_UBSAN=${{matrix.sanitizer == 'ubsan'}} \ - -DCMAKE_CXX_COMPILER=g++-14 \ - $GITHUB_WORKSPACE + cmake -B build -GNinja \ + -DCMAKE_CXX_COMPILER=${{matrix.cxx}} \ + -DCMAKE_CXX_EXTENSIONS=Off \ + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ + -DCMAKE_CXX_FLAGS="-fsanitize=${{matrix.sanitizer}}" \ + -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=${{matrix.sanitizer}}" - name: Build - working-directory: ${{runner.workspace}}/build - run: cmake --build . + run: cmake --build build - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest -C ${{matrix.build_type}} env: CTEST_OUTPUT_ON_FAILURE: True diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2499b392..b528f38a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,4 +1,4 @@ -name: windows +name: Windows CI on: push: @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: windows-2022 + runs-on: windows-2025 strategy: matrix: platform: [x86, x64] @@ -21,25 +21,20 @@ jobs: with: arch: ${{matrix.platform}} - - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build - - name: Configure # Use a bash shell for $GITHUB_WORKSPACE. shell: bash - working-directory: ${{runner.workspace}}/build run: | - cmake -G Ninja \ + cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ - -DFLUX_BUILD_BENCHMARKS=${{matrix.build_type == 'Release'}} \ - $GITHUB_WORKSPACE + -DCMAKE_CXX_EXTENSIONS=Off \ + -DFLUX_BUILD_BENCHMARKS=${{matrix.build_type == 'Release'}} - name: Build - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config ${{matrix.build_type}} + run: cmake --build build --config ${{matrix.build_type}} - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest -C ${{matrix.build_type}} -V env: CTEST_OUTPUT_ON_FAILURE: True diff --git a/include/flux/adaptor/reverse.hpp b/include/flux/adaptor/reverse.hpp index fe1fb266..2296692f 100644 --- a/include/flux/adaptor/reverse.hpp +++ b/include/flux/adaptor/reverse.hpp @@ -40,7 +40,7 @@ struct reverse_adaptor : inline_sequence_base> -> std::strong_ordering requires std::three_way_comparable, std::strong_ordering> { - return rhs <=> lhs; + return rhs.base_cur <=> lhs.base_cur; } }; diff --git a/test/test_chain.cpp b/test/test_chain.cpp index ff1b6e8f..e4326038 100644 --- a/test/test_chain.cpp +++ b/test/test_chain.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include "test_utils.hpp" diff --git a/test/test_empty.cpp b/test/test_empty.cpp index 937e834e..602b40df 100644 --- a/test/test_empty.cpp +++ b/test/test_empty.cpp @@ -5,6 +5,7 @@ #include +#include #include #ifdef USE_MODULES diff --git a/test/test_flatten_with.cpp b/test/test_flatten_with.cpp index 5bb21796..2c4785a1 100644 --- a/test/test_flatten_with.cpp +++ b/test/test_flatten_with.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -76,7 +77,7 @@ constexpr bool test_flatten_with_single_pass() std::array arr{ "123"sv, ""sv, "456"sv, ""sv, "7"sv, "89"sv }; - + auto seq = single_pass_only(std::move(arr)).flatten_with('-'); using S = decltype(seq);