forked from hrbrmstr/tdigest
-
Notifications
You must be signed in to change notification settings - Fork 7
ci: add GitHub Actions build/test + ASan/UBSan (fix cmake test build) #43
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gabsow
merged 4 commits into
RedisBloom:master
from
redis-performance:ci-github-actions-sanitizers
Jul 29, 2026
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
448b555
ci: add GitHub Actions build/test + ASan/UBSan, fix cmake test build
fcostaoliveira facdfb3
ci: least-privilege workflow token (contents: read, no persisted creds)
fcostaoliveira 6054d44
ci: run the whole test suite under sanitizers via CMake/CTest
fcostaoliveira 8bf0dd7
ci: pin the sanitizer job to a Debug build
fcostaoliveira File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
| pull_request: | ||
|
|
||
| # Least privilege: the workflow only needs to read the repository. The repo | ||
| # default is `write`, so scope it down explicitly and drop the checkout token | ||
| # after fetch, so pull-request-controlled build/test steps never see a | ||
| # write-capable token. | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build-and-test: | ||
| name: build + unit tests (${{ matrix.cc }}) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| cc: [gcc, clang] | ||
| env: | ||
| CC: ${{ matrix.cc }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Configure | ||
| run: > | ||
| cmake -S . -B build | ||
| -DCMAKE_BUILD_TYPE=Release | ||
| -DBUILD_TESTS=ON -DBUILD_BENCHMARK=OFF -DBUILD_EXAMPLES=OFF | ||
| - name: Build | ||
| run: cmake --build build -j"$(nproc)" | ||
| - name: Unit tests | ||
| run: ctest --test-dir build --output-on-failure | ||
|
|
||
| sanitizers: | ||
| name: ASan + UBSan | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| CC: clang | ||
| CXX: clang++ | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| # Build the whole test suite with sanitizers via CMake and run it through | ||
| # CTest, so every registered test target (not just td_test) is covered by | ||
| # ASan/UBSan. A non-Release build avoids the top-level "-std=c99" that would | ||
| # otherwise hide POSIX clock_gettime() in minunit.h. | ||
| - name: Configure with ASan + UBSan | ||
| run: > | ||
| cmake -S . -B build-san | ||
| -DBUILD_TESTS=ON -DBUILD_BENCHMARK=OFF -DBUILD_EXAMPLES=OFF | ||
| -DCMAKE_C_FLAGS="-O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all" | ||
| -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,undefined" | ||
| - name: Build | ||
| run: cmake --build build-san -j"$(nproc)" | ||
| - name: Run all tests under sanitizers | ||
| env: | ||
| # A fuzzed/huge compression can request an enormous capacity; let the | ||
| # library's allocation-failure path run instead of aborting the process. | ||
| ASAN_OPTIONS: detect_leaks=1:allocator_may_return_null=1 | ||
| UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1 | ||
| run: ctest --test-dir build-san --output-on-failure | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.