Dev/training loop (#3) #34
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 - Build and test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test-debug: | |
| name: Build project and test in debug mode | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| gcc-version: [13] | |
| cmake-version: ['3.31.3'] | |
| fail-fast: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python 3.10 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install pytest | |
| run: pip install pytest | |
| - name: Install Boost Python and Python dev headers | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y \ | |
| libboost-python-dev \ | |
| python3-dev | |
| - name: Setup CMake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: ${{ matrix.cmake-version }} | |
| - name: Setup GCC | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-${{ matrix.gcc-version }} g++-${{ matrix.gcc-version }} | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc-version }} 100 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.gcc-version }} 100 | |
| - name: Verify versions | |
| run: | | |
| gcc --version | |
| cmake --version | |
| - name: Build in Debug Mode | |
| run: | | |
| mkdir build && cd build | |
| cmake -DCMake_Build_Type=Debug -DBUILD_TESTS=ON .. | |
| make | |
| - name: Run Unit tests | |
| run: cd build && ctest --output-on-failure --verbose | |
| - name: Upload artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: debug-build-output | |
| path: build/ | |
| retention-days: 2 | |
| test-release: | |
| name: Build project and test in relese mode | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| gcc-version: [13] | |
| cmake-version: ['3.31.3'] | |
| fail-fast: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python 3.10 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install pytest | |
| run: pip install pytest | |
| - name: Install Boost Python and Python dev headers | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y \ | |
| libboost-python-dev \ | |
| python3-dev | |
| - name: Setup CMake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: ${{ matrix.cmake-version }} | |
| - name: Setup GCC | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-${{ matrix.gcc-version }} g++-${{ matrix.gcc-version }} | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc-version }} 100 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.gcc-version }} 100 | |
| - name: Verify versions | |
| run: | | |
| gcc --version | |
| cmake --version | |
| - name: Build in Release Mode | |
| run: | | |
| mkdir build && cd build | |
| cmake -DCMake_Build_Type=Release -DBUILD_TESTS=ON .. | |
| make | |
| - name: Run Unit tests | |
| run: cd build && ctest --output-on-failure --verbose | |
| - name: Upload artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-build-output | |
| path: build/ | |
| retention-days: 2 |