From ddec6b3a2a63ab52c9c68746d130cc6d80b20093 Mon Sep 17 00:00:00 2001 From: Juha Reunanen Date: Sat, 13 Apr 2024 14:33:25 +0300 Subject: [PATCH 1/2] Do not explicitly clone googletest in the Github Actions script --- .github/workflows/actions_cpp.yml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/.github/workflows/actions_cpp.yml b/.github/workflows/actions_cpp.yml index 9d438975..4e93a4a4 100644 --- a/.github/workflows/actions_cpp.yml +++ b/.github/workflows/actions_cpp.yml @@ -10,10 +10,6 @@ jobs: - uses: actions/setup-node@v2 with: node-version: '16' - - name: Get GoogleTest - run: | - cd CPP/Tests - git clone https://github.com/google/googletest - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@v1.0.2 - name: Build @@ -33,10 +29,6 @@ jobs: - uses: actions/setup-node@v2 with: node-version: '16' - - name: Get GoogleTest - run: | - cd CPP/Tests - git clone https://github.com/google/googletest - name: Build run: | mkdir CPP/build @@ -54,10 +46,6 @@ jobs: - uses: actions/setup-node@v2 with: node-version: '16' - - name: Get GoogleTest - run: | - cd CPP/Tests - git clone https://github.com/google/googletest - name: Install gcc 11 run: | sudo apt update @@ -80,10 +68,6 @@ jobs: - uses: actions/setup-node@v2 with: node-version: '16' - - name: Get GoogleTest - run: | - cd CPP/Tests - git clone https://github.com/google/googletest - name: Build run: | export CC=/usr/bin/clang @@ -103,10 +87,6 @@ jobs: - uses: actions/setup-node@v2 with: node-version: '16' - - name: Get GoogleTest - run: | - cd CPP/Tests - git clone https://github.com/google/googletest - name: Install clang 13 run: | wget https://apt.llvm.org/llvm.sh @@ -131,10 +111,6 @@ jobs: - uses: actions/setup-node@v2 with: node-version: '16' - - name: Get GoogleTest - run: | - cd CPP/Tests - git clone https://github.com/google/googletest - name: Build run: | mkdir CPP/build From 581caf6d7c817b74854caf0ec82dd98eed05cbf0 Mon Sep 17 00:00:00 2001 From: Juha Reunanen Date: Sat, 13 Apr 2024 14:36:54 +0300 Subject: [PATCH 2/2] Automatically clone googletest in the CMake script --- CPP/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CPP/CMakeLists.txt b/CPP/CMakeLists.txt index f64c5372..5c8deb51 100644 --- a/CPP/CMakeLists.txt +++ b/CPP/CMakeLists.txt @@ -210,7 +210,10 @@ if(USE_EXTERNAL_GTEST) find_package(GTest REQUIRED) else() include(GoogleTest) - + execute_process( + COMMAND "git" "clone" "https://github.com/google/googletest" + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/Tests + ) add_subdirectory("${PROJECT_SOURCE_DIR}/Tests/googletest/") set_target_properties(gtest gtest_main PROPERTIES FOLDER GTest) endif()