yml fix again #8
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
| # file: .github/workflows/ci-build.yml | |
| name: CI - Build & Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build & smoke-check (${{ matrix.name }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Ubuntu 24.04 - g++-13 | |
| os: ubuntu-24.04 | |
| cc: gcc-13 | |
| cxx: g++-13 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # helpful for any git-based versioning later | |
| - name: Install build dependencies (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| cmake \ | |
| ninja-build \ | |
| g++-13 \ | |
| libstdc++-13-dev | |
| - name: Verify source directory structure (debug) | |
| run: | | |
| echo "=== GITHUB_WORKSPACE ===" | |
| echo "${{ github.workspace }}" | |
| echo "" | |
| cd "${{ github.workspace }}" | |
| pwd | |
| echo "" | |
| echo "=== ls -la (root) ===" | |
| ls -la | |
| echo "" | |
| echo "=== cmake/ folder ===" | |
| ls -la cmake/ || echo "ERROR: cmake/ not found!" | |
| echo "" | |
| echo "=== CompilerOptions.cmake ===" | |
| ls -la cmake/CompilerOptions.cmake || echo "ERROR: cmake/CompilerOptions.cmake not found!" | |
| echo "" | |
| echo "=== Search for CompilerOptions anywhere ===" | |
| find . -type f -name CompilerOptions.cmake || echo "Not found anywhere" | |
| # Temporarily disabled — re-enable after first successful run | |
| # - name: Cache build directory | |
| # uses: actions/cache@v4 | |
| # with: | |
| # path: build | |
| # key: ${{ runner.os }}-build-ninja-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt', 'cmake/*.cmake', 'CMakePresets.json') }} | |
| # restore-keys: ${{ runner.os }}-build-ninja-${{ matrix.name }}- | |
| - name: Configure CMake (absolute paths) | |
| env: | |
| CC: ${{ matrix.cc }} | |
| CXX: ${{ matrix.cxx }} | |
| run: | | |
| cmake -S "${{ github.workspace }}" \ | |
| -B "${{ github.workspace }}/build" \ | |
| -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | |
| -DBUILD_LIBRARY=ON \ | |
| -DBUILD_APPS=ON \ | |
| -DBUILD_TESTS=OFF \ | |
| -DENABLE_NXCORE=OFF \ | |
| -DCMAKE_VERBOSE_MAKEFILE=ON \ | |
| -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install-test" | |
| - name: Build | |
| run: cmake --build "${{ github.workspace }}/build" --parallel $(nproc) | |
| - name: Install (test install rules) | |
| run: cmake --install "${{ github.workspace }}/build" | |
| - name: Show installed files (debug) | |
| if: always() | |
| run: | | |
| echo "=== Installed files ===" | |
| find "${{ github.workspace }}/install-test" -type f | sort || echo "Nothing installed" | |
| - name: Smoke check - catmsg executable | |
| if: runner.os == 'Linux' | |
| run: | | |
| set -e | |
| EXEC="${{ github.workspace }}/build/apps/catmsg/catmsg" | |
| if [ ! -x "$EXEC" ]; then | |
| echo "ERROR: catmsg not built or not executable" | |
| exit 1 | |
| fi | |
| echo "Running: $EXEC (expect usage/help)" | |
| "$EXEC" 2>&1 | grep -qiE "usage|catmsg|options" && echo "OK - found expected output" || { | |
| echo "ERROR: No expected usage/help message" | |
| "$EXEC" --help || true | |
| exit 1 | |
| } | |
| # Uncomment when tests are ready | |
| # - name: Run unit tests | |
| # if: runner.os == 'Linux' | |
| # run: ctest --test-dir "${{ github.workspace }}/build" --output-on-failure --parallel $(nproc) |