forked from getomnico/omni
-
Notifications
You must be signed in to change notification settings - Fork 1
658 lines (620 loc) · 23.3 KB
/
Copy pathci.yml
File metadata and controls
658 lines (620 loc) · 23.3 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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
name: CI
on:
push:
branches: [main, master]
tags: ['v*']
pull_request:
branches: [main, master]
permissions:
contents: write
packages: write
jobs:
# ---------------------------------------------------------------------------
# Change detection
# ---------------------------------------------------------------------------
detect-changes:
runs-on: ubuntu-latest
outputs:
is-tag: ${{ steps.check-tag.outputs.is-tag }}
ai: ${{ steps.filter.outputs.ai }}
web: ${{ steps.filter.outputs.web }}
searcher: ${{ steps.filter.outputs.searcher }}
indexer: ${{ steps.filter.outputs.indexer }}
connector-manager: ${{ steps.filter.outputs.connector-manager }}
sandbox: ${{ steps.filter.outputs.sandbox }}
migrator: ${{ steps.filter.outputs.migrator }}
google-connector: ${{ steps.filter.outputs.google-connector }}
slack-connector: ${{ steps.filter.outputs.slack-connector }}
atlassian-connector: ${{ steps.filter.outputs.atlassian-connector }}
github-connector: ${{ steps.filter.outputs.github-connector }}
microsoft-connector: ${{ steps.filter.outputs.microsoft-connector }}
filesystem-connector: ${{ steps.filter.outputs.filesystem-connector }}
fireflies-connector: ${{ steps.filter.outputs.fireflies-connector }}
darwinbox-connector: ${{ steps.filter.outputs.darwinbox-connector }}
hubspot-connector: ${{ steps.filter.outputs.hubspot-connector }}
google-ads-connector: ${{ steps.filter.outputs.google-ads-connector }}
imap-connector: ${{ steps.filter.outputs.imap-connector }}
notion-connector: ${{ steps.filter.outputs.notion-connector }}
web-connector: ${{ steps.filter.outputs.web-connector }}
clickup-connector: ${{ steps.filter.outputs.clickup-connector }}
linear-connector: ${{ steps.filter.outputs.linear-connector }}
nextcloud-connector: ${{ steps.filter.outputs.nextcloud-connector }}
paperless-connector: ${{ steps.filter.outputs.paperless-connector }}
docling: ${{ steps.filter.outputs.docling }}
deployment: ${{ steps.filter.outputs.deployment }}
cli: ${{ steps.filter.outputs.cli }}
steps:
- uses: actions/checkout@v6
- name: Check if tag push
id: check-tag
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "is-tag=true" >> "$GITHUB_OUTPUT"
else
echo "is-tag=false" >> "$GITHUB_OUTPUT"
fi
- name: Detect changed paths
if: steps.check-tag.outputs.is-tag != 'true'
id: filter
uses: dorny/paths-filter@v4
with:
filters: |
ai:
- 'services/ai/**'
- '.github/workflows/ci.yml'
- '.github/workflows/build-service.yml'
web:
- 'web/**'
- '.github/workflows/ci.yml'
- '.github/workflows/build-service.yml'
searcher:
- 'services/searcher/**'
- 'shared/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
- '.github/workflows/build-service.yml'
indexer:
- 'services/indexer/**'
- 'shared/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
- '.github/workflows/build-service.yml'
connector-manager:
- 'services/connector-manager/**'
- 'shared/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
- '.github/workflows/build-service.yml'
sandbox:
- 'services/sandbox/**'
- 'shared/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
- '.github/workflows/build-service.yml'
docling:
- 'services/docling/**'
- '.github/workflows/ci.yml'
- '.github/workflows/build-service.yml'
migrator:
- 'services/migrations/**'
- '.github/workflows/ci.yml'
- '.github/workflows/build-service.yml'
google-connector:
- 'connectors/google/**'
- 'sdk/rust/**'
- 'shared/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
slack-connector:
- 'connectors/slack/**'
- 'sdk/rust/**'
- 'shared/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
atlassian-connector:
- 'connectors/atlassian/**'
- 'sdk/rust/**'
- 'shared/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
filesystem-connector:
- 'connectors/filesystem/**'
- 'sdk/rust/**'
- 'shared/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
fireflies-connector:
- 'connectors/fireflies/**'
- 'sdk/rust/**'
- 'shared/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
darwinbox-connector:
- 'connectors/darwinbox/**'
- 'sdk/rust/**'
- 'shared/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
imap-connector:
- 'connectors/imap/**'
- 'sdk/rust/**'
- 'shared/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
web-connector:
- 'connectors/web/**'
- 'sdk/rust/**'
- 'shared/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
github-connector:
- 'connectors/github/**'
- 'sdk/python/**'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
hubspot-connector:
- 'connectors/hubspot/**'
- 'sdk/python/**'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
microsoft-connector:
- 'connectors/microsoft/**'
- 'sdk/python/**'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
google-ads-connector:
- 'connectors/google_ads/**'
- 'sdk/python/**'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
notion-connector:
- 'connectors/notion/**'
- 'sdk/python/**'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
clickup-connector:
- 'connectors/clickup/**'
- 'sdk/python/**'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
linear-connector:
- 'connectors/linear/**'
- 'sdk/typescript/**'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
nextcloud-connector:
- 'connectors/nextcloud/**'
- 'sdk/rust/**'
- 'shared/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
paperless-connector:
- 'connectors/paperless/**'
- 'sdk/python/**'
- '.github/workflows/ci.yml'
- '.github/workflows/build-connector.yml'
deployment:
- 'docker/docker-compose.yml'
- 'docker/docker-compose.gpu.yml'
- '.env.example'
- 'Caddyfile'
- 'infra/**'
- '.github/workflows/ci.yml'
- '.github/workflows/package-deployment.yml'
cli:
- 'cli/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
- '.github/workflows/build-cli.yml'
# ---------------------------------------------------------------------------
# Core services
# ---------------------------------------------------------------------------
build-ai:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.ai == 'true'
uses: ./.github/workflows/build-service.yml
with:
image-name: omni-ai
docker-context: services/ai
dockerfile: services/ai/Dockerfile
free-disk-space: true
secrets: inherit
build-web:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.web == 'true'
uses: ./.github/workflows/build-service.yml
with:
image-name: omni-web
docker-context: web
dockerfile: web/Dockerfile
secrets: inherit
build-searcher:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.searcher == 'true'
uses: ./.github/workflows/build-service.yml
with:
image-name: omni-searcher
docker-context: .
dockerfile: services/searcher/Dockerfile
secrets: inherit
build-indexer:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.indexer == 'true'
uses: ./.github/workflows/build-service.yml
with:
image-name: omni-indexer
docker-context: .
dockerfile: services/indexer/Dockerfile
secrets: inherit
build-connector-manager:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.connector-manager == 'true'
uses: ./.github/workflows/build-service.yml
with:
image-name: omni-connector-manager
docker-context: .
dockerfile: services/connector-manager/Dockerfile
secrets: inherit
build-sandbox:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.sandbox == 'true'
uses: ./.github/workflows/build-service.yml
with:
image-name: omni-sandbox
docker-context: .
dockerfile: services/sandbox/Dockerfile
secrets: inherit
build-docling:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.docling == 'true'
uses: ./.github/workflows/build-service.yml
with:
image-name: omni-docling
docker-context: services/docling
dockerfile: services/docling/Dockerfile
build-args: DEVICE=cpu
free-disk-space: true
secrets: inherit
build-docling-cuda:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.docling == 'true'
uses: ./.github/workflows/build-service.yml
with:
image-name: omni-docling
docker-context: services/docling
dockerfile: services/docling/Dockerfile
build-args: DEVICE=cuda
tag-suffix: -cuda
free-disk-space: true
secrets: inherit
check-migrations:
needs: detect-changes
if: needs.detect-changes.outputs.migrator == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify migration numbering is sequential
run: |
cd services/migrations
# Extract numeric prefixes, sort numerically, and verify no gaps or duplicates
numbers=$(ls *.sql 2>/dev/null | grep -oP '^\d+' | sort -n)
if [ -z "$numbers" ]; then
echo "ERROR: No migration files found"
exit 1
fi
prev=0
while IFS= read -r num_raw; do
# Strip leading zeros for arithmetic
num=$((10#$num_raw))
expected=$((prev + 1))
if [ "$num" -ne "$expected" ]; then
echo "ERROR: Migration numbering is not sequential."
echo " Expected migration number: $expected (after $prev)"
echo " Found: $num_raw"
echo ""
if [ "$num" -eq "$prev" ]; then
echo "Duplicate migration number detected."
else
echo "Gap in migration numbers detected."
fi
echo "This usually means two PRs used the same migration number."
echo "Please renumber your migration and try again."
exit 1
fi
prev=$num
done <<< "$numbers"
echo "All $prev migrations are in sequential order."
build-migrator:
needs: [detect-changes, check-migrations]
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.migrator == 'true'
uses: ./.github/workflows/build-service.yml
with:
image-name: omni-migrator
docker-context: .
dockerfile: services/migrations/Dockerfile
secrets: inherit
# ---------------------------------------------------------------------------
# Connectors (Rust)
# ---------------------------------------------------------------------------
build-google-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.google-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: google
connector-type: rust
secrets: inherit
build-slack-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.slack-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: slack
connector-type: rust
secrets: inherit
build-atlassian-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.atlassian-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: atlassian
connector-type: rust
secrets: inherit
build-filesystem-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.filesystem-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: filesystem
connector-type: rust
secrets: inherit
build-fireflies-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.fireflies-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: fireflies
connector-type: rust
secrets: inherit
build-darwinbox-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.darwinbox-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: darwinbox
connector-type: rust
secrets: inherit
build-imap-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.imap-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: imap
connector-type: rust
secrets: inherit
build-web-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.web-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: web
connector-type: rust
secrets: inherit
build-nextcloud-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.nextcloud-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: nextcloud
connector-type: rust
secrets: inherit
# ---------------------------------------------------------------------------
# Connectors (Python)
# ---------------------------------------------------------------------------
build-github-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.github-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: github
connector-type: python
secrets: inherit
build-hubspot-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.hubspot-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: hubspot
connector-type: python
secrets: inherit
build-google-ads-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.google-ads-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: google_ads
connector-type: python
secrets: inherit
build-microsoft-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.microsoft-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: microsoft
connector-type: python
secrets: inherit
build-notion-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.notion-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: notion
connector-type: python
secrets: inherit
build-clickup-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.clickup-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: clickup
connector-type: python
secrets: inherit
build-paperless-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.paperless-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: paperless
connector-type: python
secrets: inherit
build-linear-connector:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag != 'true' && needs.detect-changes.outputs.linear-connector == 'true'
uses: ./.github/workflows/build-connector.yml
with:
connector-name: linear
connector-type: typescript
secrets: inherit
# ---------------------------------------------------------------------------
# Release: build all images from scratch on tag push
# ---------------------------------------------------------------------------
release-services:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag == 'true'
strategy:
fail-fast: false
matrix:
include:
- image-name: omni-ai
docker-context: services/ai
dockerfile: services/ai/Dockerfile
free-disk-space: true
- image-name: omni-web
docker-context: web
dockerfile: web/Dockerfile
free-disk-space: false
- image-name: omni-searcher
docker-context: .
dockerfile: services/searcher/Dockerfile
free-disk-space: false
- image-name: omni-indexer
docker-context: .
dockerfile: services/indexer/Dockerfile
free-disk-space: false
- image-name: omni-connector-manager
docker-context: .
dockerfile: services/connector-manager/Dockerfile
free-disk-space: false
- image-name: omni-sandbox
docker-context: .
dockerfile: services/sandbox/Dockerfile
free-disk-space: false
- image-name: omni-docling
docker-context: services/docling
dockerfile: services/docling/Dockerfile
build-args: DEVICE=cpu
free-disk-space: true
- image-name: omni-docling
docker-context: services/docling
dockerfile: services/docling/Dockerfile
build-args: DEVICE=cuda
tag-suffix: -cuda
free-disk-space: true
- image-name: omni-migrator
docker-context: .
dockerfile: services/migrations/Dockerfile
free-disk-space: false
uses: ./.github/workflows/build-service.yml
with:
image-name: ${{ matrix.image-name }}
docker-context: ${{ matrix.docker-context }}
dockerfile: ${{ matrix.dockerfile }}
free-disk-space: ${{ matrix.free-disk-space }}
build-args: ${{ matrix.build-args }}
tag-suffix: ${{ matrix.tag-suffix }}
secrets: inherit
release-connectors:
needs: detect-changes
if: needs.detect-changes.outputs.is-tag == 'true'
strategy:
fail-fast: false
matrix:
include:
- connector-name: google
connector-type: rust
- connector-name: slack
connector-type: rust
- connector-name: atlassian
connector-type: rust
- connector-name: filesystem
connector-type: rust
- connector-name: fireflies
connector-type: rust
- connector-name: darwinbox
connector-type: rust
- connector-name: imap
connector-type: rust
- connector-name: web
connector-type: rust
- connector-name: nextcloud
connector-type: rust
- connector-name: github
connector-type: python
- connector-name: hubspot
connector-type: python
- connector-name: microsoft
connector-type: python
- connector-name: google_ads
connector-type: python
- connector-name: notion
connector-type: python
- connector-name: clickup
connector-type: python
- connector-name: paperless
connector-type: python
- connector-name: linear
connector-type: typescript
uses: ./.github/workflows/build-connector.yml
with:
connector-name: ${{ matrix.connector-name }}
connector-type: ${{ matrix.connector-type }}
secrets: inherit
build-cli:
needs: detect-changes
if: >
needs.detect-changes.outputs.is-tag == 'true' ||
needs.detect-changes.outputs.cli == 'true'
uses: ./.github/workflows/build-cli.yml
# ---------------------------------------------------------------------------
# Deployment packaging
# ---------------------------------------------------------------------------
package-deployment:
needs: detect-changes
if: >
github.event_name != 'pull_request' &&
(needs.detect-changes.outputs.is-tag == 'true' || needs.detect-changes.outputs.deployment == 'true')
uses: ./.github/workflows/package-deployment.yml
secrets: inherit