@@ -7,6 +7,7 @@ permissions:
77 contents : read
88
99jobs :
10+ # ── Step 1: Lint ──────────────────────────────────────────────
1011 lint :
1112 runs-on : ubuntu-latest
1213 steps :
3031 - name : clang-tidy
3132 run : make -f Makefile.cbm lint-tidy
3233
34+ # ── Step 2: Unit tests (ASan + UBSan) ────────────────────────
3335 test :
36+ needs : [lint]
3437 strategy :
3538 matrix :
3639 include :
5356 - name : Run C tests (ASan + UBSan)
5457 run : make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm test
5558
59+ # ── Step 3: Build binaries (standard + UI, all OS) ───────────
5660 build-unix :
57- needs : [lint, test]
61+ needs : [test]
5862 strategy :
5963 matrix :
6064 include :
7074 - os : macos-15-intel
7175 goos : darwin
7276 goarch : amd64
73- variant : [standard, ui]
7477 runs-on : ${{ matrix.os }}
7578 steps :
7679 - uses : actions/checkout@v4
@@ -79,38 +82,33 @@ jobs:
7982 if : startsWith(matrix.os, 'ubuntu')
8083 run : sudo apt-get update && sudo apt-get install -y libsqlite3-dev zlib1g-dev
8184
82- - name : Build standard binary
83- if : matrix.variant == 'standard'
84- run : make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm
85-
8685 - uses : actions/setup-node@v4
87- if : matrix.variant == 'ui'
8886 with :
8987 node-version : " 22"
9088
89+ - name : Build standard binary
90+ run : make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm
91+
92+ - name : Archive standard binary
93+ run : |
94+ tar -czf codebase-memory-mcp-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz \
95+ -C build/c codebase-memory-mcp
96+
9197 - name : Build UI binary
92- if : matrix.variant == 'ui'
9398 run : make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm-with-ui
9499
95- - name : Smoke test
96- run : scripts/smoke-test.sh ./build/c/codebase-memory-mcp
97-
98- - name : Archive binary
100+ - name : Archive UI binary
99101 run : |
100- SUFFIX=${{ matrix.variant == 'ui' && '-ui' || '' }}
101- tar -czf codebase-memory-mcp${SUFFIX}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz \
102+ tar -czf codebase-memory-mcp-ui-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz \
102103 -C build/c codebase-memory-mcp
103104
104105 - uses : actions/upload-artifact@v4
105106 with :
106- name : ${{ matrix.variant }} -${{ matrix.goos }}-${{ matrix.goarch }}
107+ name : binaries -${{ matrix.goos }}-${{ matrix.goarch }}
107108 path : " *.tar.gz"
108109
109110 build-windows :
110- needs : [lint, test]
111- strategy :
112- matrix :
113- variant : [standard, ui]
111+ needs : [test]
114112 runs-on : windows-latest
115113 steps :
116114 - uses : actions/checkout@v4
@@ -123,36 +121,99 @@ jobs:
123121 mingw-w64-ucrt-x86_64-gcc
124122 mingw-w64-ucrt-x86_64-sqlite3
125123 mingw-w64-ucrt-x86_64-zlib
126- mingw-w64-ucrt-x86_64-python3
127124 make
128125
126+ - uses : actions/setup-node@v4
127+ with :
128+ node-version : " 22"
129+
129130 - name : Build standard binary
130- if : matrix.variant == 'standard'
131131 shell : msys2 {0}
132132 run : make -j$(nproc) -f Makefile.cbm cbm
133133
134- - uses : actions/setup-node@v4
135- if : matrix.variant == 'ui'
136- with :
137- node-version : " 22"
134+ - name : Archive standard binary
135+ shell : pwsh
136+ run : |
137+ Copy-Item build/c/codebase-memory-mcp -Destination codebase-memory-mcp.exe
138+ Compress-Archive -Path codebase-memory-mcp.exe -DestinationPath codebase-memory-mcp-windows-amd64.zip
138139
139140 - name : Build UI binary
140- if : matrix.variant == 'ui'
141141 shell : msys2 {0}
142142 run : make -j$(nproc) -f Makefile.cbm cbm-with-ui
143143
144- - name : Smoke test
145- shell : msys2 {0}
146- run : scripts/smoke-test.sh ./build/c/codebase-memory-mcp
147-
148- - name : Archive binary
144+ - name : Archive UI binary
149145 shell : pwsh
150146 run : |
151- $suffix = if ("${{ matrix.variant }}" -eq "ui") { "-ui" } else { "" }
152- Copy-Item build/c/codebase-memory-mcp -Destination codebase-memory-mcp.exe
153- Compress-Archive -Path codebase-memory-mcp.exe -DestinationPath "codebase-memory-mcp${suffix}-windows-amd64.zip"
147+ Copy-Item build/c/codebase-memory-mcp -Destination codebase-memory-mcp-ui.exe -Force
148+ Compress-Archive -Path codebase-memory-mcp-ui.exe -DestinationPath codebase-memory-mcp-ui-windows-amd64.zip
154149
155150 - uses : actions/upload-artifact@v4
156151 with :
157- name : ${{ matrix.variant }} -windows-amd64
152+ name : binaries -windows-amd64
158153 path : " *.zip"
154+
155+ # ── Step 4: Smoke test every binary ──────────────────────────
156+ smoke-unix :
157+ needs : [build-unix]
158+ strategy :
159+ matrix :
160+ include :
161+ - os : ubuntu-latest
162+ goos : linux
163+ goarch : amd64
164+ - os : ubuntu-24.04-arm
165+ goos : linux
166+ goarch : arm64
167+ - os : macos-14
168+ goos : darwin
169+ goarch : arm64
170+ - os : macos-15-intel
171+ goos : darwin
172+ goarch : amd64
173+ variant : [standard, ui]
174+ runs-on : ${{ matrix.os }}
175+ steps :
176+ - uses : actions/checkout@v4
177+
178+ - uses : actions/download-artifact@v4
179+ with :
180+ name : binaries-${{ matrix.goos }}-${{ matrix.goarch }}
181+
182+ - name : Extract binary
183+ run : |
184+ SUFFIX=${{ matrix.variant == 'ui' && '-ui' || '' }}
185+ tar -xzf codebase-memory-mcp${SUFFIX}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
186+ chmod +x codebase-memory-mcp
187+
188+ - name : Smoke test (${{ matrix.variant }}, ${{ matrix.goos }}-${{ matrix.goarch }})
189+ run : scripts/smoke-test.sh ./codebase-memory-mcp
190+
191+ smoke-windows :
192+ needs : [build-windows]
193+ strategy :
194+ matrix :
195+ variant : [standard, ui]
196+ runs-on : windows-latest
197+ steps :
198+ - uses : actions/checkout@v4
199+
200+ - uses : msys2/setup-msys2@v2
201+ with :
202+ msystem : UCRT64
203+ path-type : inherit
204+ install : >-
205+ mingw-w64-ucrt-x86_64-python3
206+
207+ - uses : actions/download-artifact@v4
208+ with :
209+ name : binaries-windows-amd64
210+
211+ - name : Extract binary
212+ shell : pwsh
213+ run : |
214+ $suffix = if ("${{ matrix.variant }}" -eq "ui") { "-ui" } else { "" }
215+ Expand-Archive -Path "codebase-memory-mcp${suffix}-windows-amd64.zip" -DestinationPath .
216+
217+ - name : Smoke test (${{ matrix.variant }}, windows-amd64)
218+ shell : msys2 {0}
219+ run : scripts/smoke-test.sh ./codebase-memory-mcp.exe
0 commit comments