diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 0802de7a1..e9ea6ca74 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -31,42 +31,20 @@ jobs: - name: Setup Dependencies run: | sudo apt-get update - DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \ - build-essential \ + DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-suggests --no-install-recommends \ + g++ \ cmake \ gcovr \ libgflags-dev \ + libgmock-dev \ + libgtest-dev \ libunwind-dev \ ninja-build - - name: Cache GTest - id: cache-gtest - uses: actions/cache@v4 - with: - path: gtest/ - key: ${{runner.os}}-gtest-1.11 - - - name: Download GTest - if: steps.cache-gtest.outputs.cache-hit != 'true' - run: | - wget https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz - tar xvf release-1.11.0.tar.gz - - - name: Build GTest - if: steps.cache-gtest.outputs.cache-hit != 'true' - run: | - cmake -S googletest-release-1.11.0 -B build-googletest \ - -DBUILD_SHARED_LIBS=${{matrix.shared}} \ - -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ - -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/gtest \ - -G Ninja - cmake --build build-googletest --target install - - name: Setup Environment if: matrix.build_type == 'Debug' run: | echo 'CXXFLAGS=--coverage' >> $GITHUB_ENV - echo 'GTest_ROOT=${{github.workspace}}/gtest' >> $GITHUB_ENV - name: Configure env: diff --git a/CMakeLists.txt b/CMakeLists.txt index 847530698..04ff2aefb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,7 @@ set (CMAKE_VISIBILITY_INLINES_HIDDEN ON) set (CMAKE_DEBUG_POSTFIX d) -find_package (GTest NO_MODULE) +find_package (GTest 1.11 COMPONENTS GTest OPTIONAL_COMPONENTS GMock NO_MODULE) if (GTest_FOUND) set (HAVE_LIB_GTEST 1)