From 1de666c1a7d75e7a2cfbe43ed4c9f14778652f08 Mon Sep 17 00:00:00 2001 From: imdeaddev Date: Tue, 9 Dec 2025 19:07:49 +0300 Subject: [PATCH 1/2] CI --- .github/workflows/ctest.yml | 101 ++++++++++++++++++++++++++++++++++++ .gitignore | 2 + CMakeLists.txt | 6 +-- 3 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ctest.yml diff --git a/.github/workflows/ctest.yml b/.github/workflows/ctest.yml new file mode 100644 index 0000000..a5ef316 --- /dev/null +++ b/.github/workflows/ctest.yml @@ -0,0 +1,101 @@ +name: Build and run tests using CMake + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + + # 1. + # 2. + # 3. + matrix: + os: [ubuntu-latest, windows-latest] + build_type: [Release] + c_compiler: [gcc, clang, cl] + include: + - os: windows-latest + c_compiler: cl + cpp_compiler: cl + - os: ubuntu-latest + c_compiler: gcc + cpp_compiler: g++ + - os: ubuntu-latest + c_compiler: clang + cpp_compiler: clang++ + exclude: + - os: windows-latest + c_compiler: gcc + - os: windows-latest + c_compiler: clang + - os: ubuntu-latest + c_compiler: cl + + steps: + - uses: actions/checkout@v4 + + - name: Set reusable strings + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - name: Configure CMake + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -DDEADDEV_BITMASK_GENERATE_DOCS=OFF + -DDEADDEV_BITMASK_BUILD_EXAMPLES=OFF + -DDEADDEV_BITMASK_BUILD_TESTS=ON + -S ${{ github.workspace }} + + - name: Build + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + + - name: Test + working-directory: ${{ steps.strings.outputs.build-output-dir }} + run: ctest --build-config ${{ matrix.build_type }} + + generate-docs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set reusable strings + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - name: Configure CMake + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -DDEADDEV_BITMASK_GENERATE_DOCS=ON + -DDEADDEV_BITMASK_BUILD_EXAMPLES=OFF + -DDEADDEV_BITMASK_BUILD_TESTS=OFF + -S ${{ github.workspace }} + + - name: Build + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --target deaddev_doc_doxygen --config ${{ matrix.build_type }} + + - name: Doxygenize + uses: langroodi/doxygenize@v1.7.1 + with: + doxygenconf: ${{ steps.strings.outputs.build-output-dir }}/Doxyfile + htmloutput: ./docs + ghpagesbranch: gh-pages + ghpagesdir: ./ + diff --git a/.gitignore b/.gitignore index 03fecc0..e17c872 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ * +!.github/ +!.github/** !example/ !example/** !include/ diff --git a/CMakeLists.txt b/CMakeLists.txt index d58a0cf..7c1d0d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,10 +31,10 @@ endif(DEADDEV_BITMASK_INSTALL) if(DEADDEV_BITMASK_GENERATE_DOCS) find_package(Doxygen) + set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in) + set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) if(Doxygen_FOUND) - set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in) - set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) - configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) add_custom_target(deaddev_doc_doxygen ALL COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} From 1fb5f3856d0c5404786e8a8774e0bfb8c9db14e4 Mon Sep 17 00:00:00 2001 From: imdeaddev Date: Tue, 9 Dec 2025 19:15:06 +0300 Subject: [PATCH 2/2] fixed bug #3 --- include/deaddev/bitmask.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/deaddev/bitmask.hpp b/include/deaddev/bitmask.hpp index abce9e2..9862479 100644 --- a/include/deaddev/bitmask.hpp +++ b/include/deaddev/bitmask.hpp @@ -91,7 +91,7 @@ template constexpr bool is_scoped_enum_v = __is_scoped_enum(T); template constexpr bool is_scoped_enum_v = ::std::is_enum::value && - !::std::is_convertible::type>::value; + !::std::is_convertible::type>::value; #endif /**