Add CI workflow to run tests with ASM disabled

This commit is contained in:
Joshua Sing 2023-04-29 01:15:13 +10:00
parent 4c2ab9981e
commit 4fdce0c684
No known key found for this signature in database
GPG Key ID: 3A3F16614180CDE6
2 changed files with 33 additions and 7 deletions

View File

@ -0,0 +1,24 @@
name: linux_ci_asan_noasm
on: [push, pull_request]
jobs:
build-native:
name: "${{ matrix.compiler }} - ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os: ["ubuntu-latest"]
compiler: ["clang"]
env:
CC: "${{ matrix.compiler }}"
ARCH: native
CFLAGS: "-ggdb -fsanitize=address"
LDFLAGS: "-fsanitize=address"
CTEST_OUTPUT_ON_FAILURE: 1
ENABLE_ASM: OFF
steps:
- name: "Checkout repository"
uses: actions/checkout@main
- name: "Run tests"
run: ./scripts/test

View File

@ -2,6 +2,7 @@
set -e set -e
unset CC unset CC
ENABLE_ASM="${ENABLE_ASM:=ON}"
if type apt-get >/dev/null if type apt-get >/dev/null
then then
@ -27,21 +28,21 @@ if [ "x$ARCH" = "xnative" ]; then
# test cmake and ninja # test cmake and ninja
if [ `uname` = "Darwin" ]; then if [ `uname` = "Darwin" ]; then
cmake .. cmake -DENABLE_ASM=${ENABLE_ASM} ..
make -j 4 make -j 4
make test make test
cd ../build-shared cd ../build-shared
cmake -DBUILD_SHARED_LIBS=ON .. cmake -DBUILD_SHARED_LIBS=ON -DENABLE_ASM=${ENABLE_ASM} ..
make -j 4 make -j 4
make test make test
else else
cmake -GNinja .. cmake -GNinja -DENABLE_ASM=${ENABLE_ASM} ..
ninja -j 4 ninja -j 4
ninja test ninja test
cd ../build-shared cd ../build-shared
cmake -GNinja -DBUILD_SHARED_LIBS=ON .. cmake -GNinja -DBUILD_SHARED_LIBS=ON -DENABLE_ASM=${ENABLE_ASM} ..
ninja -j 4 ninja -j 4
ninja test ninja test
fi fi
@ -61,14 +62,14 @@ elif [ "x$ARCH" = "xmingw32" -o "x$ARCH" = "xmingw64" ]; then
rm -fr build-static rm -fr build-static
mkdir build-static mkdir build-static
cd build-static cd build-static
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../scripts/$CPU-w64-mingw32.cmake .. cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../scripts/$CPU-w64-mingw32.cmake -DENABLE_ASM=${ENABLE_ASM} ..
ninja -j 4 ninja -j 4
) )
( (
rm -fr build-shared rm -fr build-shared
mkdir build-shared mkdir build-shared
cd build-shared cd build-shared
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../scripts/$CPU-w64-mingw32.cmake -DBUILD_SHARED_LIBS=ON .. cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../scripts/$CPU-w64-mingw32.cmake -DBUILD_SHARED_LIBS=ON -DENABLE_ASM=${ENABLE_ASM} ..
ninja -j 4 ninja -j 4
) )
@ -140,7 +141,8 @@ elif [ "x$ARCH" = "xandroid" ]; then
cmake -GNinja -DCMAKE_MAKE_PROGRAM=ninja \ cmake -GNinja -DCMAKE_MAKE_PROGRAM=ninja \
-DANDROID_NDK=$ANDROID_NDK_HOME \ -DANDROID_NDK=$ANDROID_NDK_HOME \
-DCMAKE_TOOLCHAIN_FILE=$TC_FILE \ -DCMAKE_TOOLCHAIN_FILE=$TC_FILE \
-DANDROID_ABI=$ABI -DANDROID_NATIVE_API_LEVEL=$NAL .. -DANDROID_ABI=$ABI -DANDROID_NATIVE_API_LEVEL=$NAL \
-DENABLE_ASM=${ENABLE_ASM} ..
ninja -j 4 ninja -j 4