docs: add CLAUDE.md with project context (#1057) #1421
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
| # CI Workflow for PACS System | |
| # Multi-platform, multi-compiler build and test | |
| # | |
| # Based on messaging_system CI patterns for kcenon ecosystem consistency | |
| # | |
| # Note: Uses Ubuntu 24.04 for GCC 13+ support which provides std::format | |
| # (required by logger_system dependency) | |
| name: CI | |
| on: | |
| push: | |
| branches: [main, develop, feature/*] | |
| pull_request: | |
| branches: [main, develop] | |
| workflow_dispatch: | |
| # Ensure only one workflow runs per branch/PR | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: ${{ matrix.os }} / ${{ matrix.compiler }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 60 | |
| env: | |
| BUILD_TYPE: Release | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Ubuntu 24.04 provides GCC 13+ with std::format support | |
| - os: ubuntu-24.04 | |
| compiler: gcc | |
| cc: gcc | |
| cxx: g++ | |
| triplet: x64-linux | |
| - os: ubuntu-24.04 | |
| compiler: clang | |
| cc: clang | |
| cxx: clang++ | |
| triplet: x64-linux | |
| # macOS: use explicit /usr/bin paths to ensure Apple Clang (Xcode) | |
| # is used instead of Homebrew LLVM Clang, which lacks std::format | |
| - os: macos-14 | |
| compiler: clang | |
| cc: /usr/bin/clang | |
| cxx: /usr/bin/clang++ | |
| triplet: arm64-osx | |
| # Windows 2022 with MSVC for cross-platform compatibility | |
| - os: windows-2022 | |
| compiler: msvc | |
| triplet: x64-windows | |
| steps: | |
| - name: Checkout pacs_system | |
| uses: actions/checkout@v4 | |
| with: | |
| path: pacs_system | |
| - name: Checkout kcenon dependencies (pinned versions) | |
| uses: ./pacs_system/.github/actions/checkout-kcenon-deps | |
| with: | |
| patch-werror: 'true' | |
| - name: Install dependencies (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt update | |
| sudo apt install -y cmake build-essential ninja-build pkg-config | |
| sudo apt install -y libsqlite3-dev libssl-dev libfmt-dev | |
| sudo apt install -y libgtest-dev libgmock-dev | |
| sudo apt install -y libjpeg-turbo8-dev libicu-dev | |
| if [ "${{ matrix.compiler }}" = "clang" ]; then | |
| sudo apt install -y clang lld | |
| fi | |
| - name: Install dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install ninja pkg-config sqlite3 openssl@3 googletest fmt jpeg-turbo icu4c | |
| - name: Setup MSVC (Windows) | |
| if: runner.os == 'Windows' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Check architecture (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| if [ "$(uname -m)" = "aarch64" ]; then | |
| echo "VCPKG_FORCE_SYSTEM_BINARIES=arm" >> $GITHUB_ENV | |
| fi | |
| - name: Setup vcpkg | |
| uses: kcenon/common_system/.github/actions/setup-vcpkg@main | |
| with: | |
| extra-cache-key: 'pacs-system' | |
| manifest-dir: 'pacs_system' | |
| - name: Cache vcpkg installed | |
| uses: actions/cache@v5 | |
| id: vcpkg-installed | |
| with: | |
| path: ${{ github.workspace }}/pacs_system/vcpkg_installed | |
| key: ${{ runner.os }}-${{ matrix.compiler }}-vcpkg-installed-${{ matrix.triplet }}-${{ hashFiles('pacs_system/vcpkg.json', 'pacs_system/vcpkg-configuration.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.compiler }}-vcpkg-installed-${{ matrix.triplet }}- | |
| - name: Install dependencies with vcpkg (Unix) | |
| if: runner.os != 'Windows' && steps.vcpkg-installed.outputs.cache-hit != 'true' | |
| id: vcpkg_install_unix | |
| continue-on-error: true | |
| run: | | |
| ${{ env.VCPKG_ROOT }}/vcpkg install --x-manifest-root=pacs_system --x-install-root=${{ github.workspace }}/pacs_system/vcpkg_installed --triplet ${{ matrix.triplet }} | |
| - name: Install dependencies with vcpkg (Windows) | |
| if: runner.os == 'Windows' && steps.vcpkg-installed.outputs.cache-hit != 'true' | |
| id: vcpkg_install_windows | |
| continue-on-error: true | |
| shell: pwsh | |
| run: | | |
| ${{ env.VCPKG_ROOT }}\vcpkg install --x-manifest-root=pacs_system --x-install-root=${{ github.workspace }}\pacs_system\vcpkg_installed --triplet ${{ matrix.triplet }} | |
| - name: Build application (vcpkg - Unix) | |
| if: runner.os != 'Windows' && steps.vcpkg_install_unix.outcome != 'failure' | |
| id: build_vcpkg_unix | |
| continue-on-error: true | |
| working-directory: pacs_system | |
| run: | | |
| rm -rf build | |
| mkdir -p build | |
| cd build | |
| cmake .. \ | |
| -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ | |
| -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF \ | |
| -DPACS_WARNINGS_AS_ERRORS=OFF \ | |
| -DPACS_BUILD_TESTS=ON \ | |
| -DPACS_BUILD_EXAMPLES=OFF \ | |
| -DPACS_BUILD_STORAGE=ON \ | |
| -DCMAKE_TOOLCHAIN_FILE="${{ env.CMAKE_TOOLCHAIN_FILE }}" \ | |
| -DCMAKE_C_COMPILER=${{ matrix.cc }} \ | |
| -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} | |
| cmake --build . --parallel | |
| ctest --output-on-failure --timeout 120 | |
| - name: Build application (vcpkg - Windows) | |
| if: runner.os == 'Windows' && steps.vcpkg_install_windows.outcome != 'failure' | |
| id: build_vcpkg_windows | |
| continue-on-error: true | |
| working-directory: pacs_system | |
| shell: pwsh | |
| run: | | |
| if (Test-Path build) { Remove-Item -Recurse -Force build } | |
| New-Item -ItemType Directory -Path build | |
| cd build | |
| cmake .. ` | |
| -G Ninja ` | |
| -DCMAKE_BUILD_TYPE=Release ` | |
| -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF ` | |
| -DPACS_WARNINGS_AS_ERRORS=OFF ` | |
| -DPACS_BUILD_TESTS=ON ` | |
| -DPACS_BUILD_EXAMPLES=OFF ` | |
| -DPACS_BUILD_STORAGE=ON ` | |
| -DCMAKE_TOOLCHAIN_FILE="${{ env.CMAKE_TOOLCHAIN_FILE }}" ` | |
| -DCMAKE_CXX_FLAGS="/std:c++20 /permissive- /Zc:__cplusplus /EHsc" ` | |
| -DCMAKE_TRY_COMPILE_TARGET_TYPE="STATIC_LIBRARY" | |
| cmake --build . --config Release --parallel | |
| ctest -C Release --output-on-failure --timeout 120 | |
| - name: Build application (fallback - Unix) | |
| if: runner.os != 'Windows' && (steps.vcpkg_install_unix.outcome == 'failure' || steps.build_vcpkg_unix.outcome != 'success') | |
| working-directory: pacs_system | |
| run: | | |
| echo "vcpkg build failed. Falling back to system libraries..." | |
| rm -rf build | |
| mkdir -p build | |
| cd build | |
| cmake .. \ | |
| -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ | |
| -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF \ | |
| -DPACS_WARNINGS_AS_ERRORS=OFF \ | |
| -DPACS_BUILD_TESTS=ON \ | |
| -DPACS_BUILD_EXAMPLES=OFF \ | |
| -DPACS_BUILD_STORAGE=ON \ | |
| -DCMAKE_C_COMPILER=${{ matrix.cc }} \ | |
| -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} | |
| cmake --build . --parallel | |
| ctest --output-on-failure --timeout 120 || echo "Some tests failed" | |
| - name: Build application (fallback - Windows) | |
| if: runner.os == 'Windows' && (steps.vcpkg_install_windows.outcome == 'failure' || steps.build_vcpkg_windows.outcome != 'success') | |
| working-directory: pacs_system | |
| shell: pwsh | |
| run: | | |
| Write-Host "vcpkg build failed. Falling back to system libraries..." | |
| if (Test-Path build) { Remove-Item -Recurse -Force build } | |
| New-Item -ItemType Directory -Path build | |
| cd build | |
| cmake .. ` | |
| -G Ninja ` | |
| -DCMAKE_BUILD_TYPE=Release ` | |
| -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF ` | |
| -DPACS_WARNINGS_AS_ERRORS=OFF ` | |
| -DPACS_BUILD_TESTS=ON ` | |
| -DPACS_BUILD_EXAMPLES=OFF ` | |
| -DPACS_BUILD_STORAGE=ON ` | |
| -DVCPKG_MANIFEST_MODE=OFF ` | |
| -DCMAKE_CXX_FLAGS="/std:c++20 /permissive- /Zc:__cplusplus /EHsc" ` | |
| -DCMAKE_TRY_COMPILE_TARGET_TYPE="STATIC_LIBRARY" | |
| cmake --build . --config Release --parallel | |
| ctest -C Release --output-on-failure --timeout 120 || Write-Host "Some tests failed" | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: test-results-${{ matrix.os }}-${{ matrix.compiler }} | |
| path: | | |
| pacs_system/build/Testing/ | |
| pacs_system/build/**/*.log | |
| retention-days: 7 | |
| if-no-files-found: ignore | |
| - name: Upload build artifacts on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-failure-${{ matrix.os }}-${{ matrix.compiler }} | |
| path: | | |
| pacs_system/build/CMakeFiles/CMakeOutput.log | |
| pacs_system/build/CMakeFiles/CMakeError.log | |
| retention-days: 7 | |
| if-no-files-found: ignore |