Skip to content

Commit 4b8426a

Browse files
Copilot0xrinegade
andcommitted
Fix GTest installation in CI using libgtest-dev package and manual build
Co-authored-by: 0xrinegade <[email protected]>
1 parent 18dc77d commit 4b8426a

File tree

1 file changed

+26
-15
lines changed

1 file changed

+26
-15
lines changed

.github/workflows/cpp_sdk.yml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,24 @@ jobs:
6969
echo "Using Clang compiler"
7070
}
7171
72-
- name: Install Google Test
72+
- name: Install Google Test (Ubuntu)
73+
if: matrix.os == 'ubuntu-latest'
74+
run: |
75+
sudo apt-get install -y libgtest-dev
76+
cd /usr/src/gtest
77+
sudo cmake .
78+
sudo make
79+
sudo cp lib/*.a /usr/lib
80+
81+
- name: Install Google Test (macOS)
82+
if: matrix.os == 'macos-latest'
7383
run: |
7484
git clone https://github.com/google/googletest.git
7585
cd googletest
7686
mkdir build && cd build
7787
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
7888
cmake --build . --config ${{ matrix.build-type }}
7989
sudo cmake --install . --config ${{ matrix.build-type }}
80-
if: matrix.os != 'windows-latest'
8190
8291
- name: Install Google Test (Windows)
8392
if: matrix.os == 'windows-latest'
@@ -154,12 +163,11 @@ jobs:
154163
155164
- name: Install Google Test
156165
run: |
157-
git clone https://github.com/google/googletest.git
158-
cd googletest
159-
mkdir build && cd build
160-
cmake .. -DCMAKE_BUILD_TYPE=Debug
161-
cmake --build . --config Debug
162-
sudo cmake --install . --config Debug
166+
sudo apt-get install -y libgtest-dev
167+
cd /usr/src/gtest
168+
sudo cmake .
169+
sudo make
170+
sudo cp lib/*.a /usr/lib
163171
164172
- name: Configure with AddressSanitizer
165173
run: |
@@ -209,12 +217,11 @@ jobs:
209217
210218
- name: Install Google Test
211219
run: |
212-
git clone https://github.com/google/googletest.git
213-
cd googletest
214-
mkdir build && cd build
215-
cmake .. -DCMAKE_BUILD_TYPE=Release
216-
cmake --build . --config Release
217-
sudo cmake --install . --config Release
220+
sudo apt-get install -y libgtest-dev
221+
cd /usr/src/gtest
222+
sudo cmake .
223+
sudo make
224+
sudo cp lib/*.a /usr/lib
218225
219226
- name: Configure
220227
run: |
@@ -242,7 +249,11 @@ jobs:
242249

243250
- name: Install dependencies
244251
run: |
245-
sudo apt-get install -y doxygen graphviz
252+
sudo apt-get install -y doxygen graphviz libgtest-dev
253+
cd /usr/src/gtest
254+
sudo cmake .
255+
sudo make
256+
sudo cp lib/*.a /usr/lib
246257
247258
- name: Generate documentation
248259
run: |

0 commit comments

Comments
 (0)