Skip to content

Commit d43442a

Browse files
committed
ci: an attempt to run the tests under ASan/UBsan on GHActions
Signed-off-by: Evgeny Vereshchagin <[email protected]>
1 parent 5319c49 commit d43442a

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/run_tests.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
python-ruby-version: {python: 3.9, ruby: 2.7, other: linker-bfd}
3030
- compiler: clang
3131
python-ruby-version: {python: 3.9, ruby: 2.7, other: linker-gold}
32+
include:
33+
- compiler: gcc
34+
python-ruby-version: {python: 3.9, ruby: 2.7, other: sanitizers}
3235

3336
steps:
3437
- uses: actions/checkout@v2
@@ -88,6 +91,9 @@ jobs:
8891
elif [ "${{ matrix.python-ruby-version.other }}" = "test-debug" ] ; then
8992
# Test hat debug build works fine
9093
EXPLICIT_MAKE_VARS="DEBUG=1"
94+
elif [ "${{ matrix.python-ruby-version.other }}" = "sanitizers" ] ; then
95+
sanitizers='-fsanitize=address,undefined'
96+
EXPLICIT_MAKE_VARS="CFLAGS='-g -I$DESTDIR/usr/include $sanitizers' LDFLAGS='-L$DESTDIR/usr/lib $sanitizers' LDLIBS= CPPFLAGS="
9197
else
9298
EXPLICIT_MAKE_VARS=
9399
fi
@@ -139,18 +145,18 @@ jobs:
139145
- name: Run tests
140146
run: |
141147
echo "::group::make install"
142-
make -j$(nproc) install $EXPLICIT_MAKE_VARS -k
148+
eval make -j$(nproc) install $EXPLICIT_MAKE_VARS -k
143149
echo "::endgroup::"
144150
echo "::group::make install-pywrap"
145-
make -j$(nproc) install-pywrap $EXPLICIT_MAKE_VARS -k
151+
eval make -j$(nproc) install-pywrap $EXPLICIT_MAKE_VARS -k
146152
echo "::endgroup::"
147153
echo "::group::make install-rubywrap"
148-
make -j$(nproc) install-rubywrap $EXPLICIT_MAKE_VARS -k
154+
eval make -j$(nproc) install-rubywrap $EXPLICIT_MAKE_VARS -k
149155
echo "::endgroup::"
150156
151157
# Now that everything is installed, run "make all" to build everything which may have not been built
152158
echo "::group::make all"
153-
make -j$(nproc) all $EXPLICIT_MAKE_VARS -k
159+
eval make -j$(nproc) all $EXPLICIT_MAKE_VARS -k
154160
echo "::endgroup::"
155161
156162
# Set up environment variables for the tests and show variables (to help debugging issues)
@@ -164,7 +170,7 @@ jobs:
164170
165171
# Run tests
166172
echo "::group::make test"
167-
make test $EXPLICIT_MAKE_VARS
173+
eval make test $EXPLICIT_MAKE_VARS
168174
echo "::endgroup::"
169175
170176
# Test Python and Ruby wrappers
@@ -184,6 +190,6 @@ jobs:
184190
# Test that "git status" looks clean, or print a clear error message
185191
git status --short | sed -n 's/^??/error: missing .gitignore entry for/p' | (! grep '^')
186192
# Clean up everything and show which file needs to be added to "make clean"
187-
make clean distclean $EXPLICIT_MAKE_VARS
193+
eval make clean distclean $EXPLICIT_MAKE_VARS
188194
git ls-files --ignored --others --exclude-standard | sed 's/^/error: "make clean distclean" did not remove /' | (! grep '^')
189195
echo "::endgroup::"

0 commit comments

Comments
 (0)