Add Asan #9
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 | ||
|
Check failure on line 1 in .github/workflows/ci.yml
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| jobs: | ||
| # Step 1: dynamically detect example folders | ||
| detect-examples: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| folders: ${{ steps.set-folders.outputs.folders }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Detect example folders | ||
| id: set-folders | ||
| run: | | ||
| folders=$(find . -maxdepth 1 -type d -not -name '.' -exec test -f '{}/Makefile' \; -print | sed 's|^\./||' | tr '\n' ' ') | ||
| echo "Detected folders: $folders" | ||
| echo "::set-output name=folders::$folders" | ||
| # Step 2: build and run examples in parallel using a matrix | ||
| build-and-run: | ||
| needs: detect-examples | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| folder: ${{ fromJSON('["' + needs.detect-examples.outputs.folders | replace(' ', '","') + '"]') }} | ||
| sanitizer: [address, thread, undefined] | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Install build tools | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y build-essential g++ clang | ||
| - name: Build example | ||
| run: | | ||
| echo "Building ${{ matrix.folder }} with SANITIZE=${{ matrix.sanitizer }}" | ||
| make -C ${{ matrix.folder }} SANITIZE=${{ matrix.sanitizer }} | ||
| - name: Run example | ||
| run: | | ||
| echo "Running ${{ matrix.folder }} with SANITIZE=${{ matrix.sanitizer }}" | ||
| make -C ${{ matrix.folder }} SANITIZE=${{ matrix.sanitizer }} run | ||