Add C++ std::transform_reduce example #24
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 clang-format | |
| # 3. Clang-format check | |
| - name: Clang-format Check | |
| run: | | |
| ./clang-check.sh *.cpp *.hpp *.c *.h | |
| # 4. Build and run all examples dynamically | |
| - name: Build and Run | |
| run: | | |
| for san in address thread undefined; do | |
| echo "=== Building all examples with sanitizer $san ===" | |
| make SANITIZE=$san | |
| echo "=== Running all examples with sanitizer $san ===" | |
| make run | |
| done | |
| - name: Clean up build artifacts | |
| run: | | |
| make clean |