Address Sanitizer #11
Workflow file for this run
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
| name: C++ CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build-and-run: | |
| runs-on: ubuntu-latest | |
| env: | |
| ASAN_OPTIONS: detect_leaks=1 # automatically detect memory leaks | |
| steps: | |
| # 1. Checkout repo | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # 2. Install build tools | |
| - name: Install build tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential g++ clang | |
| # 3. Build and run all examples dynamically | |
| - name: Build and run examples | |
| run: | | |
| # Detect folders with Makefile | |
| folders=$(find . -maxdepth 1 -type d -not -name '.' -exec test -f '{}/Makefile' \; -print | sed 's|^\./||') | |
| # List detected folders | |
| echo "Detected example folders: $folders" | |
| # Loop over each folder and sanitizer | |
| for folder in $folders; do | |
| for san in address thread undefined; do | |
| echo "=== Building $folder with sanitizer $san ===" | |
| make -C $folder SANITIZE=$san | |
| echo "=== Running $folder with sanitizer $san ===" | |
| make -C $folder SANITIZE=$san run | |
| done | |
| done |