From afa6ea639294ecd01234aa5e7d860d2f8ed74bae Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Mon, 21 Oct 2024 22:00:19 +0800 Subject: [PATCH 01/17] tests: link to GTest::gtest_main instead of compiling from source every time Signed-off-by: Shengqi Chen --- CMakeLists.txt | 7 ++----- tests/bson/CMakeLists.txt | 2 -- tests/cbor/CMakeLists.txt | 2 -- tests/flexbuffers/CMakeLists.txt | 2 -- tests/generic/CMakeLists.txt | 2 -- tests/json/CMakeLists.txt | 4 +--- tests/json_c_arrays_and_inheritance/CMakeLists.txt | 2 -- tests/msgpack/CMakeLists.txt | 2 -- tests/toml/CMakeLists.txt | 2 -- tests/xml/CMakeLists.txt | 2 -- tests/yaml/CMakeLists.txt | 2 -- 11 files changed, 3 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index df697146..6e36ddbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,11 +168,8 @@ target_sources(reflectcpp PRIVATE ${REFLECT_CPP_SOURCES}) target_precompile_headers(reflectcpp PRIVATE [["rfl.hpp"]] ) if (REFLECTCPP_BUILD_TESTS) - if (MSVC) - set(REFLECT_CPP_GTEST_LIB "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/gtest${CMAKE_STATIC_LIBRARY_SUFFIX}") - else () - set(REFLECT_CPP_GTEST_LIB "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libgtest${CMAKE_STATIC_LIBRARY_SUFFIX}") - endif () + find_package(GTest CONFIG REQUIRED) + set(REFLECT_CPP_GTEST_LIB reflectcpp GTest::gtest_main) add_subdirectory(tests) endif () diff --git a/tests/bson/CMakeLists.txt b/tests/bson/CMakeLists.txt index be52ec9b..65861f71 100644 --- a/tests/bson/CMakeLists.txt +++ b/tests/bson/CMakeLists.txt @@ -5,7 +5,6 @@ file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "*.cpp") add_executable( reflect-cpp-bson-tests ${SOURCES} - "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/src/gtest_main.cc" ) target_precompile_headers(reflect-cpp-bson-tests PRIVATE [["rfl.hpp"]] ) @@ -14,6 +13,5 @@ target_include_directories(reflect-cpp-bson-tests SYSTEM PRIVATE "${VCPKG_INSTAL target_link_libraries( reflect-cpp-bson-tests PRIVATE - reflectcpp "${REFLECT_CPP_GTEST_LIB}" ) diff --git a/tests/cbor/CMakeLists.txt b/tests/cbor/CMakeLists.txt index d66a309f..ad1eba6a 100644 --- a/tests/cbor/CMakeLists.txt +++ b/tests/cbor/CMakeLists.txt @@ -5,7 +5,6 @@ file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "*.cpp") add_executable( reflect-cpp-cbor-tests ${SOURCES} - "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/src/gtest_main.cc" ) target_precompile_headers(reflect-cpp-cbor-tests PRIVATE [["rfl.hpp"]] ) @@ -15,6 +14,5 @@ target_include_directories(reflect-cpp-cbor-tests SYSTEM PRIVATE "${VCPKG_INSTAL target_link_libraries( reflect-cpp-cbor-tests PRIVATE - reflectcpp "${REFLECT_CPP_GTEST_LIB}" ) diff --git a/tests/flexbuffers/CMakeLists.txt b/tests/flexbuffers/CMakeLists.txt index 24fd903d..5a05f4f4 100644 --- a/tests/flexbuffers/CMakeLists.txt +++ b/tests/flexbuffers/CMakeLists.txt @@ -5,7 +5,6 @@ file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "*.cpp") add_executable( reflect-cpp-flexbuffers-tests ${SOURCES} - "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/src/gtest_main.cc" ) target_precompile_headers(reflect-cpp-flexbuffers-tests PRIVATE [["rfl.hpp"]] ) @@ -14,6 +13,5 @@ target_include_directories(reflect-cpp-flexbuffers-tests SYSTEM PRIVATE "${VCPKG target_link_libraries( reflect-cpp-flexbuffers-tests PRIVATE - reflectcpp "${REFLECT_CPP_GTEST_LIB}" ) diff --git a/tests/generic/CMakeLists.txt b/tests/generic/CMakeLists.txt index 7c7ac4b4..4e445d9d 100644 --- a/tests/generic/CMakeLists.txt +++ b/tests/generic/CMakeLists.txt @@ -5,7 +5,6 @@ file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "*.cpp") add_executable( reflect-cpp-generic-tests ${SOURCES} - "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/src/gtest_main.cc" ) target_include_directories(reflect-cpp-generic-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") @@ -13,6 +12,5 @@ target_include_directories(reflect-cpp-generic-tests SYSTEM PRIVATE "${VCPKG_INS target_link_libraries( reflect-cpp-generic-tests PRIVATE - reflectcpp "${REFLECT_CPP_GTEST_LIB}" ) diff --git a/tests/json/CMakeLists.txt b/tests/json/CMakeLists.txt index 12dd65c8..aa0d3226 100644 --- a/tests/json/CMakeLists.txt +++ b/tests/json/CMakeLists.txt @@ -5,7 +5,6 @@ file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "*.cpp") add_executable( reflect-cpp-json-tests ${SOURCES} - "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/src/gtest_main.cc" ) target_precompile_headers(reflect-cpp-json-tests PRIVATE [["rfl.hpp"]] ) @@ -13,7 +12,6 @@ target_include_directories(reflect-cpp-json-tests SYSTEM PRIVATE "${VCPKG_INSTAL target_link_libraries( reflect-cpp-json-tests - PRIVATE - reflectcpp + PRIVATE "${REFLECT_CPP_GTEST_LIB}" ) diff --git a/tests/json_c_arrays_and_inheritance/CMakeLists.txt b/tests/json_c_arrays_and_inheritance/CMakeLists.txt index a0ed7d98..d6e37920 100644 --- a/tests/json_c_arrays_and_inheritance/CMakeLists.txt +++ b/tests/json_c_arrays_and_inheritance/CMakeLists.txt @@ -5,7 +5,6 @@ file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "*.cpp") add_executable( reflect-cpp-json-c-arrays-and-inheritance-tests ${SOURCES} - "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/src/gtest_main.cc" ) target_precompile_headers(reflect-cpp-json-c-arrays-and-inheritance-tests PRIVATE [["rfl.hpp"]] ) @@ -17,6 +16,5 @@ target_include_directories(reflect-cpp-json-c-arrays-and-inheritance-tests SYSTE target_link_libraries( reflect-cpp-json-c-arrays-and-inheritance-tests PRIVATE - reflectcpp "${REFLECT_CPP_GTEST_LIB}" ) diff --git a/tests/msgpack/CMakeLists.txt b/tests/msgpack/CMakeLists.txt index fcc47ad3..32a94a5d 100644 --- a/tests/msgpack/CMakeLists.txt +++ b/tests/msgpack/CMakeLists.txt @@ -5,7 +5,6 @@ file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "*.cpp") add_executable( reflect-cpp-msgpack-tests ${SOURCES} - "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/src/gtest_main.cc" ) target_precompile_headers(reflect-cpp-msgpack-tests PRIVATE [["rfl.hpp"]] ) @@ -14,6 +13,5 @@ target_include_directories(reflect-cpp-msgpack-tests SYSTEM PRIVATE "${VCPKG_INS target_link_libraries( reflect-cpp-msgpack-tests PRIVATE - reflectcpp "${REFLECT_CPP_GTEST_LIB}" ) diff --git a/tests/toml/CMakeLists.txt b/tests/toml/CMakeLists.txt index c7e5816b..bdbb2c35 100644 --- a/tests/toml/CMakeLists.txt +++ b/tests/toml/CMakeLists.txt @@ -5,7 +5,6 @@ file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "*.cpp") add_executable( reflect-cpp-toml-tests ${SOURCES} - "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/src/gtest_main.cc" ) target_precompile_headers(reflect-cpp-toml-tests PRIVATE [["rfl.hpp"]] ) @@ -14,6 +13,5 @@ target_include_directories(reflect-cpp-toml-tests SYSTEM PRIVATE "${VCPKG_INSTAL target_link_libraries( reflect-cpp-toml-tests PRIVATE - reflectcpp "${REFLECT_CPP_GTEST_LIB}" ) diff --git a/tests/xml/CMakeLists.txt b/tests/xml/CMakeLists.txt index 745ceebd..a609da5b 100644 --- a/tests/xml/CMakeLists.txt +++ b/tests/xml/CMakeLists.txt @@ -5,7 +5,6 @@ file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "*.cpp") add_executable( reflect-cpp-xml-tests ${SOURCES} - "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/src/gtest_main.cc" ) target_precompile_headers(reflect-cpp-xml-tests PRIVATE [["rfl.hpp"]] ) @@ -14,6 +13,5 @@ target_include_directories(reflect-cpp-xml-tests SYSTEM PRIVATE "${VCPKG_INSTALL target_link_libraries( reflect-cpp-xml-tests PRIVATE - reflectcpp "${REFLECT_CPP_GTEST_LIB}" ) diff --git a/tests/yaml/CMakeLists.txt b/tests/yaml/CMakeLists.txt index f25673f0..7b1ccc15 100644 --- a/tests/yaml/CMakeLists.txt +++ b/tests/yaml/CMakeLists.txt @@ -5,7 +5,6 @@ file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "*.cpp") add_executable( reflect-cpp-yaml-tests ${SOURCES} - "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/src/gtest_main.cc" ) target_precompile_headers(reflect-cpp-yaml-tests PRIVATE [["rfl.hpp"]] ) @@ -14,6 +13,5 @@ target_include_directories(reflect-cpp-yaml-tests SYSTEM PRIVATE "${VCPKG_INSTAL target_link_libraries( reflect-cpp-yaml-tests PRIVATE - reflectcpp "${REFLECT_CPP_GTEST_LIB}" ) From 04e9e3f974cbdbb7bd4053eb6f7f980dbd19dfde Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Mon, 21 Oct 2024 22:02:47 +0800 Subject: [PATCH 02/17] tests: register all test binaries to ctest framework Signed-off-by: Shengqi Chen --- CMakeLists.txt | 1 + tests/bson/CMakeLists.txt | 3 +++ tests/cbor/CMakeLists.txt | 3 +++ tests/flexbuffers/CMakeLists.txt | 3 +++ tests/generic/CMakeLists.txt | 3 +++ tests/json/CMakeLists.txt | 3 +++ tests/json_c_arrays_and_inheritance/CMakeLists.txt | 3 +++ tests/msgpack/CMakeLists.txt | 3 +++ tests/toml/CMakeLists.txt | 3 +++ tests/xml/CMakeLists.txt | 3 +++ tests/yaml/CMakeLists.txt | 3 +++ 11 files changed, 31 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e36ddbe..f20811d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,6 +168,7 @@ target_sources(reflectcpp PRIVATE ${REFLECT_CPP_SOURCES}) target_precompile_headers(reflectcpp PRIVATE [["rfl.hpp"]] ) if (REFLECTCPP_BUILD_TESTS) + enable_testing() find_package(GTest CONFIG REQUIRED) set(REFLECT_CPP_GTEST_LIB reflectcpp GTest::gtest_main) add_subdirectory(tests) diff --git a/tests/bson/CMakeLists.txt b/tests/bson/CMakeLists.txt index 65861f71..6129f76d 100644 --- a/tests/bson/CMakeLists.txt +++ b/tests/bson/CMakeLists.txt @@ -15,3 +15,6 @@ target_link_libraries( PRIVATE "${REFLECT_CPP_GTEST_LIB}" ) + +find_package(GTest) +gtest_discover_tests(reflect-cpp-bson-tests) diff --git a/tests/cbor/CMakeLists.txt b/tests/cbor/CMakeLists.txt index ad1eba6a..1268d405 100644 --- a/tests/cbor/CMakeLists.txt +++ b/tests/cbor/CMakeLists.txt @@ -16,3 +16,6 @@ target_link_libraries( PRIVATE "${REFLECT_CPP_GTEST_LIB}" ) + +find_package(GTest) +gtest_discover_tests(reflect-cpp-cbor-tests) diff --git a/tests/flexbuffers/CMakeLists.txt b/tests/flexbuffers/CMakeLists.txt index 5a05f4f4..6e5cc200 100644 --- a/tests/flexbuffers/CMakeLists.txt +++ b/tests/flexbuffers/CMakeLists.txt @@ -15,3 +15,6 @@ target_link_libraries( PRIVATE "${REFLECT_CPP_GTEST_LIB}" ) + +find_package(GTest) +gtest_discover_tests(reflect-cpp-flexbuffers-tests) diff --git a/tests/generic/CMakeLists.txt b/tests/generic/CMakeLists.txt index 4e445d9d..0e3b03a7 100644 --- a/tests/generic/CMakeLists.txt +++ b/tests/generic/CMakeLists.txt @@ -14,3 +14,6 @@ target_link_libraries( PRIVATE "${REFLECT_CPP_GTEST_LIB}" ) + +find_package(GTest) +gtest_discover_tests(reflect-cpp-generic-tests) diff --git a/tests/json/CMakeLists.txt b/tests/json/CMakeLists.txt index aa0d3226..ac468c3c 100644 --- a/tests/json/CMakeLists.txt +++ b/tests/json/CMakeLists.txt @@ -15,3 +15,6 @@ target_link_libraries( PRIVATE "${REFLECT_CPP_GTEST_LIB}" ) + +find_package(GTest) +gtest_discover_tests(reflect-cpp-json-tests) diff --git a/tests/json_c_arrays_and_inheritance/CMakeLists.txt b/tests/json_c_arrays_and_inheritance/CMakeLists.txt index d6e37920..cb411bcd 100644 --- a/tests/json_c_arrays_and_inheritance/CMakeLists.txt +++ b/tests/json_c_arrays_and_inheritance/CMakeLists.txt @@ -18,3 +18,6 @@ target_link_libraries( PRIVATE "${REFLECT_CPP_GTEST_LIB}" ) + +find_package(GTest) +gtest_discover_tests(reflect-cpp-json-c-arrays-and-inheritance-tests) diff --git a/tests/msgpack/CMakeLists.txt b/tests/msgpack/CMakeLists.txt index 32a94a5d..26a77a07 100644 --- a/tests/msgpack/CMakeLists.txt +++ b/tests/msgpack/CMakeLists.txt @@ -15,3 +15,6 @@ target_link_libraries( PRIVATE "${REFLECT_CPP_GTEST_LIB}" ) + +find_package(GTest) +gtest_discover_tests(reflect-cpp-msgpack-tests) diff --git a/tests/toml/CMakeLists.txt b/tests/toml/CMakeLists.txt index bdbb2c35..1e138f47 100644 --- a/tests/toml/CMakeLists.txt +++ b/tests/toml/CMakeLists.txt @@ -15,3 +15,6 @@ target_link_libraries( PRIVATE "${REFLECT_CPP_GTEST_LIB}" ) + +find_package(GTest) +gtest_discover_tests(reflect-cpp-toml-tests) diff --git a/tests/xml/CMakeLists.txt b/tests/xml/CMakeLists.txt index a609da5b..8999f1e3 100644 --- a/tests/xml/CMakeLists.txt +++ b/tests/xml/CMakeLists.txt @@ -15,3 +15,6 @@ target_link_libraries( PRIVATE "${REFLECT_CPP_GTEST_LIB}" ) + +find_package(GTest) +gtest_discover_tests(reflect-cpp-xml-tests) diff --git a/tests/yaml/CMakeLists.txt b/tests/yaml/CMakeLists.txt index 7b1ccc15..a514a479 100644 --- a/tests/yaml/CMakeLists.txt +++ b/tests/yaml/CMakeLists.txt @@ -15,3 +15,6 @@ target_link_libraries( PRIVATE "${REFLECT_CPP_GTEST_LIB}" ) + +find_package(GTest) +gtest_discover_tests(reflect-cpp-yaml-tests) From d46b6f0175002c27836c5fc80c835fb548d35dd1 Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Mon, 21 Oct 2024 22:04:51 +0800 Subject: [PATCH 03/17] ci: invoke tests with ctest command Signed-off-by: Shengqi Chen --- .github/workflows/linux-clang-14.yaml | 11 +---------- .github/workflows/linux-clang-16.yaml | 11 +---------- .github/workflows/linux-gcc.yaml | 11 +---------- .github/workflows/macos-clang-arm.yaml | 11 +---------- .github/workflows/macos-clang-x64.yaml | 11 +---------- .github/workflows/windows-msvc.yaml | 11 +---------- 6 files changed, 6 insertions(+), 60 deletions(-) diff --git a/.github/workflows/linux-clang-14.yaml b/.github/workflows/linux-clang-14.yaml index 657719c3..622a598d 100644 --- a/.github/workflows/linux-clang-14.yaml +++ b/.github/workflows/linux-clang-14.yaml @@ -40,16 +40,7 @@ jobs: cmake --build build -j 4 - name: Run tests run: | - ./build/tests/bson/reflect-cpp-bson-tests - ./build/tests/cbor/reflect-cpp-cbor-tests - ./build/tests/flexbuffers/reflect-cpp-flexbuffers-tests - ./build/tests/generic/reflect-cpp-generic-tests - ./build/tests/json/reflect-cpp-json-tests - ./build/tests/json_c_arrays_and_inheritance/reflect-cpp-json-c-arrays-and-inheritance-tests - ./build/tests/msgpack/reflect-cpp-msgpack-tests - ./build/tests/toml/reflect-cpp-toml-tests - ./build/tests/xml/reflect-cpp-xml-tests - ./build/tests/yaml/reflect-cpp-yaml-tests + ctest - name: Run benchmarks run: | echo '# Benchmarks' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/linux-clang-16.yaml b/.github/workflows/linux-clang-16.yaml index e01ab758..4374873c 100644 --- a/.github/workflows/linux-clang-16.yaml +++ b/.github/workflows/linux-clang-16.yaml @@ -40,16 +40,7 @@ jobs: cmake --build build -j 4 - name: Run tests run: | - ./build/tests/bson/reflect-cpp-bson-tests - ./build/tests/cbor/reflect-cpp-cbor-tests - ./build/tests/flexbuffers/reflect-cpp-flexbuffers-tests - ./build/tests/generic/reflect-cpp-generic-tests - ./build/tests/json/reflect-cpp-json-tests - ./build/tests/json_c_arrays_and_inheritance/reflect-cpp-json-c-arrays-and-inheritance-tests - ./build/tests/msgpack/reflect-cpp-msgpack-tests - ./build/tests/toml/reflect-cpp-toml-tests - ./build/tests/xml/reflect-cpp-xml-tests - ./build/tests/yaml/reflect-cpp-yaml-tests + ctest --test-dir build --output-on-failure - name: Run benchmarks run: | echo '# Benchmarks' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/linux-gcc.yaml b/.github/workflows/linux-gcc.yaml index 49577e60..179798e1 100644 --- a/.github/workflows/linux-gcc.yaml +++ b/.github/workflows/linux-gcc.yaml @@ -33,16 +33,7 @@ jobs: cmake --build build -j 4 - name: Run tests run: | - ./build/tests/bson/reflect-cpp-bson-tests - ./build/tests/cbor/reflect-cpp-cbor-tests - ./build/tests/flexbuffers/reflect-cpp-flexbuffers-tests - ./build/tests/generic/reflect-cpp-generic-tests - ./build/tests/json/reflect-cpp-json-tests - ./build/tests/json_c_arrays_and_inheritance/reflect-cpp-json-c-arrays-and-inheritance-tests - ./build/tests/msgpack/reflect-cpp-msgpack-tests - ./build/tests/toml/reflect-cpp-toml-tests - ./build/tests/xml/reflect-cpp-xml-tests - ./build/tests/yaml/reflect-cpp-yaml-tests + ctest --test-dir build --output-on-failure - name: Run benchmarks run: | echo '# Benchmarks' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/macos-clang-arm.yaml b/.github/workflows/macos-clang-arm.yaml index 1be165ad..0e5010ab 100644 --- a/.github/workflows/macos-clang-arm.yaml +++ b/.github/workflows/macos-clang-arm.yaml @@ -35,16 +35,7 @@ jobs: cmake --build build -j 4 - name: Run tests run: | - ./build/tests/bson/reflect-cpp-bson-tests - ./build/tests/cbor/reflect-cpp-cbor-tests - ./build/tests/flexbuffers/reflect-cpp-flexbuffers-tests - ./build/tests/generic/reflect-cpp-generic-tests - ./build/tests/json/reflect-cpp-json-tests - ./build/tests/json_c_arrays_and_inheritance/reflect-cpp-json-c-arrays-and-inheritance-tests - ./build/tests/msgpack/reflect-cpp-msgpack-tests - ./build/tests/toml/reflect-cpp-toml-tests - ./build/tests/xml/reflect-cpp-xml-tests - ./build/tests/yaml/reflect-cpp-yaml-tests + ctest --test-dir build --output-on-failure - name: Run benchmarks run: | echo '# Benchmarks' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/macos-clang-x64.yaml b/.github/workflows/macos-clang-x64.yaml index bec49903..c6d6efa3 100644 --- a/.github/workflows/macos-clang-x64.yaml +++ b/.github/workflows/macos-clang-x64.yaml @@ -32,16 +32,7 @@ jobs: cmake --build build -j 4 - name: Run tests run: | - ./build/tests/bson/reflect-cpp-bson-tests - ./build/tests/cbor/reflect-cpp-cbor-tests - ./build/tests/flexbuffers/reflect-cpp-flexbuffers-tests - ./build/tests/generic/reflect-cpp-generic-tests - ./build/tests/json/reflect-cpp-json-tests - ./build/tests/json_c_arrays_and_inheritance/reflect-cpp-json-c-arrays-and-inheritance-tests - ./build/tests/msgpack/reflect-cpp-msgpack-tests - ./build/tests/toml/reflect-cpp-toml-tests - ./build/tests/xml/reflect-cpp-xml-tests - ./build/tests/yaml/reflect-cpp-yaml-tests + ctest --test-dir build --output-on-failure - name: Run benchmarks run: | echo '# Benchmarks' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/windows-msvc.yaml b/.github/workflows/windows-msvc.yaml index 697dd1b5..620760b9 100644 --- a/.github/workflows/windows-msvc.yaml +++ b/.github/workflows/windows-msvc.yaml @@ -28,16 +28,7 @@ jobs: cmake --build build --config Release -j4 - name: Run tests run: | - .\build\tests\json\Release\reflect-cpp-json-tests.exe - .\build\tests\json_c_arrays_and_inheritance\Release\reflect-cpp-json-c-arrays-and-inheritance-tests.exe - .\build\tests\bson\Release\reflect-cpp-bson-tests.exe - .\build\tests\cbor\Release\reflect-cpp-cbor-tests.exe - .\build\tests\flexbuffers\Release\reflect-cpp-flexbuffers-tests.exe - .\build\tests\generic\Release\reflect-cpp-generic-tests.exe - .\build\tests\msgpack\Release\reflect-cpp-msgpack-tests.exe - .\build\tests\toml\Release\reflect-cpp-toml-tests.exe - .\build\tests\xml\Release\reflect-cpp-xml-tests.exe - .\build\tests\yaml\Release\reflect-cpp-yaml-tests.exe + ctest --test-dir build --output-on-failure - name: Run benchmarks run: | echo '# Benchmarks' >> $env:GITHUB_STEP_SUMMARY From a8c1e648adf267dcd971dacb10208e42c12a9a17 Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Mon, 21 Oct 2024 22:08:56 +0800 Subject: [PATCH 04/17] ci: merge linux-clang configs with job matrix Signed-off-by: Shengqi Chen --- .github/workflows/linux-clang-14.yaml | 62 ------------------- .../{linux-clang-16.yaml => linux-clang.yaml} | 15 +++-- .gitignore | 1 + 3 files changed, 10 insertions(+), 68 deletions(-) delete mode 100644 .github/workflows/linux-clang-14.yaml rename .github/workflows/{linux-clang-16.yaml => linux-clang.yaml} (89%) diff --git a/.github/workflows/linux-clang-14.yaml b/.github/workflows/linux-clang-14.yaml deleted file mode 100644 index 622a598d..00000000 --- a/.github/workflows/linux-clang-14.yaml +++ /dev/null @@ -1,62 +0,0 @@ -name: linux-clang-14 - -on: [ pull_request ] - -env: - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - -jobs: - linux-clang-14: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 0 - - name: Export GitHub Actions cache environment variables - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Run vcpkg - uses: lukka/run-vcpkg@v11 - - uses: KyleMayes/install-llvm-action@v1 - with: - version: "14" - - name: link clang lib - run: | - sudo mkdir -p /usr/lib/llvm-14/lib - sudo ln -s clang /usr/lib/llvm-14/lib/clang - working-directory: ${{ env.LLVM_PATH }}/lib - - name: Compile - env: - CC: clang - CXX: clang++ - run: | - clang --version - cmake -S . -B build -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release - cmake --build build -j 4 - - name: Run tests - run: | - ctest - - name: Run benchmarks - run: | - echo '# Benchmarks' >> $GITHUB_STEP_SUMMARY - echo '## Benchmarks across different formats' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=canada_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=canada_write >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=licenses_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=licenses_write >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=person_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=person_write >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - echo '## Benchmarks for JSON' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=person_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=canada >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=licenses >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - diff --git a/.github/workflows/linux-clang-16.yaml b/.github/workflows/linux-clang.yaml similarity index 89% rename from .github/workflows/linux-clang-16.yaml rename to .github/workflows/linux-clang.yaml index 4374873c..e98aaefa 100644 --- a/.github/workflows/linux-clang-16.yaml +++ b/.github/workflows/linux-clang.yaml @@ -1,12 +1,15 @@ -name: linux-clang-16 +name: linux-clang -on: [ pull_request ] +on: [ pull_request, workflow_dispatch ] env: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" jobs: - linux-clang-16: + linux-clang: + strategy: + matrix: + llvm-version: [14, 16] runs-on: ubuntu-latest steps: - name: Checkout @@ -24,11 +27,11 @@ jobs: uses: lukka/run-vcpkg@v11 - uses: KyleMayes/install-llvm-action@v1 with: - version: "16" + version: ${{ matrix.llvm-version }} - name: link clang lib run: | - sudo mkdir -p /usr/lib/llvm-16/lib - sudo ln -s clang /usr/lib/llvm-16/lib/clang + sudo mkdir -p /usr/lib/llvm-${{ matrix.llvm-version }}/lib + sudo ln -s clang /usr/lib/llvm-${{ matrix.llvm-version }}/lib/clang working-directory: ${{ env.LLVM_PATH }}/lib - name: Compile env: diff --git a/.gitignore b/.gitignore index 0b9d6619..be3124d7 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ *.yaml !vcpkg.json +!.github/**/*.yml !.github/**/*.yaml !benchmarks/**/*.json From 3ce55c0b791a7a729b0237d8a19dee8821c9fa20 Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Mon, 21 Oct 2024 22:12:17 +0800 Subject: [PATCH 05/17] ci: merge macos-clang configs with job matrix Signed-off-by: Shengqi Chen --- .github/workflows/macos-clang-x64.yaml | 53 ------------------- ...{macos-clang-arm.yaml => macos-clang.yaml} | 15 ++++-- 2 files changed, 11 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/macos-clang-x64.yaml rename .github/workflows/{macos-clang-arm.yaml => macos-clang.yaml} (88%) diff --git a/.github/workflows/macos-clang-x64.yaml b/.github/workflows/macos-clang-x64.yaml deleted file mode 100644 index c6d6efa3..00000000 --- a/.github/workflows/macos-clang-x64.yaml +++ /dev/null @@ -1,53 +0,0 @@ -name: macos-clang-x64 - -on: [ pull_request ] - -env: - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - -jobs: - macos-clang-x64: - runs-on: macos-13 - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 0 - - name: Export GitHub Actions cache environment variables - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Run vcpkg - uses: lukka/run-vcpkg@v11 - - name: Compile - env: - CC: clang - CXX: clang++ - run: | - clang --version - cmake -S . -B build -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_MAKE_PROGRAM=make - cmake --build build -j 4 - - name: Run tests - run: | - ctest --test-dir build --output-on-failure - - name: Run benchmarks - run: | - echo '# Benchmarks' >> $GITHUB_STEP_SUMMARY - echo '## Benchmarks across different formats' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=canada_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=canada_write >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=licenses_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=licenses_write >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=person_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=person_write >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - echo '## Benchmarks for JSON' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=person_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=canada >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=licenses >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/macos-clang-arm.yaml b/.github/workflows/macos-clang.yaml similarity index 88% rename from .github/workflows/macos-clang-arm.yaml rename to .github/workflows/macos-clang.yaml index 0e5010ab..9b10006e 100644 --- a/.github/workflows/macos-clang-arm.yaml +++ b/.github/workflows/macos-clang.yaml @@ -6,8 +6,11 @@ env: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" jobs: - macos-clang-arm: - runs-on: macos-latest + macos-clang: + strategy: + matrix: + os: ["macos-latest", "macos-13"] + runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v3 @@ -23,13 +26,17 @@ jobs: - name: Run vcpkg uses: lukka/run-vcpkg@v11 - name: Install ninja - run: brew install ninja + run: brew install ninja + if: matrix.os == 'macos-latest' - name: Compile env: CC: clang CXX: clang++ - VCPKG_FORCE_SYSTEM_BINARIES: arm run: | + if [[ ${{ matrix.os == 'macos-latest' }} ]]; then + export VCPKG_FORCE_SYSTEM_BINARIES=arm + export CMAKE_GENERATOR=Ninja + fi clang --version cmake -S . -B build -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_MAKE_PROGRAM=make cmake --build build -j 4 From c2300c51cbf75b114c5737da4c72a2c654c831fc Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Mon, 21 Oct 2024 22:14:24 +0800 Subject: [PATCH 06/17] ci: bump versions of actions/checkout Signed-off-by: Shengqi Chen --- .github/workflows/code-checks.yaml | 2 +- .github/workflows/linux-clang.yaml | 2 +- .github/workflows/linux-gcc.yaml | 4 ++-- .github/workflows/macos-clang.yaml | 6 +++--- .github/workflows/windows-msvc.yaml | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/code-checks.yaml b/.github/workflows/code-checks.yaml index 7b7b28a8..5a9338bf 100644 --- a/.github/workflows/code-checks.yaml +++ b/.github/workflows/code-checks.yaml @@ -6,7 +6,7 @@ jobs: check-includes-are-relative: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - shell : bash run: | cd include diff --git a/.github/workflows/linux-clang.yaml b/.github/workflows/linux-clang.yaml index e98aaefa..68635f6c 100644 --- a/.github/workflows/linux-clang.yaml +++ b/.github/workflows/linux-clang.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 diff --git a/.github/workflows/linux-gcc.yaml b/.github/workflows/linux-gcc.yaml index 179798e1..8f1af175 100644 --- a/.github/workflows/linux-gcc.yaml +++ b/.github/workflows/linux-gcc.yaml @@ -1,6 +1,6 @@ name: linux-gcc -on: [ pull_request ] +on: [ pull_request, workflow_dispatch ] env: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 diff --git a/.github/workflows/macos-clang.yaml b/.github/workflows/macos-clang.yaml index 9b10006e..b506f62a 100644 --- a/.github/workflows/macos-clang.yaml +++ b/.github/workflows/macos-clang.yaml @@ -1,6 +1,6 @@ -name: macos-clang-arm +name: macos-clang -on: [ pull_request ] +on: [ pull_request, workflow_dispatch ] env: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" @@ -13,7 +13,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 diff --git a/.github/workflows/windows-msvc.yaml b/.github/workflows/windows-msvc.yaml index 620760b9..b005d898 100644 --- a/.github/workflows/windows-msvc.yaml +++ b/.github/workflows/windows-msvc.yaml @@ -1,6 +1,6 @@ name: windows-msvc -on: [ pull_request ] +on: [ pull_request, workflow_dispatch ] env: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" @@ -10,7 +10,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 From fbf3f9c6dacc9ef220ec34c1663c164ad53a175a Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Mon, 21 Oct 2024 22:28:27 +0800 Subject: [PATCH 07/17] ci: fix syntax in macos-clang Signed-off-by: Shengqi Chen --- .github/workflows/macos-clang.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos-clang.yaml b/.github/workflows/macos-clang.yaml index b506f62a..95e8df49 100644 --- a/.github/workflows/macos-clang.yaml +++ b/.github/workflows/macos-clang.yaml @@ -33,7 +33,7 @@ jobs: CC: clang CXX: clang++ run: | - if [[ ${{ matrix.os == 'macos-latest' }} ]]; then + if [[ "${{ matrix.os == 'macos-latest' }}" == "true" ]]; then export VCPKG_FORCE_SYSTEM_BINARIES=arm export CMAKE_GENERATOR=Ninja fi From 76322cf7f8826dc7ba1a45e1e707906ce8a10a87 Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Mon, 21 Oct 2024 22:28:43 +0800 Subject: [PATCH 08/17] ci: further merge linux-{clang,gcc} Signed-off-by: Shengqi Chen --- .github/workflows/linux-gcc.yaml | 56 ------------------- .../{linux-clang.yaml => linux.yaml} | 32 ++++++++--- 2 files changed, 23 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/linux-gcc.yaml rename .github/workflows/{linux-clang.yaml => linux.yaml} (71%) diff --git a/.github/workflows/linux-gcc.yaml b/.github/workflows/linux-gcc.yaml deleted file mode 100644 index 8f1af175..00000000 --- a/.github/workflows/linux-gcc.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: linux-gcc - -on: [ pull_request, workflow_dispatch ] - -env: - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - -jobs: - linux-gcc: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 - - name: Export GitHub Actions cache environment variables - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Run vcpkg - uses: lukka/run-vcpkg@v11 - - name: install dependencies - run: | - sudo apt update - sudo apt install -y g++ - - name: Compile - run: | - g++ --version - cmake -S . -B build -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release - cmake --build build -j 4 - - name: Run tests - run: | - ctest --test-dir build --output-on-failure - - name: Run benchmarks - run: | - echo '# Benchmarks' >> $GITHUB_STEP_SUMMARY - echo '## Benchmarks across different formats' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=canada_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=canada_write >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=licenses_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=licenses_write >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=person_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=person_write >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - echo '## Benchmarks for JSON' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=person_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=canada >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=licenses >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - - diff --git a/.github/workflows/linux-clang.yaml b/.github/workflows/linux.yaml similarity index 71% rename from .github/workflows/linux-clang.yaml rename to .github/workflows/linux.yaml index 68635f6c..75e6eade 100644 --- a/.github/workflows/linux-clang.yaml +++ b/.github/workflows/linux.yaml @@ -1,4 +1,4 @@ -name: linux-clang +name: linux on: [ pull_request, workflow_dispatch ] @@ -6,10 +6,14 @@ env: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" jobs: - linux-clang: + linux: strategy: matrix: - llvm-version: [14, 16] + compiler: [ llvm ] + compiler-version: [ 14, 16, 18 ] + include: + - compiler: gcc + compiler-version: current runs-on: ubuntu-latest steps: - name: Checkout @@ -27,20 +31,31 @@ jobs: uses: lukka/run-vcpkg@v11 - uses: KyleMayes/install-llvm-action@v1 with: - version: ${{ matrix.llvm-version }} + version: ${{ matrix.compiler-version }} + if: matrix.compiler == 'llvm' - name: link clang lib run: | - sudo mkdir -p /usr/lib/llvm-${{ matrix.llvm-version }}/lib - sudo ln -s clang /usr/lib/llvm-${{ matrix.llvm-version }}/lib/clang + sudo mkdir -p /usr/lib/llvm-${{ matrix.compiler-version }}/lib + sudo ln -s clang /usr/lib/llvm-${{ matrix.compiler-version }}/lib/clang working-directory: ${{ env.LLVM_PATH }}/lib + if: matrix.compiler == 'llvm' + - name: install gcc + run: | + sudo apt update + sudo apt install -y g++ + if: matrix.compiler == 'gcc' + - name: install ninja + run: | + sudo apt update + sudo apt install -y ninja-build - name: Compile env: CC: clang CXX: clang++ run: | clang --version - cmake -S . -B build -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release - cmake --build build -j 4 + cmake -S . -B build -G Ninja -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release + cmake --build build - name: Run tests run: | ctest --test-dir build --output-on-failure @@ -62,4 +77,3 @@ jobs: ./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=canada >> $GITHUB_STEP_SUMMARY ./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=licenses >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY - From bad2d07a3b83723909e34ad144f047df1145cc15 Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Mon, 21 Oct 2024 22:38:56 +0800 Subject: [PATCH 09/17] ci: bump version of KyleMayes/install-llvm-action Signed-off-by: Shengqi Chen --- .github/workflows/linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 75e6eade..1c664637 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -29,7 +29,7 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Run vcpkg uses: lukka/run-vcpkg@v11 - - uses: KyleMayes/install-llvm-action@v1 + - uses: KyleMayes/install-llvm-action@v2 with: version: ${{ matrix.compiler-version }} if: matrix.compiler == 'llvm' From c83eb163f5e33d6e560438d89ce2d79f4101c5c8 Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Mon, 21 Oct 2024 22:43:26 +0800 Subject: [PATCH 10/17] ci: fix ninja version detection problem in macos-clang.yaml Signed-off-by: Shengqi Chen --- .github/workflows/macos-clang.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos-clang.yaml b/.github/workflows/macos-clang.yaml index 95e8df49..af485e7e 100644 --- a/.github/workflows/macos-clang.yaml +++ b/.github/workflows/macos-clang.yaml @@ -38,7 +38,7 @@ jobs: export CMAKE_GENERATOR=Ninja fi clang --version - cmake -S . -B build -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_MAKE_PROGRAM=make + cmake -S . -B build -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ cmake --build build -j 4 - name: Run tests run: | From 577df62be6fe6a0a99f9c247b7c5d77f6191efc4 Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Mon, 21 Oct 2024 22:49:33 +0800 Subject: [PATCH 11/17] ci: disable fail-fast, run linux tests on ubuntu 24.04 Signed-off-by: Shengqi Chen --- .github/workflows/linux.yaml | 3 ++- .github/workflows/macos-clang.yaml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 1c664637..76568e1a 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -8,13 +8,14 @@ env: jobs: linux: strategy: + fail-fast: false matrix: compiler: [ llvm ] compiler-version: [ 14, 16, 18 ] include: - compiler: gcc compiler-version: current - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/macos-clang.yaml b/.github/workflows/macos-clang.yaml index af485e7e..e8f69cd4 100644 --- a/.github/workflows/macos-clang.yaml +++ b/.github/workflows/macos-clang.yaml @@ -8,6 +8,7 @@ env: jobs: macos-clang: strategy: + fail-fast: false matrix: os: ["macos-latest", "macos-13"] runs-on: ${{ matrix.os }} From 7bd494ef74d99829a0ddc88cc5bccaf3ea7cfe51 Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Mon, 21 Oct 2024 23:06:12 +0800 Subject: [PATCH 12/17] ci: use built-in toolchain from ubuntu-24.04 runner image THe newly-installed versions have some troublesome issues. Signed-off-by: Shengqi Chen --- .github/workflows/linux.yaml | 39 +++++++++++++++--------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 76568e1a..5827c64a 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -10,11 +10,15 @@ jobs: strategy: fail-fast: false matrix: - compiler: [ llvm ] - compiler-version: [ 14, 16, 18 ] include: + - compiler: llvm + compiler-version: 16 + - compiler: llvm + compiler-version: 18 - compiler: gcc - compiler-version: current + compiler-version: 12 + - compiler: gcc + compiler-version: 14 runs-on: ubuntu-24.04 steps: - name: Checkout @@ -30,31 +34,20 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Run vcpkg uses: lukka/run-vcpkg@v11 - - uses: KyleMayes/install-llvm-action@v2 - with: - version: ${{ matrix.compiler-version }} - if: matrix.compiler == 'llvm' - - name: link clang lib - run: | - sudo mkdir -p /usr/lib/llvm-${{ matrix.compiler-version }}/lib - sudo ln -s clang /usr/lib/llvm-${{ matrix.compiler-version }}/lib/clang - working-directory: ${{ env.LLVM_PATH }}/lib - if: matrix.compiler == 'llvm' - - name: install gcc - run: | - sudo apt update - sudo apt install -y g++ - if: matrix.compiler == 'gcc' - - name: install ninja + - name: Install dependencies run: | sudo apt update sudo apt install -y ninja-build - name: Compile - env: - CC: clang - CXX: clang++ run: | - clang --version + if [[ "${{ matrix.compiler }}" == "llvm" ]]; then + export CC=clang-${{ matrix.compiler-version }} + export CXX=clang++-${{ matrix.compiler-version }} + elif [[ "${{ matrix.compiler }}" == "gcc" ]]; then + export CC=gcc-${{ matrix.compiler-version }} + export CXX=g++-${{ matrix.compiler-version }} + fi + $CXX --version cmake -S . -B build -G Ninja -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release cmake --build build - name: Run tests From 87a58c316861a48ed5630fc4a295ec70b5d3e222 Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Wed, 30 Oct 2024 12:32:01 +0800 Subject: [PATCH 13/17] ci: disable gh-pages actions in forks to avoid annoying errors Signed-off-by: Shengqi Chen --- .github/workflows/jekyll-gh-pages.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml index e31d81c5..d2eaa1ea 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/.github/workflows/jekyll-gh-pages.yml @@ -24,6 +24,7 @@ concurrency: jobs: # Build job build: + if: github.repository == 'getml/reflect-cpp' runs-on: ubuntu-latest steps: - name: Checkout @@ -40,6 +41,7 @@ jobs: # Deployment job deploy: + if: github.repository == 'getml/reflect-cpp' environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} From 6f8df396111c21f72e35e72f10567c68ac6154a9 Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Wed, 30 Oct 2024 13:15:46 +0800 Subject: [PATCH 14/17] ci: add GCC 11 in Linux test Signed-off-by: Shengqi Chen --- .github/workflows/linux.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 5827c64a..2275f5bd 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -15,6 +15,9 @@ jobs: compiler-version: 16 - compiler: llvm compiler-version: 18 + - compiler: gcc + compiler-version: 11 + additional-dep: "g++-11" - compiler: gcc compiler-version: 12 - compiler: gcc @@ -37,8 +40,8 @@ jobs: - name: Install dependencies run: | sudo apt update - sudo apt install -y ninja-build - - name: Compile + sudo apt install -y ninja-build ${{ matrix.additional-dep }} + - name: Compile run: | if [[ "${{ matrix.compiler }}" == "llvm" ]]; then export CC=clang-${{ matrix.compiler-version }} From 5bde67935286f8265572dbe58de116460270e246 Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Wed, 30 Oct 2024 13:25:27 +0800 Subject: [PATCH 15/17] ci: use customized job name in linux.yaml Signed-off-by: Shengqi Chen --- .github/workflows/linux.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 2275f5bd..fbe4ea27 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -22,6 +22,7 @@ jobs: compiler-version: 12 - compiler: gcc compiler-version: 14 + name: "linux (${{matrix.compiler}}-${{matrix.compiler-version}})" runs-on: ubuntu-24.04 steps: - name: Checkout From 7541f8a9b679e8b17e6e1affb97feec000019cee Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Wed, 30 Oct 2024 13:44:12 +0800 Subject: [PATCH 16/17] ci: use ccache to speedup build Signed-off-by: Shengqi Chen --- .github/workflows/linux.yaml | 9 +++++++-- .github/workflows/macos-clang.yaml | 9 +++++++-- .github/workflows/windows-msvc.yaml | 10 ++++++++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index fbe4ea27..e28d240b 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -22,7 +22,7 @@ jobs: compiler-version: 12 - compiler: gcc compiler-version: 14 - name: "linux (${{matrix.compiler}}-${{matrix.compiler-version}})" + name: "${{ github.job }} (${{ matrix.compiler }}-${{ matrix.compiler-version }})" runs-on: ubuntu-24.04 steps: - name: Checkout @@ -36,6 +36,11 @@ jobs: script: | core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Enable ccache + uses: hendrikmuhs/ccache-action@v1 + with: + key: "${{ github.job }}-${{ matrix.compiler }}-${{ matrix.compiler-version }}" + max-size: "2G" - name: Run vcpkg uses: lukka/run-vcpkg@v11 - name: Install dependencies @@ -52,7 +57,7 @@ jobs: export CXX=g++-${{ matrix.compiler-version }} fi $CXX --version - cmake -S . -B build -G Ninja -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release cmake --build build - name: Run tests run: | diff --git a/.github/workflows/macos-clang.yaml b/.github/workflows/macos-clang.yaml index e8f69cd4..b23c1294 100644 --- a/.github/workflows/macos-clang.yaml +++ b/.github/workflows/macos-clang.yaml @@ -24,12 +24,17 @@ jobs: script: | core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Enable ccache + uses: hendrikmuhs/ccache-action@v1 + with: + key: "${{ github.job }}-${{ matrix.os }}" + max-size: "2G" - name: Run vcpkg uses: lukka/run-vcpkg@v11 - name: Install ninja run: brew install ninja if: matrix.os == 'macos-latest' - - name: Compile + - name: Compile env: CC: clang CXX: clang++ @@ -39,7 +44,7 @@ jobs: export CMAKE_GENERATOR=Ninja fi clang --version - cmake -S . -B build -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ + cmake -S . -B build -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ cmake --build build -j 4 - name: Run tests run: | diff --git a/.github/workflows/windows-msvc.yaml b/.github/workflows/windows-msvc.yaml index b005d898..99f20d61 100644 --- a/.github/workflows/windows-msvc.yaml +++ b/.github/workflows/windows-msvc.yaml @@ -20,11 +20,17 @@ jobs: script: | core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Enable ccache + uses: hendrikmuhs/ccache-action@v1 + with: + key: "${{ github.job }}" + max-size: "2G" + variant: "sccache" - uses: ilammy/msvc-dev-cmd@v1 - uses: lukka/run-vcpkg@v11 - - name: Compile + - name: Compile run: | - cmake -S . -B build -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release cmake --build build --config Release -j4 - name: Run tests run: | From 61eaddeabb281657bf64337cf370332a712dd21c Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Wed, 30 Oct 2024 17:31:59 +0800 Subject: [PATCH 17/17] ci: disable ccache on windows, use symlinks to invoke ccache on linux and mac Signed-off-by: Shengqi Chen --- .github/workflows/linux.yaml | 8 +++++--- .github/workflows/macos-clang.yaml | 9 +++++---- .github/workflows/windows-msvc.yaml | 10 ++-------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index e28d240b..6ec6ccbc 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -36,7 +36,7 @@ jobs: script: | core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Enable ccache + - name: Setup ccache uses: hendrikmuhs/ccache-action@v1 with: key: "${{ github.job }}-${{ matrix.compiler }}-${{ matrix.compiler-version }}" @@ -56,10 +56,12 @@ jobs: export CC=gcc-${{ matrix.compiler-version }} export CXX=g++-${{ matrix.compiler-version }} fi + sudo ln -s $(which ccache) /usr/local/bin/$CC + sudo ln -s $(which ccache) /usr/local/bin/$CXX $CXX --version - cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -G Ninja -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release cmake --build build - - name: Run tests + - name: Run tests run: | ctest --test-dir build --output-on-failure - name: Run benchmarks diff --git a/.github/workflows/macos-clang.yaml b/.github/workflows/macos-clang.yaml index b23c1294..60b82af3 100644 --- a/.github/workflows/macos-clang.yaml +++ b/.github/workflows/macos-clang.yaml @@ -24,11 +24,12 @@ jobs: script: | core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Enable ccache + - name: Setup ccache uses: hendrikmuhs/ccache-action@v1 with: key: "${{ github.job }}-${{ matrix.os }}" max-size: "2G" + create-symlink: true - name: Run vcpkg uses: lukka/run-vcpkg@v11 - name: Install ninja @@ -43,10 +44,10 @@ jobs: export VCPKG_FORCE_SYSTEM_BINARIES=arm export CMAKE_GENERATOR=Ninja fi - clang --version - cmake -S . -B build -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ + $CXX --version + cmake -S . -B build -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ cmake --build build -j 4 - - name: Run tests + - name: Run tests run: | ctest --test-dir build --output-on-failure - name: Run benchmarks diff --git a/.github/workflows/windows-msvc.yaml b/.github/workflows/windows-msvc.yaml index 99f20d61..73cdb4e5 100644 --- a/.github/workflows/windows-msvc.yaml +++ b/.github/workflows/windows-msvc.yaml @@ -20,19 +20,13 @@ jobs: script: | core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Enable ccache - uses: hendrikmuhs/ccache-action@v1 - with: - key: "${{ github.job }}" - max-size: "2G" - variant: "sccache" - uses: ilammy/msvc-dev-cmd@v1 - uses: lukka/run-vcpkg@v11 - name: Compile run: | - cmake -S . -B build -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release cmake --build build --config Release -j4 - - name: Run tests + - name: Run tests run: | ctest --test-dir build --output-on-failure - name: Run benchmarks