Skip to content

Commit b8b54a2

Browse files
committed
Updated gtest install methond on macos.
1 parent f2c1991 commit b8b54a2

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

.github/workflows/gha.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
pattern: [0, 1, 2, 3]
1919
steps:
2020
- uses: actions/checkout@v1
21+
- name: install gtest
22+
run: |
23+
brew install --force googletest
2124
- name: build and test
2225
env:
2326
CC: clang
@@ -48,22 +51,8 @@ jobs:
4851
export CHAR_SIGN="unsigned"
4952
fi
5053
51-
# install gtest
52-
wget https://github.com/google/googletest/archive/release-1.7.0.zip -O googletest-release-1.7.0.zip
53-
unzip -q googletest-release-1.7.0.zip
54-
cd googletest-release-1.7.0
55-
$CXX -m${ARCH} src/gtest-all.cc -I. -Iinclude -c
56-
$CXX -m${ARCH} src/gtest_main.cc -I. -Iinclude -c
57-
ar -rv libgtest.a gtest-all.o
58-
ar -rv libgtest_main.a gtest_main.o
59-
mkdir -p ${BASE}/usr/include
60-
cp -r include/gtest ${BASE}/usr/include
61-
mkdir -p ${BASE}/usr/lib
62-
mv *.a ${BASE}/usr/lib
63-
cd ..
64-
6554
# build and test
66-
CMAKE_CXX_COMPILER="${CXX}" CMAKE_C_COMPILER="${CC}" GTEST_ROOT="${BASE}/usr" CFLAGS="-Werror -g -fsanitize=undefined -fno-sanitize-recover=all" CXXFLAGS="-Werror -g -ggdb3 -fsanitize=undefined -fno-sanitize-recover=all" ${ACTION}
55+
CMAKE_CXX_COMPILER="${CXX}" CMAKE_C_COMPILER="${CC}" CFLAGS="-Werror -g -fsanitize=undefined -fno-sanitize-recover=all" CXXFLAGS="-Werror -g -ggdb3 -fsanitize=undefined -fno-sanitize-recover=all" ${ACTION}
6756
6857
linux:
6958
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)