Skip to content

Commit 7fc51af

Browse files
committed
ci: Use ubuntu-latest for CI on Linux
Ubuntu 18.04 is deprecated on GitHub Actions. Additionally: - Install 'clang' to get the latest clang toolchain. - Use -gdwarf-4 so Valgrind understands the debug information. - Install latest version of gtest (v1.13.0). - Show compile and link commands when building. - `cat` Valgrind output on error.
1 parent 8160ede commit 7fc51af

File tree

2 files changed

+12
-26
lines changed

2 files changed

+12
-26
lines changed

.github/workflows/gha.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
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}
6767
6868
linux:
69-
runs-on: ubuntu-18.04
69+
runs-on: ubuntu-latest
7070
strategy:
7171
fail-fast: false
7272
matrix:
@@ -76,7 +76,7 @@ jobs:
7676
- name: install build depends
7777
run: |
7878
sudo apt-get update
79-
sudo apt-get install g++-multilib clang-8 valgrind
79+
sudo apt-get install g++-multilib clang valgrind
8080
- name: build and test
8181
shell: bash
8282
run: |
@@ -161,17 +161,12 @@ jobs:
161161
fi
162162
163163
# install gtest
164-
wget https://github.com/google/googletest/archive/release-1.7.0.zip -O googletest-release-1.7.0.zip
165-
unzip -q googletest-release-1.7.0.zip
166-
cd googletest-release-1.7.0
167-
$CXX -m${ARCH} src/gtest-all.cc -I. -Iinclude -c -fPIC
168-
$CXX -m${ARCH} src/gtest_main.cc -I. -Iinclude -c -fPIC
169-
ar -rv libgtest.a gtest-all.o
170-
ar -rv libgtest_main.a gtest_main.o
171-
mkdir -p ${BASE}/usr/include
172-
cp -r include/gtest ${BASE}/usr/include
173-
mkdir -p ${BASE}/usr/lib
174-
mv *.a ${BASE}/usr/lib
164+
wget https://github.com/google/googletest/archive/v1.13.0.zip -O googletest-1.13.0.zip
165+
unzip -q googletest-1.13.0.zip
166+
cd googletest-1.13.0
167+
cmake -S . -DCMAKE_CXX_FLAGS="-m$ARCH" --install-prefix="$BASE/usr"
168+
cmake --build . --verbose
169+
cmake --install . --verbose
175170
cd ..
176171
177172
# install zlib
@@ -180,7 +175,7 @@ jobs:
180175
fi
181176
182177
# build and test
183-
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}
178+
CMAKE_CXX_COMPILER="${CXX}" CMAKE_C_COMPILER="${CC}" GTEST_ROOT="${BASE}/usr" CFLAGS="-Werror -g -gdwarf-4 -fsanitize=undefined -fno-sanitize-recover=all" CXXFLAGS="-Werror -g -ggdb3 -gdwarf-4 -fsanitize=undefined -fno-sanitize-recover=all" ${ACTION}
184179
185180
windows:
186181
runs-on: windows-2019

ci/build_cmake.sh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ then
3333
exit $ret
3434
fi
3535

36-
make
36+
make VERBOSE=1
3737

3838
ret=$?
3939
if [ $ret -ne 0 ]
@@ -60,17 +60,8 @@ fi
6060

6161
if [ "${ARCH}" != "32" ] && [ `uname` = "Linux" ]
6262
then
63-
ctest -T memcheck | tee memcheck.log
64-
65-
ret=${PIPESTATUS[0]}
66-
if [ $ret -ne 0 ]
67-
then
68-
exit $ret
69-
fi
70-
cat memcheck.log | grep "Memory Leak" > /dev/null
71-
ret=$?
72-
if [ $ret -eq 0 ]
73-
then
63+
if ! ctest -T memcheck; then
64+
find Testing/Temporary -name "MemoryChecker.*.log" -exec cat {} +
7465
exit 1
7566
fi
7667
fi

0 commit comments

Comments
 (0)