-
Notifications
You must be signed in to change notification settings - Fork 515
368 lines (309 loc) · 16.1 KB
/
Copy pathci.yml
File metadata and controls
368 lines (309 loc) · 16.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
name: CI
on:
workflow_call:
push:
branches: [main]
# Run on every pull request regardless of base branch so stacked PRs that
# target another feature branch (not just main) still get the full test,
# lint, and e2e suite. The expensive desktop/tauri bundle builds are gated
# to main separately in desktop-artifacts.yml.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
runs-on: ${{ github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache: ${{ github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'false' || 'true' }}
- name: Install lint tools
run: |
make lint-tools
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: Run Go linters
run: make lint-ci
frontend:
runs-on: ${{ github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "24"
- name: Install frontend dependencies
run: npm ci
working-directory: frontend
- name: Type-check (svelte-check)
run: npm run check
working-directory: frontend
- name: Design-system conformance (kit-ui-check)
# Full rule set over all of src; legitimate exceptions carry inline
# kit-ui-check-ignore markers with reasons (e.g. the app token
# definitions in app.css).
run: npm run check:kit-ui
working-directory: frontend
- name: Run frontend tests
run: npm test
working-directory: frontend
frontend-node-25:
runs-on: ${{ github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "25"
- name: Install frontend dependencies
run: npm ci
working-directory: frontend
- name: Run frontend tests
run: npm test
working-directory: frontend
docs:
runs-on: ${{ github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: "3.14"
- name: Set up uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- name: Install docs check tools
run: |
sudo apt-get update
sudo apt-get install -y ripgrep
- name: Run docs check
run: make docs-check
scripts:
runs-on: ${{ github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Run shell script tests
run: |
bash scripts/install_test.sh
bash scripts/retry_test.sh
bash scripts/check_desktop_release_health_test.sh
bash scripts/check_desktop_release_health_from_event_test.sh
bash desktop/scripts/test-repair-appimage-diricon.sh
test:
name: Go Test (${{ matrix.os }})
runs-on: ${{ contains(fromJSON('["ubuntu-latest","ubuntu-24.04","ubuntu-22.04"]'), matrix.os) && github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache: ${{ contains(fromJSON('["ubuntu-latest","ubuntu-24.04","ubuntu-22.04"]'), matrix.os) && github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'false' || 'true' }}
- name: Setup MinGW (Windows)
if: runner.os == 'Windows'
id: setup_mingw
continue-on-error: true
uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2
with:
msystem: MINGW64
update: false
install: mingw-w64-x86_64-gcc
path-type: inherit
- name: Setup MinGW (Windows, retry on transient failure)
if: runner.os == 'Windows' && steps.setup_mingw.outcome == 'failure'
uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2
with:
msystem: MINGW64
update: false
install: mingw-w64-x86_64-gcc
path-type: inherit
- name: Restore pricing snapshot
run: go run ./internal/pricing/cmd/litellm-snapshot -restore
- name: Run Go tests
run: go test -tags "fts5" ./... -v -count=1 -timeout=20m
env:
CGO_ENABLED: "1"
- name: Run eval-ingest build-tag tests
if: runner.os == 'Linux'
run: make test-evalingest
- name: Run Go tests (race detector)
if: runner.os == 'Linux'
run: |
go test -tags "fts5" ./internal/duckdb -count=1
go test -tags "fts5" -race $(go list ./... | grep -v '/internal/duckdb$') -count=1
env:
CGO_ENABLED: "1"
desktop-windows-unit:
name: Desktop Unit Tests (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Prepare placeholder sidecar resource
shell: pwsh
run: |
$hostTriple = (rustc -vV | Select-String '^host: ').ToString() -replace '^host:\s+', ''
if (-not $hostTriple) {
throw "could not determine Rust host triple"
}
New-Item -ItemType Directory -Force desktop/src-tauri/binaries | Out-Null
New-Item -ItemType File -Force "desktop/src-tauri/binaries/agentsview-$hostTriple.exe" | Out-Null
- name: Fetch Windows desktop Rust dependencies
shell: pwsh
run: |
for ($attempt = 1; $attempt -le 3; $attempt++) {
cargo fetch --locked --manifest-path desktop/src-tauri/Cargo.toml
if ($LASTEXITCODE -eq 0) {
break
}
if ($attempt -eq 3) {
exit $LASTEXITCODE
}
Start-Sleep -Seconds (10 * $attempt)
}
- name: Run Windows desktop update tests
run: cargo test --locked --manifest-path desktop/src-tauri/Cargo.toml --lib install_downloaded_update
coverage:
runs-on: ${{ github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache: ${{ github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'false' || 'true' }}
- name: Restore pricing snapshot
run: go run ./internal/pricing/cmd/litellm-snapshot -restore
- name: Test with coverage
run: go test -tags "fts5" -coverprofile=coverage.out ./...
env:
CGO_ENABLED: "1"
- name: Upload coverage
id: codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
files: coverage.out
continue-on-error: true
- name: Warn on coverage upload failure
if: steps.codecov.outcome == 'failure'
run: echo "::warning::Codecov upload failed"
integration:
runs-on: ${{ github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || 'ubuntu-latest' }}
services:
postgres:
image: pgvector/pgvector:pg18
env:
POSTGRES_USER: agentsview_test
POSTGRES_PASSWORD: agentsview_test_password
POSTGRES_DB: agentsview_test
ports:
- 5433:5432
options: >-
--health-cmd "pg_isready -U agentsview_test -d agentsview_test"
--health-interval 2s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache: ${{ github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'false' || 'true' }}
- name: Restore pricing snapshot
run: go run ./internal/pricing/cmd/litellm-snapshot -restore
- name: Run PostgreSQL integration tests
run: make test-postgres-ci
env:
CGO_ENABLED: "1"
TEST_PG_URL: postgres://agentsview_test:agentsview_test_password@localhost:5433/agentsview_test?sslmode=disable
- name: Build SSH test container
run: bash scripts/retry.sh 3 10 docker build -t agentsview-sshd -f testdata/ssh/Dockerfile .
- name: Start SSH test container
run: |
docker run -d --name sshd-test -p 2222:22 agentsview-sshd
for i in $(seq 1 10); do nc -z localhost 2222 && break || sleep 1; done
docker cp sshd-test:/tmp/test_ssh_key testdata/ssh/test_key
chmod 600 testdata/ssh/test_key
- name: Verify SSH connectivity
run: |
echo "=== Key file ==="
ls -la testdata/ssh/test_key
head -1 testdata/ssh/test_key
echo "=== Container sshd_config ==="
docker exec sshd-test cat /etc/ssh/sshd_config
echo "=== Container authorized_keys ==="
docker exec sshd-test cat /home/testuser/.ssh/authorized_keys
echo "=== Test SSH connection ==="
ssh -v -i testdata/ssh/test_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 2222 testuser@localhost echo "SSH works" 2>&1 || true
- name: Run SSH integration tests
run: make test-ssh-ci
env:
CGO_ENABLED: "1"
TEST_SSH_HOST: localhost
TEST_SSH_PORT: "2222"
TEST_SSH_USER: testuser
TEST_SSH_KEY: ${{ github.workspace }}/testdata/ssh/test_key
e2e:
runs-on: ${{ github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache: ${{ github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'false' || 'true' }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "24"
- name: Install frontend dependencies
run: npm ci
working-directory: frontend
- name: Build frontend
run: npm run build
working-directory: frontend
- name: Embed frontend in Go source tree
run: |
rm -rf internal/web/dist
cp -r frontend/dist internal/web/dist
- name: Restore pricing snapshot
run: go run ./internal/pricing/cmd/litellm-snapshot -restore
- name: Pre-build Go binaries
run: |
CGO_ENABLED=1 go build -tags "fts5,kit_posthog_disabled" \
-o /tmp/testfixture ./cmd/testfixture
CGO_ENABLED=1 go build -tags "fts5,kit_posthog_disabled" \
-o /tmp/agentsview ./cmd/agentsview
env:
CGO_ENABLED: "1"
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium webkit
working-directory: frontend
- name: Run E2E tests
run: npx playwright test --reporter=list
working-directory: frontend
env:
E2E_PREBUILT_FIXTURE: /tmp/testfixture
E2E_PREBUILT_SERVER: /tmp/agentsview