Refactor and adding features #1
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: CI | |
| on: | |
| push: | |
| branches: [ main, master, develop ] | |
| pull_request: | |
| branches: [ main, master, develop ] | |
| jobs: | |
| # Linux - GCC | |
| linux-gcc: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| gcc-version: [9, 11, 13] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install GCC ${{ matrix.gcc-version }} | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-${{ matrix.gcc-version }} g++-${{ matrix.gcc-version }} | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build -S . \ | |
| -DCMAKE_C_COMPILER=gcc-${{ matrix.gcc-version }} \ | |
| -DCMAKE_CXX_COMPILER=g++-${{ matrix.gcc-version }} \ | |
| -DCMAKE_BUILD_TYPE=Release | |
| - name: Build | |
| run: cmake --build build --parallel $(nproc) | |
| - name: Test | |
| run: cd build && ctest --output-on-failure --parallel $(nproc) | |
| # Linux - Clang | |
| linux-clang: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| clang-version: [11, 14, 16] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Clang ${{ matrix.clang-version }} | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang-${{ matrix.clang-version }} | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build -S . \ | |
| -DCMAKE_C_COMPILER=clang-${{ matrix.clang-version }} \ | |
| -DCMAKE_CXX_COMPILER=clang++-${{ matrix.clang-version }} \ | |
| -DCMAKE_BUILD_TYPE=Release | |
| - name: Build | |
| run: cmake --build build --parallel $(nproc) | |
| - name: Test | |
| run: cd build && ctest --output-on-failure --parallel $(nproc) | |
| # macOS - Clang (Apple Clang) | |
| macos: | |
| runs-on: macos-13 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Configure CMake | |
| run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release | |
| - name: Build | |
| run: cmake --build build --parallel $(sysctl -n hw.ncpu) | |
| - name: Test | |
| run: cd build && ctest --output-on-failure --parallel $(sysctl -n hw.ncpu) | |
| # Windows - MSVC | |
| windows-msvc: | |
| runs-on: windows-2022 | |
| strategy: | |
| matrix: | |
| build-type: [Release, Debug] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Configure CMake | |
| run: cmake -B build -S . -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} | |
| - name: Build | |
| run: cmake --build build --config ${{ matrix.build-type }} --parallel | |
| - name: Test | |
| run: | | |
| cd build | |
| ctest -C ${{ matrix.build-type }} --output-on-failure --parallel | |
| # Summary job | |
| ci-success: | |
| runs-on: ubuntu-22.04 | |
| needs: [linux-gcc, linux-clang, macos, windows-msvc] | |
| if: success() | |
| steps: | |
| - name: CI Success | |
| run: echo "✅ All CI jobs passed!" |