refactor(modules): update C++20 module files for upstream ecosystem changes (#223) #367
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: Static Analysis | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| clang-tidy: | |
| name: Clang-Tidy Analysis | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| continue-on-error: true # Phase 0: Baseline collection | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| persist-credentials: true | |
| clean: true | |
| fetch-depth: 1 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Checkout dependencies | |
| run: | | |
| cd .. | |
| git clone --depth 1 https://github.com/kcenon/common_system.git | |
| git clone --depth 1 https://github.com/kcenon/thread_system.git | |
| git clone --depth 1 https://github.com/kcenon/logger_system.git | |
| git clone --depth 1 https://github.com/kcenon/container_system.git | |
| git clone --depth 1 https://github.com/kcenon/network_system.git | |
| git clone --depth 1 https://github.com/kcenon/monitoring_system.git | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y cmake build-essential ninja-build clang clang-tidy lld | |
| sudo apt install -y libgtest-dev libgmock-dev libyaml-cpp-dev | |
| - name: Configure CMake | |
| run: | | |
| mkdir -p build | |
| cd build | |
| # Use GCC for compilation to ensure std::format support | |
| # clang-tidy will still analyze the code using compile_commands.json | |
| cmake .. \ | |
| -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DMESSAGING_BUILD_TESTS=ON \ | |
| -DMESSAGING_BUILD_EXAMPLES=OFF \ | |
| -DMESSAGING_USE_LOCAL_SYSTEMS=ON \ | |
| -DCMAKE_C_COMPILER=gcc \ | |
| -DCMAKE_CXX_COMPILER=g++ \ | |
| -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
| - name: Run clang-tidy | |
| run: | | |
| cd build | |
| # Phase 0: Just collect baseline, don't fail | |
| run-clang-tidy -p . || echo "clang-tidy found issues (baseline collection)" | |
| - name: Upload clang-tidy results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: clang-tidy-results | |
| path: | | |
| build/compile_commands.json | |
| build/**/*.log | |
| retention-days: 7 | |
| if-no-files-found: ignore | |
| cppcheck: | |
| name: Cppcheck Analysis | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| continue-on-error: true # Phase 0: Baseline collection | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| persist-credentials: true | |
| clean: true | |
| fetch-depth: 1 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y cppcheck | |
| - name: Run Cppcheck | |
| run: | | |
| cppcheck \ | |
| --enable=all \ | |
| --inconclusive \ | |
| --std=c++20 \ | |
| --suppress=missingInclude \ | |
| --suppress=unmatchedSuppression \ | |
| --inline-suppr \ | |
| --xml \ | |
| --xml-version=2 \ | |
| -I include \ | |
| src/ \ | |
| 2> cppcheck-results.xml || echo "Cppcheck found issues (baseline collection)" | |
| - name: Upload Cppcheck results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cppcheck-results | |
| path: cppcheck-results.xml | |
| retention-days: 7 | |
| if-no-files-found: ignore |