Skip to content

Commit

Permalink
Add ASan, UBSan to CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
windytan committed Jul 17, 2024
1 parent a45c659 commit 10f97ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install dependencies (apt)
run: sudo apt install python3-pip ninja-build libliquid-dev meson build-essential
run: sudo apt install ninja-build libliquid-dev meson
- name: compile (meson)
run: meson setup -Dwerror=true build && cd build && meson compile
- name: compile (makefile)
Expand All @@ -28,18 +28,18 @@ jobs:
- name: Install dependencies (apt-get)
run: apt-get update && apt-get -y install build-essential libliquid-dev
- name: compile (makefile)
run: make
run: make EXTRA_CFLAGS="-Werror"

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install dependencies (apt)
run: sudo apt install perl sox libliquid-dev build-essential
run: sudo apt install perl sox libliquid-dev
- name: Download test data (git-lfs)
run: git lfs pull
- name: compile (makefile)
run: make
run: make EXTRA_CFLAGS="-fsanitize=address,undefined"
- name: run tests
run: perl test/test.pl
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
CC=g++
CFLAGS=-std=gnu++11 -Wall -Wextra -Wstrict-overflow -Wshadow -Wdouble-promotion -Wundef -Wpointer-arith -Wcast-align -Wcast-qual -Wuninitialized -pedantic -Wno-return-type-c-linkage -O3

ifdef EXTRA_CFLAGS
CFLAGS += ${EXTRA_CFLAGS}
endif

demux: src/demux.cc src/demux.h src/liquid_wrappers.cc src/liquid_wrappers.h src/options.cc src/options.h
g++ -std=gnu++11 -Wall -Wextra -Wstrict-overflow -Wshadow -Wdouble-promotion -Wundef -Wpointer-arith -Wcast-align -Wcast-qual -Wuninitialized -pedantic -Wno-return-type-c-linkage -O3 -o demux src/demux.cc src/liquid_wrappers.cc src/options.cc -lliquid
$(CC) $(CFLAGS) -o $@ src/demux.cc src/liquid_wrappers.cc src/options.cc -lliquid

clean:
rm -f demux

0 comments on commit 10f97ea

Please sign in to comment.