diff --git a/.github/workflows/bvt-clang.yml b/.github/workflows/bvt-clang.yml new file mode 100644 index 0000000..daa7827 --- /dev/null +++ b/.github/workflows/bvt-clang.yml @@ -0,0 +1,75 @@ +on: + workflow_call: + inputs: + branch: + type: string + required: false + +jobs: + bvt-clang: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ inputs.branch }} + + - name: install clang + run: | + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" -y + sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" -y + sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" -y + sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" -y + sudo apt update + sudo apt install -y clang-15 clang-16 clang-17 clang-18 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-15 1 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-15 1 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-16 1 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-16 1 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-17 1 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-17 1 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-18 1 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-18 1 + + - name: check compiler versions + run: | + clang++-15 --version + clang++-16 --version + clang++-17 --version + clang++-18 --version + + - name: build and run test with clang 15 + run: | + sudo update-alternatives --set gcc /usr/bin/clang-15 + sudo update-alternatives --set g++ /usr/bin/clang++-15 + cmake . -B build-clang-15 + cmake --build ./build-clang-15 -j8 + cd ./build-clang-15 + ctest -j8 + + - name: build and run test with clang 16 + run: | + sudo update-alternatives --set gcc /usr/bin/clang-16 + sudo update-alternatives --set g++ /usr/bin/clang++-16 + cmake . -B build-clang-16 + cmake --build ./build-clang-16 -j8 + cd ./build-clang-16 + ctest -j8 + + - name: build and run test with clang 17 + run: | + sudo update-alternatives --set gcc /usr/bin/clang-17 + sudo update-alternatives --set g++ /usr/bin/clang++-17 + cmake . -B build-clang-17 + cmake --build ./build-clang-17 -j8 + cd ./build-clang-17 + ctest -j8 + + - name: build and run test with clang 18 + run: | + sudo update-alternatives --set gcc /usr/bin/clang-18 + sudo update-alternatives --set g++ /usr/bin/clang++-18 + cmake . -B build-clang-18 + cmake --build ./build-clang-18 -j8 + cd ./build-clang-18 + ctest -j8 diff --git a/.github/workflows/bvt-clang15.yml b/.github/workflows/bvt-clang15.yml deleted file mode 100644 index bdf6a31..0000000 --- a/.github/workflows/bvt-clang15.yml +++ /dev/null @@ -1,36 +0,0 @@ -on: - workflow_call: - inputs: - branch: - type: string - required: false - -jobs: - bvt-clang15: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ inputs.branch }} - - - name: install clang 15 - run: | - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" -y - sudo apt update - sudo apt install -y clang-15 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-15 15 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-15 15 - - - name: check compiler version - run: g++ --version - - - name: build with cmake - run: | - cmake . -B build - cmake --build ./build -j8 - - - name: run tests - run: | - cd ./build - ctest -j8 diff --git a/.github/workflows/bvt-gcc.yml b/.github/workflows/bvt-gcc.yml new file mode 100644 index 0000000..ad9629d --- /dev/null +++ b/.github/workflows/bvt-gcc.yml @@ -0,0 +1,58 @@ +on: + workflow_call: + inputs: + branch: + type: string + required: false + +jobs: + bvt-gcc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ inputs.branch }} + + - name: install gcc + run: | + sudo apt update + sudo apt install -y gcc-11 g++-11 gcc-12 g++-12 gcc-13 g++-13 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 1 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 1 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 1 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 1 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 1 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 1 + + - name: check compiler versions + run: | + g++-11 --version + g++-12 --version + g++-13 --version + + - name: build and run test with gcc 11 + run: | + sudo update-alternatives --set gcc /usr/bin/gcc-11 + sudo update-alternatives --set g++ /usr/bin/g++-11 + cmake . -B build-gcc-11 + cmake --build ./build-gcc-11 -j8 + cd ./build-gcc-11 + ctest -j8 + + - name: build and run test with gcc 12 + run: | + sudo update-alternatives --set gcc /usr/bin/gcc-12 + sudo update-alternatives --set g++ /usr/bin/g++-12 + cmake . -B build-gcc-12 + cmake --build ./build-gcc-12 -j8 + cd ./build-gcc-12 + ctest -j8 + + - name: build and run test with gcc 13 + run: | + sudo update-alternatives --set gcc /usr/bin/gcc-13 + sudo update-alternatives --set g++ /usr/bin/g++-13 + cmake . -B build-gcc-13 + cmake --build ./build-gcc-13 -j8 + cd ./build-gcc-13 + ctest -j8 diff --git a/.github/workflows/bvt-gcc13.yml b/.github/workflows/bvt-gcc13.yml deleted file mode 100644 index 67ac44e..0000000 --- a/.github/workflows/bvt-gcc13.yml +++ /dev/null @@ -1,34 +0,0 @@ -on: - workflow_call: - inputs: - branch: - type: string - required: false - -jobs: - bvt-gcc13: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ inputs.branch }} - - - name: install gcc 13 - run: | - sudo apt update - sudo apt install -y gcc-13 g++-13 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13 - - - name: check compiler version - run: g++ --version - - - name: build with cmake - run: | - cmake . -B build - cmake --build ./build -j8 - - - name: run tests - run: | - cd ./build - ctest -j8 diff --git a/.github/workflows/bvt-msvc14.yml b/.github/workflows/bvt-msvc.yml similarity index 96% rename from .github/workflows/bvt-msvc14.yml rename to .github/workflows/bvt-msvc.yml index af09499..5236a6e 100644 --- a/.github/workflows/bvt-msvc14.yml +++ b/.github/workflows/bvt-msvc.yml @@ -6,7 +6,7 @@ on: required: false jobs: - bvt-msvc14: + bvt-msvc: runs-on: windows-2022 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/pipeline-ci.yml b/.github/workflows/pipeline-ci.yml index bec4e15..f6d2dc0 100644 --- a/.github/workflows/pipeline-ci.yml +++ b/.github/workflows/pipeline-ci.yml @@ -11,14 +11,14 @@ env: BUILD_TYPE: Release jobs: - run-bvt-gcc13: - uses: ./.github/workflows/bvt-gcc13.yml - name: run bvt with g++ 13 + run-bvt-gcc: + uses: ./.github/workflows/bvt-gcc.yml + name: run bvt with g++ - run-bvt-clang15: - uses: ./.github/workflows/bvt-clang15.yml - name: run bvt with clang 15 + run-bvt-clang: + uses: ./.github/workflows/bvt-clang.yml + name: run bvt with clang - run-bvt-msvc14: - uses: ./.github/workflows/bvt-msvc14.yml - name: run bvt with msvc14 (vs2022) + run-bvt-msvc: + uses: ./.github/workflows/bvt-msvc.yml + name: run bvt with msvc diff --git a/.github/workflows/pipeline-release.yml b/.github/workflows/pipeline-release.yml index f758a0e..0f44de6 100644 --- a/.github/workflows/pipeline-release.yml +++ b/.github/workflows/pipeline-release.yml @@ -37,30 +37,30 @@ jobs: git push origin release/${{ github.event.inputs.version }} git push origin ${{ github.event.inputs.version }} - run-bvt-gcc13: + run-bvt-gcc: needs: prepare-release - name: run bvt with g++ 13 - uses: ./.github/workflows/bvt-gcc13.yml + name: run bvt with g++ + uses: ./.github/workflows/bvt-gcc.yml with: branch: release/${{ github.event.inputs.version }} - run-bvt-clang15: + run-bvt-clang: needs: prepare-release - name: run bvt with clang 15 - uses: ./.github/workflows/bvt-clang15.yml + name: run bvt with clang + uses: ./.github/workflows/bvt-clang.yml with: branch: release/${{ github.event.inputs.version }} - run-bvt-msvc14: + run-bvt-msvc: needs: prepare-release - name: run bvt with msvc14 (vs2022) - uses: ./.github/workflows/bvt-msvc14.yml + name: run bvt with msvc + uses: ./.github/workflows/bvt-msvc.yml with: branch: release/${{ github.event.inputs.version }} draft-release: runs-on: windows-latest - needs: [run-bvt-gcc11, run-bvt-clang14, run-bvt-msvc14] + needs: [run-bvt-gcc, run-bvt-clang, run-bvt-msvc] steps: - uses: actions/checkout@v3 with: diff --git a/proxy.h b/proxy.h index 11e0aa1..bb03890 100644 --- a/proxy.h +++ b/proxy.h @@ -52,14 +52,16 @@ template consteval bool is_consteval(Expr) { return requires { typename std::bool_constant<(Expr{}(), false)>; }; } +template +concept has_tuple_element = requires { typename std::tuple_element_t; }; template consteval bool is_tuple_like_well_formed() { if constexpr (requires { { std::tuple_size::value } -> std::same_as; }) { if constexpr (is_consteval([] { return std::tuple_size::value; })) { return [](std::index_sequence) { - return (requires { typename std::tuple_element_t; } && ...); - }(std::make_index_sequence>{}); + return (has_tuple_element && ...); + }(std::make_index_sequence>{}); } } return false;