Merge pull request #328 from No0ne558/dev #372
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: Linux builds (basic) | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| name: ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}} | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| cxx: | |
| - g++-12 | |
| - g++-13 | |
| - g++-14 | |
| - clang++-16 | |
| - clang++-17 | |
| - clang++-18 | |
| build_type: [Debug] #, Release] | |
| std: [20] | |
| include: | |
| # cannot be installed on ubuntu-24.04 be default? | |
| - cxx: g++-12 | |
| cc: gcc-12 | |
| other_pkgs: g++-12 | |
| cxxflags: "-O1 -fmax-errors=5" | |
| - cxx: g++-13 | |
| cc: gcc-13 | |
| other_pkgs: g++-13 | |
| cxxflags: "-O1 -fmax-errors=5" | |
| - cxx: g++-14 | |
| cc: gcc-14 | |
| other_pkgs: g++-14 | |
| cxxflags: "-O1 -fmax-errors=5" | |
| - cxx: clang++-16 | |
| cc: clang-16 | |
| other_pkgs: clang-16 | |
| cxxflags: "-O1 -fmax-errors=5" | |
| - cxx: clang++-17 | |
| cc: clang-17 | |
| other_pkgs: clang-17 | |
| cxxflags: "-O1 -fmax-errors=5" | |
| - cxx: clang++-18 | |
| cc: clang-18 | |
| other_pkgs: clang-18 | |
| cxxflags: "-O1 -fmax-errors=5" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Verify directory structure | |
| run: | | |
| echo "Verifying directory structure..." | |
| echo "Contents of root directory:" | |
| ls -la | |
| echo "" | |
| echo "Checking essential directories:" | |
| for dir in src main scripts assets config docs fonts external/core; do | |
| if [ -d "$dir" ]; then | |
| echo "✓ $dir/ exists" | |
| else | |
| echo "✗ $dir/ missing" | |
| exit 1 | |
| fi | |
| done | |
| echo "Directory verification complete." | |
| - name: Prepare environment | |
| env: | |
| TZ: "America/Los_Angeles" | |
| run: | | |
| sudo ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime | |
| echo ${TZ} | sudo tee /etc/timezone | |
| sudo apt-get update -q | |
| sudo apt-get install -y -y --no-install-recommends \ | |
| ${{matrix.other_pkgs}} \ | |
| build-essential \ | |
| xorg-dev \ | |
| libmotif-dev \ | |
| libfreetype6-dev \ | |
| cmake \ | |
| git \ | |
| xwit \ | |
| xfonts-base \ | |
| xfonts-75dpi \ | |
| xfonts-100dpi \ | |
| tzdata \ | |
| libcurl4-gnutls-dev | |
| - name: Configure build | |
| env: | |
| CC: ${{matrix.cc}} | |
| CXX: ${{matrix.cxx}} | |
| CXXFLAGS: ${{matrix.cxxflags}} | |
| run: | | |
| echo "Configuring build for ${{matrix.cxx}}..." | |
| cmake -S . -B _build_${{matrix.cxx}}_${{matrix.std}} \ | |
| -DCMAKE_INSTALL_PREFIX="${PWD}/_install_${{matrix.cxx}}_${{matrix.std}}" \ | |
| -DCMAKE_BUILD_TYPE="${{matrix.build_type}}" \ | |
| -DCMAKE_CXX_STANDARD=${{matrix.std}} \ | |
| -DCMAKE_CXX_EXTENSIONS=OFF | |
| - name: Build + install | |
| run: | | |
| echo "Building with ${{matrix.cxx}}..." | |
| echo "Available CPU cores: $(nproc)" | |
| echo "Starting build at $(date)..." | |
| # Run build and capture exit code | |
| set +e | |
| timeout 600 cmake --build _build_${{matrix.cxx}}_${{matrix.std}} -j4 | |
| BUILD_EXIT_CODE=$? | |
| set -e | |
| echo "Build command completed at $(date) with exit code $BUILD_EXIT_CODE" | |
| if [ $BUILD_EXIT_CODE -ne 0 ]; then | |
| echo "Build failed with exit code $BUILD_EXIT_CODE" | |
| echo "Showing last 100 lines of CMake build output:" | |
| tail -100 _build_${{matrix.cxx}}_${{matrix.std}}/CMakeFiles/CMakeOutput.log 2>/dev/null || echo "No CMakeOutput.log found" | |
| echo "Showing last 100 lines of CMake error output:" | |
| tail -100 _build_${{matrix.cxx}}_${{matrix.std}}/CMakeFiles/CMakeError.log 2>/dev/null || echo "No CMakeError.log found" | |
| exit $BUILD_EXIT_CODE | |
| fi | |
| if [ -f "_build_${{matrix.cxx}}_${{matrix.std}}/vt_main" ]; then | |
| echo "Build appears successful, proceeding with install..." | |
| timeout 120 cmake --build _build_${{matrix.cxx}}_${{matrix.std}} --target install | |
| else | |
| echo "Build failed - executable not found" | |
| exit 1 | |
| fi |