Repository navigation
594 lines (578 loc) · 26.8 KB
/
Copy pathci.yml
File metadata and controls
594 lines (578 loc) · 26.8 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
name: CI
on:
push:
branches: [dev, main]
paths-ignore: ['v2/**', '.github/workflows/check.yml']
pull_request:
branches: [dev, main]
paths-ignore: ['v2/**', '.github/workflows/check.yml']
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
defaults:
run:
shell: bash
env:
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_PROFILE_TEST_DEBUG: 0
CARGO_TERM_COLOR: always
RUSTFLAGS: ""
CARGO_INCREMENTAL: 0
CI_GATE_MODE: normal
NORMAL_CLEANUP_MIN_FREE_BYTES: "85899345920"
jobs:
impact:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
integration_required: ${{ steps.classify.outputs.integration_required }}
impact_reason: ${{ steps.classify.outputs.impact_reason }}
path_classes_artifact: ci-impact-${{ github.run_id }}-${{ github.run_attempt }}
performance_qualification: ${{ steps.classify.outputs.performance_qualification }}
integration_matrix: ${{ steps.plan.outputs.matrix }}
combined_matrix: ${{ steps.plan.outputs.combined_matrix }}
bundle_matrix: ${{ steps.plan.outputs.bundle_matrix }}
build_matrix: ${{ steps.plan.outputs.build_matrix }}
enabled: ${{ steps.plan.outputs.enabled }}
run_default: ${{ steps.plan.outputs.run_default }}
gate_mode: ${{ steps.plan.outputs.gate_mode }}
dedup_sha: ${{ steps.plan.outputs.dedup_sha }}
dedup_reason: ${{ steps.plan.outputs.dedup_reason }}
source_sha: ${{ steps.plan.outputs.source_sha }}
source_fingerprint: ${{ steps.plan.outputs.source_fingerprint }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
- name: Require complete workspace test inventory
run: python3 scripts/ci-inventory.py
- id: classify
run: python3 scripts/ci-impact.py
- id: plan
env:
CI_INTEGRATION_ENABLED: ${{ steps.classify.outputs.integration_required }}
CI_INTEGRATION_DEFAULT: "false"
IMPACT_REASON: ${{ steps.classify.outputs.impact_reason }}
PATH_CLASSES_FILE: ${{ steps.classify.outputs.path_classes_file }}
PERFORMANCE_QUALIFICATION: ${{ steps.classify.outputs.performance_qualification }}
run: python3 -B scripts/ci-integration.py plan
- name: Save complete path classifications
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ci-impact-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ steps.classify.outputs.path_classes_file }}
if-no-files-found: error
retention-days: 14
integration:
needs: [impact, test-bundles]
if: always()
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Validate published normal plan and execution
env:
CI_INTEGRATION_ENABLED: ${{ needs.impact.outputs.enabled }}
CI_INTEGRATION_DEFAULT: ${{ needs.impact.outputs.run_default }}
CI_INTEGRATION_NEEDS_FILE: ${{ runner.temp }}/integration-needs.json
CI_COMBINED_MATRIX_FILE: ${{ runner.temp }}/combined-matrix.json
CI_BUNDLE_MATRIX_FILE: ${{ runner.temp }}/bundle-matrix.json
CI_BUILD_MATRIX_FILE: ${{ runner.temp }}/build-matrix.json
DEDUP_SHA: ${{ needs.impact.outputs.dedup_sha }}
DEDUP_REASON: ${{ needs.impact.outputs.dedup_reason }}
SOURCE_SHA: ${{ needs.impact.outputs.source_sha }}
SOURCE_FINGERPRINT: ${{ needs.impact.outputs.source_fingerprint }}
GATE_MODE: ${{ needs.impact.outputs.gate_mode }}
RUN_DEFAULT: ${{ needs.impact.outputs.run_default }}
# The values reach the script text, not the environment: about seventy jobs overflow one environment string.
run: |
cat > "$CI_INTEGRATION_NEEDS_FILE" <<'CI_JSON_END'
${{ toJSON(needs) }}
CI_JSON_END
cat > "$CI_COMBINED_MATRIX_FILE" <<'CI_JSON_END'
${{ needs.impact.outputs.combined_matrix }}
CI_JSON_END
cat > "$CI_BUNDLE_MATRIX_FILE" <<'CI_JSON_END'
${{ needs.impact.outputs.bundle_matrix }}
CI_JSON_END
cat > "$CI_BUILD_MATRIX_FILE" <<'CI_JSON_END'
${{ needs.impact.outputs.build_matrix }}
CI_JSON_END
python3 -B scripts/ci-integration.py normal-required
lint:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Install lint script tools
run: bash scripts/ci-install-ripgrep.sh
- name: Offline CI script controls
run: |
python3 -B scripts/ci-build-tests.py
python3 -B scripts/ci-required-tests.py
python3 -B scripts/ci-inventory-tests.py
python3 -B scripts/ci-acceptance-partition-tests.py
python3 -B scripts/ci-integration-tests.py
python3 -B scripts/ci-aggregate-routing-tests.py
python3 -B scripts/ci-routing-tests.py
python3 -B scripts/ci-routing-tests.py --dedup-only
python3 -B scripts/ci-routing-tests.py --plan-only
python3 -B scripts/ci-cache-post-cleanup-tests.py
bash scripts/ci-free-disk-tests.sh
- name: Free disk space
run: bash scripts/ci-free-disk.sh
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
with:
cache: false
rustflags: ""
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
key: lint-debug0-jobs2
- run: bash scripts/verify pr lint
lint-macos:
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
with:
cache: false
rustflags: ""
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
key: lint-macos-debug0-jobs2
- run: bash scripts/verify pr lint
test-builds:
name: ${{ matrix.name }}
needs: impact
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.impact.outputs.build_matrix) }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Free disk space
run: bash scripts/ci-free-disk.sh
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
with:
cache: false
rustflags: ""
- name: Stamp tracked sources
run: bash scripts/ci-shared-build.sh stamp
- name: Compile the shared build
run: python3 -B scripts/ci-integration.py build-run "${{ matrix.build }}"
- name: Pack the compiled target
run: bash scripts/ci-shared-build.sh pack "${{ runner.temp }}/build.tar.zst"
- name: Upload the compiled target
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: build-${{ matrix.build }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
path: ${{ runner.temp }}/build.tar.zst
compression-level: 0
retention-days: 1
overwrite: true
if-no-files-found: error
test-bundles:
name: test / ${{ matrix.name }}
needs: [impact, test-builds]
if: always() && !cancelled() && needs.impact.result == 'success'
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.impact.outputs.bundle_matrix) }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Free disk space
run: bash scripts/ci-free-disk.sh
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
with:
cache: false
rustflags: ""
- name: Restore shared build for constituent 1
if: always() && !cancelled() && matrix.slot1.build != null
continue-on-error: true
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: build-${{ matrix.slot1.build }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
path: ${{ runner.temp }}/build-slot1
- name: Unpack shared build for constituent 1
if: always() && !cancelled() && matrix.slot1.build != null
continue-on-error: true
run: bash scripts/ci-shared-build.sh restore "${{ runner.temp }}/build-slot1"
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
if: always() && !cancelled() && matrix.slot1 != null && matrix.slot1.build == null
with:
key: ${{ matrix.slot1.cache_key }}
add-job-id-key: false
workspaces: |
. -> target
crates/contextdb-redb -> ../../target/redb
- name: Install test tools for constituent 1
if: always() && !cancelled() && matrix.slot1.kind == 'pr'
run: bash scripts/ci-install-ripgrep.sh
- id: slot1_pr
name: Run constituent 1 / ${{ matrix.slot1.name }}
if: always() && !cancelled() && matrix.slot1.kind == 'pr'
continue-on-error: true
env:
CI_BUNDLE: ${{ matrix.slot1.pr.constituents && matrix.slot1.pr.shard || '' }}
CI_CRATE: ${{ matrix.slot1.pr.crate }}
CI_FEATURES: ${{ matrix.slot1.pr.features }}
CI_SHARD: ${{ matrix.slot1.pr.shard }}
CI_FRAGMENT: ${{ toJSON(matrix.slot1.fragment) }}
run: bash scripts/verify pr shard
- id: slot1_integration
name: Run constituent 1 / ${{ matrix.slot1.name }}
if: always() && !cancelled() && matrix.slot1.kind == 'integration'
continue-on-error: true
env:
CI_INTEGRATION_ENABLED: ${{ needs.impact.outputs.enabled }}
CI_INTEGRATION_DEFAULT: "false"
CI_INTEGRATION_SLICE: ${{ matrix.slot1.integration.id }}
CI_INTEGRATION_PLAN: ${{ toJSON(matrix.slot1.integration) }}
CI_FRAGMENT: ${{ toJSON(matrix.slot1.fragment) }}
run: bash scripts/verify integration "${CI_INTEGRATION_SLICE}"
- name: Upload constituent 1 shard receipt
if: always() && !cancelled() && matrix.slot1.kind == 'pr'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: test-${{ matrix.slot1.pr.shard }}${{ matrix.slot1.fragment && format('-part{0}', matrix.slot1.fragment.part) || '' }}-${{ github.run_attempt }}
path: ${{ env.CARGO_TARGET_DIR || 'target' }}/ci-shard-out/
retention-days: 14
if-no-files-found: error
- name: Upload constituent 1 integration receipt
if: always() && !cancelled() && matrix.slot1.kind == 'integration'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: extended-integration-${{ matrix.slot1.integration.id }}${{ matrix.slot1.fragment && format('-part{0}', matrix.slot1.fragment.part) || '' }}-${{ github.run_id }}-${{ github.run_attempt }}
path: target/ci-integration-out/
if-no-files-found: error
retention-days: 14
- name: Restore shared build for constituent 2
if: always() && !cancelled() && matrix.slot2.build != null
continue-on-error: true
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: build-${{ matrix.slot2.build }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
path: ${{ runner.temp }}/build-slot2
- name: Unpack shared build for constituent 2
if: always() && !cancelled() && matrix.slot2.build != null
continue-on-error: true
run: bash scripts/ci-shared-build.sh restore "${{ runner.temp }}/build-slot2"
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
if: always() && !cancelled() && matrix.slot2 != null && matrix.slot2.build == null
with:
key: ${{ matrix.slot2.cache_key }}
add-job-id-key: false
workspaces: |
. -> target
crates/contextdb-redb -> ../../target/redb
- name: Install test tools for constituent 2
if: always() && !cancelled() && matrix.slot2.kind == 'pr'
run: bash scripts/ci-install-ripgrep.sh
- id: slot2_pr
name: Run constituent 2 / ${{ matrix.slot2.name }}
if: always() && !cancelled() && matrix.slot2.kind == 'pr'
continue-on-error: true
env:
CI_BUNDLE: ${{ matrix.slot2.pr.constituents && matrix.slot2.pr.shard || '' }}
CI_CRATE: ${{ matrix.slot2.pr.crate }}
CI_FEATURES: ${{ matrix.slot2.pr.features }}
CI_SHARD: ${{ matrix.slot2.pr.shard }}
CI_FRAGMENT: ${{ toJSON(matrix.slot2.fragment) }}
run: bash scripts/verify pr shard
- id: slot2_integration
name: Run constituent 2 / ${{ matrix.slot2.name }}
if: always() && !cancelled() && matrix.slot2.kind == 'integration'
continue-on-error: true
env:
CI_INTEGRATION_ENABLED: ${{ needs.impact.outputs.enabled }}
CI_INTEGRATION_DEFAULT: "false"
CI_INTEGRATION_SLICE: ${{ matrix.slot2.integration.id }}
CI_INTEGRATION_PLAN: ${{ toJSON(matrix.slot2.integration) }}
CI_FRAGMENT: ${{ toJSON(matrix.slot2.fragment) }}
run: bash scripts/verify integration "${CI_INTEGRATION_SLICE}"
- name: Upload constituent 2 shard receipt
if: always() && !cancelled() && matrix.slot2.kind == 'pr'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: test-${{ matrix.slot2.pr.shard }}${{ matrix.slot2.fragment && format('-part{0}', matrix.slot2.fragment.part) || '' }}-${{ github.run_attempt }}
path: ${{ env.CARGO_TARGET_DIR || 'target' }}/ci-shard-out/
retention-days: 14
if-no-files-found: error
- name: Upload constituent 2 integration receipt
if: always() && !cancelled() && matrix.slot2.kind == 'integration'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: extended-integration-${{ matrix.slot2.integration.id }}${{ matrix.slot2.fragment && format('-part{0}', matrix.slot2.fragment.part) || '' }}-${{ github.run_id }}-${{ github.run_attempt }}
path: target/ci-integration-out/
if-no-files-found: error
retention-days: 14
- name: Restore shared build for constituent 3
if: always() && !cancelled() && matrix.slot3.build != null
continue-on-error: true
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: build-${{ matrix.slot3.build }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
path: ${{ runner.temp }}/build-slot3
- name: Unpack shared build for constituent 3
if: always() && !cancelled() && matrix.slot3.build != null
continue-on-error: true
run: bash scripts/ci-shared-build.sh restore "${{ runner.temp }}/build-slot3"
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
if: always() && !cancelled() && matrix.slot3 != null && matrix.slot3.build == null
with:
key: ${{ matrix.slot3.cache_key }}
add-job-id-key: false
workspaces: |
. -> target
crates/contextdb-redb -> ../../target/redb
- name: Install test tools for constituent 3
if: always() && !cancelled() && matrix.slot3.kind == 'pr'
run: bash scripts/ci-install-ripgrep.sh
- id: slot3_pr
name: Run constituent 3 / ${{ matrix.slot3.name }}
if: always() && !cancelled() && matrix.slot3.kind == 'pr'
continue-on-error: true
env:
CI_BUNDLE: ${{ matrix.slot3.pr.constituents && matrix.slot3.pr.shard || '' }}
CI_CRATE: ${{ matrix.slot3.pr.crate }}
CI_FEATURES: ${{ matrix.slot3.pr.features }}
CI_SHARD: ${{ matrix.slot3.pr.shard }}
CI_FRAGMENT: ${{ toJSON(matrix.slot3.fragment) }}
run: bash scripts/verify pr shard
- id: slot3_integration
name: Run constituent 3 / ${{ matrix.slot3.name }}
if: always() && !cancelled() && matrix.slot3.kind == 'integration'
continue-on-error: true
env:
CI_INTEGRATION_ENABLED: ${{ needs.impact.outputs.enabled }}
CI_INTEGRATION_DEFAULT: "false"
CI_INTEGRATION_SLICE: ${{ matrix.slot3.integration.id }}
CI_INTEGRATION_PLAN: ${{ toJSON(matrix.slot3.integration) }}
CI_FRAGMENT: ${{ toJSON(matrix.slot3.fragment) }}
run: bash scripts/verify integration "${CI_INTEGRATION_SLICE}"
- name: Upload constituent 3 shard receipt
if: always() && !cancelled() && matrix.slot3.kind == 'pr'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: test-${{ matrix.slot3.pr.shard }}${{ matrix.slot3.fragment && format('-part{0}', matrix.slot3.fragment.part) || '' }}-${{ github.run_attempt }}
path: ${{ env.CARGO_TARGET_DIR || 'target' }}/ci-shard-out/
retention-days: 14
if-no-files-found: error
- name: Upload constituent 3 integration receipt
if: always() && !cancelled() && matrix.slot3.kind == 'integration'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: extended-integration-${{ matrix.slot3.integration.id }}${{ matrix.slot3.fragment && format('-part{0}', matrix.slot3.fragment.part) || '' }}-${{ github.run_id }}-${{ github.run_attempt }}
path: target/ci-integration-out/
if-no-files-found: error
retention-days: 14
- name: Restore shared build for constituent 4
if: always() && !cancelled() && matrix.slot4.build != null
continue-on-error: true
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: build-${{ matrix.slot4.build }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
path: ${{ runner.temp }}/build-slot4
- name: Unpack shared build for constituent 4
if: always() && !cancelled() && matrix.slot4.build != null
continue-on-error: true
run: bash scripts/ci-shared-build.sh restore "${{ runner.temp }}/build-slot4"
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
if: always() && !cancelled() && matrix.slot4 != null && matrix.slot4.build == null
with:
key: ${{ matrix.slot4.cache_key }}
add-job-id-key: false
workspaces: |
. -> target
crates/contextdb-redb -> ../../target/redb
- name: Install test tools for constituent 4
if: always() && !cancelled() && matrix.slot4.kind == 'pr'
run: bash scripts/ci-install-ripgrep.sh
- id: slot4_pr
name: Run constituent 4 / ${{ matrix.slot4.name }}
if: always() && !cancelled() && matrix.slot4.kind == 'pr'
continue-on-error: true
env:
CI_BUNDLE: ${{ matrix.slot4.pr.constituents && matrix.slot4.pr.shard || '' }}
CI_CRATE: ${{ matrix.slot4.pr.crate }}
CI_FEATURES: ${{ matrix.slot4.pr.features }}
CI_SHARD: ${{ matrix.slot4.pr.shard }}
CI_FRAGMENT: ${{ toJSON(matrix.slot4.fragment) }}
run: bash scripts/verify pr shard
- id: slot4_integration
name: Run constituent 4 / ${{ matrix.slot4.name }}
if: always() && !cancelled() && matrix.slot4.kind == 'integration'
continue-on-error: true
env:
CI_INTEGRATION_ENABLED: ${{ needs.impact.outputs.enabled }}
CI_INTEGRATION_DEFAULT: "false"
CI_INTEGRATION_SLICE: ${{ matrix.slot4.integration.id }}
CI_INTEGRATION_PLAN: ${{ toJSON(matrix.slot4.integration) }}
CI_FRAGMENT: ${{ toJSON(matrix.slot4.fragment) }}
run: bash scripts/verify integration "${CI_INTEGRATION_SLICE}"
- name: Upload constituent 4 shard receipt
if: always() && !cancelled() && matrix.slot4.kind == 'pr'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: test-${{ matrix.slot4.pr.shard }}${{ matrix.slot4.fragment && format('-part{0}', matrix.slot4.fragment.part) || '' }}-${{ github.run_attempt }}
path: ${{ env.CARGO_TARGET_DIR || 'target' }}/ci-shard-out/
retention-days: 14
if-no-files-found: error
- name: Upload constituent 4 integration receipt
if: always() && !cancelled() && matrix.slot4.kind == 'integration'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: extended-integration-${{ matrix.slot4.integration.id }}${{ matrix.slot4.fragment && format('-part{0}', matrix.slot4.fragment.part) || '' }}-${{ github.run_id }}-${{ github.run_attempt }}
path: target/ci-integration-out/
if-no-files-found: error
retention-days: 14
- name: Record shared build reuse
if: always() && !cancelled()
run: bash scripts/ci-shared-build.sh report
- name: Require every bundled constituent to succeed
if: always()
env:
SLOT1_KIND: ${{ matrix.slot1.kind }}
SLOT1_PR: ${{ steps.slot1_pr.outcome }}
SLOT1_INTEGRATION: ${{ steps.slot1_integration.outcome }}
SLOT2_KIND: ${{ matrix.slot2.kind }}
SLOT2_PR: ${{ steps.slot2_pr.outcome }}
SLOT2_INTEGRATION: ${{ steps.slot2_integration.outcome }}
SLOT3_KIND: ${{ matrix.slot3.kind }}
SLOT3_PR: ${{ steps.slot3_pr.outcome }}
SLOT3_INTEGRATION: ${{ steps.slot3_integration.outcome }}
SLOT4_KIND: ${{ matrix.slot4.kind }}
SLOT4_PR: ${{ steps.slot4_pr.outcome }}
SLOT4_INTEGRATION: ${{ steps.slot4_integration.outcome }}
run: |
status=0
check_slot() {
local kind="$1" pr="$2" integration="$3"
if [[ -z "$kind" ]]; then
[[ "$pr" == skipped && "$integration" == skipped ]] || status=1
elif [[ "$kind" == pr ]]; then
[[ "$pr" == success && "$integration" == skipped ]] || status=1
elif [[ "$kind" == integration ]]; then
[[ "$pr" == skipped && "$integration" == success ]] || status=1
else
status=1
fi
}
check_slot "$SLOT1_KIND" "$SLOT1_PR" "$SLOT1_INTEGRATION"
check_slot "$SLOT2_KIND" "$SLOT2_PR" "$SLOT2_INTEGRATION"
check_slot "$SLOT3_KIND" "$SLOT3_PR" "$SLOT3_INTEGRATION"
check_slot "$SLOT4_KIND" "$SLOT4_PR" "$SLOT4_INTEGRATION"
exit "$status"
- name: Remove disposable cache test scratch
if: always() && !cancelled()
run: bash scripts/ci-cache-post-cleanup.sh
build:
needs: lint
if: always() && !cancelled()
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Free disk space
run: bash scripts/ci-free-disk.sh
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
with:
cache: false
rustflags: ""
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
key: release-debug0-jobs2
- run: bash scripts/verify pr build
features:
needs: lint
if: always() && !cancelled()
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Free disk space
run: bash scripts/ci-free-disk.sh
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
with:
cache: false
rustflags: ""
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
key: features-debug0-jobs2
- run: bash scripts/verify pr features
installed-smoke:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Free disk space
run: bash scripts/ci-free-disk.sh
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
with:
cache: false
rustflags: ""
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
key: installed-debug0-jobs2
- name: Install and run release durability smoke
env:
CI_INSTALL_ROOT: ${{ runner.temp }}/contextdb-installed
run: bash scripts/verify pr installed
cross-compile:
strategy:
matrix:
include:
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
# macOS targets are disabled because the engine uses Linux-only pipe2/SOCK_CLOEXEC
timeout-minutes: 30
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Free disk space
run: bash scripts/ci-free-disk.sh
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
with:
target: ${{ matrix.target }}
cache: false
rustflags: ""
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
key: cross-${{ matrix.target }}-debug0-jobs2
- name: Install cross-compilation tools
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: bash scripts/ci-install-zig-aarch64.sh "$RUNNER_TEMP/zig-aarch64"
- run: bash scripts/verify pr cross
env:
CI_TARGET: ${{ matrix.target }}
required:
name: PR checks
if: always()
needs: [lint, lint-macos, test-builds, test-bundles, build, features, installed-smoke, cross-compile, impact, integration]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Require every check to succeed
env:
CI_NEEDS_FILE: ${{ runner.temp }}/needs.json
# The needs context reaches the script text, not the environment: about seventy jobs overflow one environment string.
run: |
cat > "$CI_NEEDS_FILE" <<'CI_JSON_END'
${{ toJSON(needs) }}
CI_JSON_END
python3 scripts/ci-required.py
development-binaries:
needs: [required]
if: github.event_name == 'push' && github.ref == 'refs/heads/dev' && github.repository == 'context-graph-ai/contextdb'
uses: ./.github/workflows/build.yml
permissions:
contents: write
actions: read