Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add asan+ubsan sanitized builder #28

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/build-sanitized.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build + Test (Sanitized)

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
merge_group:
branches: [ "main" ]
workflow_dispatch:

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get googletest
run: |
wget https://github.com/google/googletest/archive/refs/tags/release-1.12.1.zip
unzip release-1.12.1.zip
cd googletest-release-1.12.1
mkdir build
cd build
cmake ..
make
- name: Build main executable
run: make EXTRA_CPPFLAGS="-fsanitize=address -fsanitize=undefined"
- name: Build test executable
run: make test GTEST_HDR=googletest-release-1.12.1/googletest/include GTEST_LIB=googletest-release-1.12.1/build/lib EXTRA_CPPFLAGS="-fsanitize=address -fsanitize=undefined"
- name: Run test executable
run: ./test
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ $ make
./main
```

Define `EXTRA_CPPFLAGS` to pass flags to the build. For example, to build with
sanitizers:

```
$ make EXTRA_CPPFLAGS="-fsanitize=address -fsanitize=undefined"
```

## Testing

```sh
Expand Down