Refactor Boost package finding to use version-specific configuration … #21
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: CI windows | ||
| on: [push, pull_request] | ||
| jobs: | ||
| Test: | ||
| # Esegue il job su un ambiente Windows (windows-2025 al momento dell'uso) | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [windows-2025] | ||
| compiler: [msvc] | ||
| standard: [23] | ||
| build_type: [Release] | ||
| steps: | ||
| - name: 🔄 Checkout Repository | ||
| uses: actions/checkout@v4 | ||
| - name: 🛠️ Setup Cpp Tools | ||
| uses: aminya/setup-cpp@v1 | ||
| with: | ||
| # Configura MSVC e le variabili d'ambiente (vcvarsall) | ||
| compiler: ${{ matrix.compiler }} | ||
| vcvarsall: ${{ contains(matrix.os, 'windows' )}} | ||
| # Richiede l'installazione di CMake e Ninja | ||
| cmake: true | ||
| ninja: true | ||
| vcpkg: false | ||
| ccache: true | ||
| # Installazione di strumenti di analisi/copertura | ||
| clangtidy: true | ||
| cppcheck: true | ||
| gcovr: true | ||
| opencppcoverage: true | ||
| - name: Install boost | ||
| uses: MarkusJx/install-boost@v2 | ||
| id: install-boost | ||
| with: | ||
| # REQUIRED: Specify the required boost version | ||
| # A list of supported versions can be found here: | ||
| # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json | ||
| boost_version: 1.89.0 | ||
| - name: 🔗 Setup Other Dependencies (Asio) | ||
| run: | | ||
| # Download and extract Asio | ||
| curl -L -o asio.zip https://github.com/chriskohlhoff/asio/archive/refs/tags/asio-1-18-2.zip | ||
| tar -xf asio.zip | ||
| move asio-asio-1-18-2 asio | ||
| - name: ⚙️ Configure CMake - Windows | ||
| shell: powershell | ||
| run: | | ||
| Start-Sleep -Seconds 2 | ||
| # Costruisce il percorso assoluto della directory include di Asio | ||
| $AsioPath = Join-Path $env:GITHUB_WORKSPACE "asio/asio/include" | ||
| $AsioPath = $AsioPath -replace "\\", "/" | ||
| echo "ASIO path: $AsioPath" | ||
| dir $AsioPath | ||
| # Variabili esportate dall'azione MarkusJx/install-boost | ||
| $BoostRoot = "${{ steps.install-boost.outputs.BOOST_ROOT }}" | ||
| echo "ASIO path: $AsioPath" | ||
| echo "BOOST_ROOT path: $BoostRoot" | ||
| # DEBUG: Verifica se i percorsi esistono | ||
| echo "Contents of BOOST_ROOT:" | ||
| dir $BoostRoot | ||
| echo "Contents of BOOST_ROOT/lib:" | ||
| dir $BoostRoot/lib | ||
| # Esegue la configurazione CMake | ||
| cmake -S . -B ./build ` | ||
| -DCMAKE_BUILD_TYPE:STRING=${{ matrix.build_type }} ` | ||
| -DCMAKE_CXX_STANDARD=${{ matrix.standard }} ` | ||
| -DCLI_BuildTests=ON ` | ||
| -DCLI_BuildExamples=ON ` | ||
| -DCLI_UseBoostAsio=ON ` | ||
| -DASIO_INCLUDEDIR="$AsioPath" ` | ||
| -DBoost_ROOT="$BoostRoot" ` | ||
| -DBOOST_ROOT="$BoostRoot" | ||
| env: | ||
| BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} | ||
| Boost_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} | ||
| - name: 🔨 Build Project | ||
| run: | | ||
| cmake --build ./build --config ${{matrix.build_type}} | ||
| - name: ✅ Run Tests | ||
| working-directory: ./build | ||
| run: | | ||
| # Usa CTest per eseguire i test, compresi quelli basati su Boost Unit Test Framework | ||
| ctest -C ${{matrix.build_type}} --output-on-failure | ||
| env: | ||
| PATH: ${{ steps.install-boost.outputs.BOOST_ROOT }}/stage/lib/:$PATH | ||