Dry Run #21
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: Dry Run | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| # ── Step 1: Lint ────────────────────────────────────────────── | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install build deps | |
| run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev zlib1g-dev cmake | |
| # LLVM 20 (clang-format + clang-tidy) from apt.llvm.org | |
| - name: Install LLVM 20 | |
| run: | | |
| wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc | |
| echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main" | sudo tee /etc/apt/sources.list.d/llvm-20.list | |
| sudo apt-get update | |
| sudo apt-get install -y clang-format-20 | |
| # cppcheck 2.20.0 from source (cached) | |
| - uses: actions/cache@v4 | |
| id: cppcheck-cache | |
| with: | |
| path: /opt/cppcheck | |
| key: cppcheck-2.20.0-ubuntu-amd64 | |
| - name: Build cppcheck 2.20.0 | |
| if: steps.cppcheck-cache.outputs.cache-hit != 'true' | |
| run: | | |
| git clone --depth 1 --branch 2.20.0 https://github.com/danmar/cppcheck.git /tmp/cppcheck | |
| cmake -S /tmp/cppcheck -B /tmp/cppcheck/build -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=OFF -DCMAKE_INSTALL_PREFIX=/opt/cppcheck | |
| cmake --build /tmp/cppcheck/build -j$(nproc) | |
| cmake --install /tmp/cppcheck/build | |
| - name: Add cppcheck to PATH | |
| run: echo "/opt/cppcheck/bin" >> "$GITHUB_PATH" | |
| - name: Verify versions | |
| run: | | |
| echo "clang-format: $(clang-format-20 --version)" | |
| echo "cppcheck: $(cppcheck --version)" | |
| - name: clang-format | |
| run: make -f Makefile.cbm lint-format CLANG_FORMAT=clang-format-20 | |
| - name: cppcheck | |
| run: make -f Makefile.cbm lint-cppcheck | |
| # ── Step 2: Unit tests (ASan + UBSan) ──────────────────────── | |
| test: | |
| needs: [lint] | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| arch: amd64 | |
| - os: ubuntu-24.04-arm | |
| arch: arm64 | |
| - os: macos-14 | |
| arch: arm64 | |
| - os: macos-15-intel | |
| arch: amd64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install deps (Ubuntu) | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev zlib1g-dev | |
| - name: Run C tests (ASan + UBSan) | |
| run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm test | |
| # ── Step 3: Build binaries (standard + UI, all OS) ─────────── | |
| build-unix: | |
| needs: [test] | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| goos: linux | |
| goarch: amd64 | |
| - os: ubuntu-24.04-arm | |
| goos: linux | |
| goarch: arm64 | |
| - os: macos-14 | |
| goos: darwin | |
| goarch: arm64 | |
| - os: macos-15-intel | |
| goos: darwin | |
| goarch: amd64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install deps (Ubuntu) | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev zlib1g-dev | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Build standard binary | |
| run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm | |
| - name: Archive standard binary | |
| run: | | |
| tar -czf codebase-memory-mcp-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz \ | |
| -C build/c codebase-memory-mcp | |
| - name: Build UI binary | |
| run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm-with-ui | |
| - name: Archive UI binary | |
| run: | | |
| tar -czf codebase-memory-mcp-ui-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz \ | |
| -C build/c codebase-memory-mcp | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: binaries-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: "*.tar.gz" | |
| build-windows: | |
| needs: [test] | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: UCRT64 | |
| path-type: inherit | |
| install: >- | |
| mingw-w64-ucrt-x86_64-gcc | |
| mingw-w64-ucrt-x86_64-sqlite3 | |
| mingw-w64-ucrt-x86_64-zlib | |
| make | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Build standard binary | |
| shell: msys2 {0} | |
| run: make -j$(nproc) -f Makefile.cbm cbm | |
| - name: Archive standard binary | |
| shell: pwsh | |
| run: | | |
| Copy-Item build/c/codebase-memory-mcp -Destination codebase-memory-mcp.exe | |
| Compress-Archive -Path codebase-memory-mcp.exe -DestinationPath codebase-memory-mcp-windows-amd64.zip | |
| - name: Build UI binary | |
| shell: msys2 {0} | |
| run: make -j$(nproc) -f Makefile.cbm cbm-with-ui | |
| - name: Archive UI binary | |
| shell: pwsh | |
| run: | | |
| Copy-Item build/c/codebase-memory-mcp -Destination codebase-memory-mcp-ui.exe -Force | |
| Compress-Archive -Path codebase-memory-mcp-ui.exe -DestinationPath codebase-memory-mcp-ui-windows-amd64.zip | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: binaries-windows-amd64 | |
| path: "*.zip" | |
| # ── Step 4: Smoke test every binary ────────────────────────── | |
| smoke-unix: | |
| needs: [build-unix] | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| goos: linux | |
| goarch: amd64 | |
| - os: ubuntu-24.04-arm | |
| goos: linux | |
| goarch: arm64 | |
| - os: macos-14 | |
| goos: darwin | |
| goarch: arm64 | |
| - os: macos-15-intel | |
| goos: darwin | |
| goarch: amd64 | |
| variant: [standard, ui] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: binaries-${{ matrix.goos }}-${{ matrix.goarch }} | |
| - name: Extract binary | |
| run: | | |
| SUFFIX=${{ matrix.variant == 'ui' && '-ui' || '' }} | |
| tar -xzf codebase-memory-mcp${SUFFIX}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz | |
| chmod +x codebase-memory-mcp | |
| - name: Smoke test (${{ matrix.variant }}, ${{ matrix.goos }}-${{ matrix.goarch }}) | |
| run: scripts/smoke-test.sh ./codebase-memory-mcp | |
| smoke-windows: | |
| needs: [build-windows] | |
| strategy: | |
| matrix: | |
| variant: [standard, ui] | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: UCRT64 | |
| path-type: inherit | |
| install: >- | |
| mingw-w64-ucrt-x86_64-python3 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: binaries-windows-amd64 | |
| - name: Extract binary | |
| shell: pwsh | |
| run: | | |
| $suffix = if ("${{ matrix.variant }}" -eq "ui") { "-ui" } else { "" } | |
| Expand-Archive -Path "codebase-memory-mcp${suffix}-windows-amd64.zip" -DestinationPath . | |
| - name: Smoke test (${{ matrix.variant }}, windows-amd64) | |
| shell: msys2 {0} | |
| run: scripts/smoke-test.sh ./codebase-memory-mcp.exe |