PHASE-83–86: Integration tests, client audits, code commentary, and standards (425→441 tasks) #379
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: RootStream CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| build-type: [release, debug] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| pkg-config \ | |
| libdrm-dev \ | |
| libva-dev \ | |
| libsodium-dev \ | |
| libopus-dev \ | |
| libasound2-dev \ | |
| libsdl2-dev \ | |
| libgtk-3-dev \ | |
| libavahi-client-dev \ | |
| libqrencode-dev \ | |
| libpng-dev \ | |
| libx11-dev | |
| - name: Build (${{ matrix.build-type }}) | |
| run: | | |
| if [ "${{ matrix.build-type }}" = "debug" ]; then | |
| make DEBUG=1 | |
| else | |
| make | |
| fi | |
| - name: Verify binary | |
| run: | | |
| ./rootstream --help || true | |
| file ./rootstream | |
| ldd ./rootstream || true | |
| - name: Upload binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rootstream-${{ matrix.build-type }} | |
| path: rootstream | |
| unit-tests: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| pkg-config \ | |
| libdrm-dev \ | |
| libva-dev \ | |
| libsodium-dev \ | |
| libopus-dev \ | |
| libasound2-dev \ | |
| libsdl2-dev \ | |
| libgtk-3-dev \ | |
| libavahi-client-dev \ | |
| libqrencode-dev \ | |
| libpng-dev \ | |
| libx11-dev | |
| - name: Build tests | |
| run: make test-build | |
| - name: Run crypto tests | |
| run: ./tests/unit/test_crypto | |
| - name: Run encoding tests | |
| run: ./tests/unit/test_encoding | |
| integration-tests: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| pkg-config \ | |
| libdrm-dev \ | |
| libva-dev \ | |
| libsodium-dev \ | |
| libopus-dev \ | |
| libasound2-dev \ | |
| libsdl2-dev \ | |
| libgtk-3-dev \ | |
| libavahi-client-dev \ | |
| libqrencode-dev \ | |
| libpng-dev \ | |
| libx11-dev \ | |
| xvfb | |
| - name: Build | |
| run: make | |
| - name: Run integration tests | |
| run: | | |
| # Some tests need a display | |
| xvfb-run --auto-servernum ./tests/integration/test_stream.sh || \ | |
| ./tests/integration/test_stream.sh | |
| code-quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| cppcheck \ | |
| clang-tools | |
| - name: Run cppcheck | |
| run: | | |
| cppcheck --enable=warning,style,performance \ | |
| --suppress=missingIncludeSystem \ | |
| --error-exitcode=0 \ | |
| src/ include/ | |
| - name: Check for common issues | |
| run: | | |
| # Check for TODO/FIXME counts (informational) | |
| echo "=== TODOs and FIXMEs ===" | |
| grep -rn "TODO\|FIXME" src/ include/ || echo "None found" | |
| # Check for potential security issues | |
| echo "" | |
| echo "=== Potential security patterns ===" | |
| grep -rn "strcpy\|sprintf\|gets" src/ || echo "None found (good!)" | |
| memory-check: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| pkg-config \ | |
| libdrm-dev \ | |
| libva-dev \ | |
| libsodium-dev \ | |
| libopus-dev \ | |
| libasound2-dev \ | |
| libsdl2-dev \ | |
| libgtk-3-dev \ | |
| libavahi-client-dev \ | |
| libqrencode-dev \ | |
| libpng-dev \ | |
| libx11-dev \ | |
| valgrind | |
| - name: Build with debug symbols | |
| run: make DEBUG=1 test-build | |
| - name: Run valgrind on unit tests | |
| run: | | |
| valgrind --leak-check=full \ | |
| --show-leak-kinds=definite \ | |
| --error-exitcode=0 \ | |
| ./tests/unit/test_crypto 2>&1 | tee valgrind-crypto.log | |
| valgrind --leak-check=full \ | |
| --show-leak-kinds=definite \ | |
| --error-exitcode=0 \ | |
| ./tests/unit/test_encoding 2>&1 | tee valgrind-encoding.log | |
| - name: Upload valgrind logs | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: valgrind-logs | |
| path: valgrind-*.log | |
| windows-build: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| build-type: [Release, Debug] | |
| env: | |
| VCPKG_ROOT: C:\vcpkg | |
| VCPKG_DEFAULT_TRIPLET: x64-windows | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup MSVC | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Cache vcpkg packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: C:\vcpkg\installed | |
| key: vcpkg-win-x64-${{ hashFiles('vcpkg.json') }} | |
| restore-keys: vcpkg-win-x64- | |
| - name: Install vcpkg dependencies | |
| run: | | |
| & "$env:VCPKG_ROOT\vcpkg.exe" integrate install | |
| & "$env:VCPKG_ROOT\vcpkg.exe" install --triplet x64-windows | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build -S . ` | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} ` | |
| -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT\scripts\buildsystems\vcpkg.cmake" ` | |
| -DVCPKG_TARGET_TRIPLET=x64-windows | |
| - name: Build | |
| run: cmake --build build --config ${{ matrix.build-type }} | |
| - name: Verify build | |
| run: | | |
| if (Test-Path "build\${{ matrix.build-type }}\rootstream-client.exe") { | |
| Write-Host "✓ Windows client built successfully" | |
| Get-Item "build\${{ matrix.build-type }}\rootstream-client.exe" | |
| } else { | |
| Write-Host "Looking for built executable..." | |
| Get-ChildItem -Recurse build -Filter "*.exe" | ForEach-Object { $_.FullName } | |
| } | |
| - name: Upload Windows client | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rootstream-windows-${{ matrix.build-type }} | |
| path: | | |
| build/${{ matrix.build-type }}/rootstream-client.exe | |
| build/rootstream-client.exe | |
| if-no-files-found: warn | |
| cmake-linux-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| pkg-config \ | |
| libdrm-dev \ | |
| libva-dev \ | |
| libsodium-dev \ | |
| libopus-dev \ | |
| libasound2-dev \ | |
| libsdl2-dev \ | |
| libgtk-3-dev \ | |
| libavahi-client-dev \ | |
| libqrencode-dev \ | |
| libpng-dev \ | |
| libx11-dev \ | |
| libpulse-dev \ | |
| libpipewire-0.3-dev \ | |
| libavformat-dev \ | |
| libavcodec-dev \ | |
| libavutil-dev | |
| - name: Configure CMake | |
| run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DENABLE_UNIT_TESTS=ON -DENABLE_INTEGRATION_TESTS=ON | |
| - name: Build with CMake | |
| run: cmake --build build | |
| - name: Verify CMake binary | |
| run: | | |
| file build/rootstream || true | |
| ldd build/rootstream || true | |
| - name: Run PHASE 8 Unit Tests | |
| working-directory: build | |
| run: ctest -L unit --output-on-failure | |
| - name: Run PHASE 8 Integration Tests | |
| working-directory: build | |
| run: ctest -L integration --output-on-failure | |
| - name: Run All Tests Summary | |
| working-directory: build | |
| run: ctest --output-on-failure |