forked from gastownhall/beads
-
Notifications
You must be signed in to change notification settings - Fork 0
760 lines (645 loc) · 27.5 KB
/
Copy pathci-measurements.yml
File metadata and controls
760 lines (645 loc) · 27.5 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
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
name: CI Measurements
on:
workflow_call:
inputs:
suite:
description: "Suite to measure"
required: true
type: string
smoke_version:
description: "Optional previous release for cross-version-smoke"
required: false
type: string
default: ""
workflow_dispatch:
inputs:
suite:
description: "Suite to measure"
required: true
type: choice
default: pr-linux
options:
- pr-linux
- macos-short
- macos-candidates
- linux-integration
- linux-integration-sharded
- linux-integration-hybrid-sharded
- linux-integration-hybrid-16-sharded
- linux-integration-hybrid-prebuilt-sharded
- linux-integration-coverage
- cross-version-smoke
- nix
- mcp-package
- npm-package
smoke_version:
description: "Optional previous release for cross-version-smoke"
required: false
default: ""
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.suite }}
cancel-in-progress: false
env:
BD_DISABLE_METRICS: "1"
BD_DISABLE_EVENT_FLUSH: "1"
jobs:
pr-linux:
name: Measure PR Linux commands
if: ${{ inputs.suite == 'pr-linux' }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: curl -fsSL https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure commands
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
source ./.buildflags
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
ci_time "install golangci-lint" -- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1
status=0
ci_time "pr-policy wrapper" -- make ci-pr-policy || status=$?
ci_time "pr-core gotestsum" -- gotestsum --junitfile artifacts/pr-core-junit.xml --format testdox -- -race -short -skip '^TestEmbedded' ./... || status=$?
ci_time "pr-lint wrapper" -- make ci-pr-lint || status=$?
exit "$status"
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-pr-linux
path: artifacts/
retention-days: 7
if-no-files-found: ignore
macos-short:
name: Measure macOS short Go tests
if: ${{ inputs.suite == 'macos-short' }}
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: curl -fsSL https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure commands
run: |
set -euo pipefail
source scripts/ci/lib/timing.sh
source ./.buildflags
ci_time "macos short go test" -- go test -v -race -short -skip '^TestEmbedded' ./...
macos-candidates:
name: Measure macOS no-short candidates
if: ${{ inputs.suite == 'macos-candidates' }}
runs-on: macos-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: curl -fsSL https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure commands
run: |
set -euo pipefail
source scripts/ci/lib/timing.sh
status=0
ci_time "macos no-short go test" -- go test -tags=gms_pure_go -v -race -timeout=30m -skip '^TestEmbedded' ./... || status=$?
ci_time "macos integration go test" -- go test -tags=integration,gms_pure_go -v -race -timeout=30m -skip '^TestEmbedded' ./... || status=$?
exit "$status"
linux-integration:
name: Measure Linux integration tests
if: ${{ inputs.suite == 'linux-integration' }}
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: curl -fsSL https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure commands
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
ci_time "linux integration go test" -- env BEADS_TEST_SKIP=dolt gotestsum --junitfile artifacts/linux-integration-junit.xml --format testdox -- -v -race -tags=integration,gms_pure_go -timeout=30m ./...
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration
path: artifacts/
retention-days: 7
if-no-files-found: ignore
linux-integration-sharded:
name: Measure Linux integration shard ${{ matrix.shard }}/6
if: ${{ inputs.suite == 'linux-integration-sharded' }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: curl -fsSL https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure shard
env:
SHARD: ${{ matrix.shard }}
TOTAL_SHARDS: 6
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
mapfile -t packages < <(
GO_TEST_SHARD_TAGS=integration,gms_pure_go \
scripts/ci/go-test-shard-packages.sh "$SHARD" "$TOTAL_SHARDS"
)
package_manifest="artifacts/linux-integration-packages-${SHARD}-of-${TOTAL_SHARDS}.txt"
printf '%s\n' "${packages[@]}" | tee "$package_manifest"
if [[ "${#packages[@]}" -eq 0 ]]; then
echo "No packages assigned to shard ${SHARD}/${TOTAL_SHARDS}; skipping go test"
exit 0
fi
ci_time "linux integration shard ${SHARD}/${TOTAL_SHARDS} go test" -- \
env BEADS_TEST_SKIP=dolt gotestsum \
--junitfile "artifacts/linux-integration-shard-${SHARD}-of-${TOTAL_SHARDS}.xml" \
--format testdox \
-- -v -race -tags=integration,gms_pure_go -timeout=30m "${packages[@]}"
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration-shard-${{ matrix.shard }}-of-6
path: artifacts/
retention-days: 7
if-no-files-found: ignore
linux-integration-hybrid-packages:
name: Measure Linux integration package shard ${{ matrix.shard }}/6 (no cmd/bd)
if: ${{ inputs.suite == 'linux-integration-hybrid-sharded' || inputs.suite == 'linux-integration-hybrid-16-sharded' || inputs.suite == 'linux-integration-hybrid-prebuilt-sharded' }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: curl -fsSL https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure shard
env:
SHARD: ${{ matrix.shard }}
TOTAL_SHARDS: 6
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
package_manifest="artifacts/linux-integration-hybrid-packages-${SHARD}-of-${TOTAL_SHARDS}.txt"
write_package_manifest() {
GO_TEST_SHARD_TAGS=integration,gms_pure_go \
GO_TEST_SHARD_EXCLUDE_REGEX="^github.com/steveyegge/beads/cmd/bd$" \
scripts/ci/go-test-shard-packages.sh "$SHARD" "$TOTAL_SHARDS" > "$package_manifest"
}
ci_time "list integration package shard ${SHARD}/${TOTAL_SHARDS}" -- write_package_manifest
cat "$package_manifest"
mapfile -t packages < "$package_manifest"
if [[ "${#packages[@]}" -eq 0 ]]; then
echo "No packages assigned to shard ${SHARD}/${TOTAL_SHARDS}; skipping go test"
exit 0
fi
ci_time "linux integration package shard ${SHARD}/${TOTAL_SHARDS} go test" -- \
env BEADS_TEST_SKIP=dolt gotestsum \
--junitfile "artifacts/linux-integration-hybrid-packages-${SHARD}-of-${TOTAL_SHARDS}.xml" \
--format testdox \
-- -v -race -tags=integration,gms_pure_go -timeout=30m "${packages[@]}"
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration-hybrid-packages-${{ matrix.shard }}-of-6
path: artifacts/
retention-days: 7
if-no-files-found: ignore
linux-integration-hybrid-cmd-bd:
name: Measure Linux integration cmd/bd shard ${{ matrix.shard }}/8
if: ${{ inputs.suite == 'linux-integration-hybrid-sharded' }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: curl -fsSL https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure shard
env:
SHARD: ${{ matrix.shard }}
TOTAL_SHARDS: 8
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
test_manifest="artifacts/linux-integration-cmd-bd-tests-${SHARD}-of-${TOTAL_SHARDS}.txt"
write_test_manifest() {
GO_TEST_SHARD_TAGS=integration,gms_pure_go \
scripts/ci/go-test-shard-names.sh "$SHARD" "$TOTAL_SHARDS" ./cmd/bd > "$test_manifest"
}
ci_time "list cmd/bd test shard ${SHARD}/${TOTAL_SHARDS}" -- write_test_manifest
cat "$test_manifest"
mapfile -t tests < "$test_manifest"
if [[ "${#tests[@]}" -eq 0 ]]; then
echo "No tests assigned to shard ${SHARD}/${TOTAL_SHARDS}; skipping go test"
exit 0
fi
run_regex="^($(IFS='|'; echo "${tests[*]}"))$"
ci_time "linux integration cmd/bd shard ${SHARD}/${TOTAL_SHARDS} go test" -- \
env BEADS_TEST_SKIP=dolt gotestsum \
--junitfile "artifacts/linux-integration-cmd-bd-${SHARD}-of-${TOTAL_SHARDS}.xml" \
--format testdox \
-- -v -race -tags=integration,gms_pure_go -timeout=30m -run "$run_regex" ./cmd/bd
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration-cmd-bd-${{ matrix.shard }}-of-8
path: artifacts/
retention-days: 7
if-no-files-found: ignore
linux-integration-hybrid-16-cmd-bd:
name: Measure Linux integration cmd/bd shard ${{ matrix.shard }}/16
if: ${{ inputs.suite == 'linux-integration-hybrid-16-sharded' }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: curl -fsSL https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure shard
env:
SHARD: ${{ matrix.shard }}
TOTAL_SHARDS: 16
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
test_manifest="artifacts/linux-integration-cmd-bd-tests-${SHARD}-of-${TOTAL_SHARDS}.txt"
write_test_manifest() {
GO_TEST_SHARD_TAGS=integration,gms_pure_go \
scripts/ci/go-test-shard-names.sh "$SHARD" "$TOTAL_SHARDS" ./cmd/bd > "$test_manifest"
}
ci_time "list cmd/bd test shard ${SHARD}/${TOTAL_SHARDS}" -- write_test_manifest
cat "$test_manifest"
mapfile -t tests < "$test_manifest"
if [[ "${#tests[@]}" -eq 0 ]]; then
echo "No tests assigned to shard ${SHARD}/${TOTAL_SHARDS}; skipping go test"
exit 0
fi
run_regex="^($(IFS='|'; echo "${tests[*]}"))$"
ci_time "linux integration cmd/bd shard ${SHARD}/${TOTAL_SHARDS} go test" -- \
env BEADS_TEST_SKIP=dolt gotestsum \
--junitfile "artifacts/linux-integration-cmd-bd-${SHARD}-of-${TOTAL_SHARDS}.xml" \
--format testdox \
-- -v -race -tags=integration,gms_pure_go -timeout=30m -run "$run_regex" ./cmd/bd
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration-cmd-bd-${{ matrix.shard }}-of-16
path: artifacts/
retention-days: 7
if-no-files-found: ignore
linux-integration-hybrid-prebuilt-bd:
name: Measure Linux integration prebuild cmd/bd binary
if: ${{ inputs.suite == 'linux-integration-hybrid-prebuilt-sharded' }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Measure build
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
source ./.buildflags
ci_time "build cmd/bd subprocess binary" -- go build -tags "$BEADS_BUILD_TAGS" -o artifacts/bd ./cmd/bd
- name: Upload prebuilt bd
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration-prebuilt-bd
path: artifacts/bd
retention-days: 7
if-no-files-found: error
linux-integration-hybrid-prebuilt-cmd-bd:
name: Measure Linux integration prebuilt cmd/bd shard ${{ matrix.shard }}/8
if: ${{ inputs.suite == 'linux-integration-hybrid-prebuilt-sharded' }}
needs: linux-integration-hybrid-prebuilt-bd
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Download prebuilt bd
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: ci-measure-linux-integration-prebuilt-bd
path: prebuilt-bd
- name: Install Dolt
run: curl -fsSL https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure shard
env:
SHARD: ${{ matrix.shard }}
TOTAL_SHARDS: 8
BEADS_TEST_BD_BINARY: ${{ github.workspace }}/prebuilt-bd/bd
run: |
set -euo pipefail
mkdir -p artifacts
chmod +x "$BEADS_TEST_BD_BINARY"
source scripts/ci/lib/timing.sh
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
test_manifest="artifacts/linux-integration-cmd-bd-tests-${SHARD}-of-${TOTAL_SHARDS}.txt"
write_test_manifest() {
GO_TEST_SHARD_TAGS=integration,gms_pure_go \
scripts/ci/go-test-shard-names.sh "$SHARD" "$TOTAL_SHARDS" ./cmd/bd > "$test_manifest"
}
ci_time "list cmd/bd test shard ${SHARD}/${TOTAL_SHARDS}" -- write_test_manifest
cat "$test_manifest"
mapfile -t tests < "$test_manifest"
if [[ "${#tests[@]}" -eq 0 ]]; then
echo "No tests assigned to shard ${SHARD}/${TOTAL_SHARDS}; skipping go test"
exit 0
fi
run_regex="^($(IFS='|'; echo "${tests[*]}"))$"
ci_time "linux integration prebuilt cmd/bd shard ${SHARD}/${TOTAL_SHARDS} go test" -- \
env BEADS_TEST_SKIP=dolt gotestsum \
--junitfile "artifacts/linux-integration-prebuilt-cmd-bd-${SHARD}-of-${TOTAL_SHARDS}.xml" \
--format testdox \
-- -v -race -tags=integration,gms_pure_go -timeout=30m -run "$run_regex" ./cmd/bd
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration-prebuilt-cmd-bd-${{ matrix.shard }}-of-8
path: artifacts/
retention-days: 7
if-no-files-found: ignore
linux-integration-coverage:
name: Measure Linux integration coverage
if: ${{ inputs.suite == 'linux-integration-coverage' }}
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Install Dolt
run: curl -fsSL https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash
- name: Configure Git and Dolt identity
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
- name: Measure commands
run: |
set -euo pipefail
mkdir -p artifacts
source scripts/ci/lib/timing.sh
ci_time "install gotestsum" -- go install gotest.tools/gotestsum@v1.13.0
status=0
ci_time "linux integration coverage go test" -- env BEADS_TEST_SKIP=dolt gotestsum --junitfile artifacts/linux-integration-coverage-junit.xml --format testdox -- -v -race -tags=integration,gms_pure_go -coverprofile=artifacts/coverage.out -timeout=30m ./... || status=$?
if [[ -f artifacts/coverage.out ]]; then
ci_time "coverage summary" -- go tool cover -func=artifacts/coverage.out || status=$?
else
echo "coverage.out was not generated; skipping coverage summary"
fi
exit "$status"
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-linux-integration-coverage
path: artifacts/
retention-days: 7
if-no-files-found: ignore
cross-version-smoke:
name: Measure cross-version smoke
if: ${{ inputs.suite == 'cross-version-smoke' }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Cache previous release binaries
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
with:
path: ~/.cache/beads-regression
key: smoke-binaries-measure-${{ runner.os }}
- name: Measure commands
env:
GH_TOKEN: ${{ github.token }}
SMOKE_VERSION: ${{ inputs.smoke_version }}
run: |
set -euo pipefail
source scripts/ci/lib/timing.sh
source ./.buildflags
ci_time "build candidate binary" -- go build -o /tmp/bd-candidate ./cmd/bd
export CANDIDATE_BIN=/tmp/bd-candidate
if [[ -z "$SMOKE_VERSION" ]]; then
SMOKE_VERSION="$(gh release list --repo "$GITHUB_REPOSITORY" --limit 1 --json tagName --jq '.[0].tagName')"
fi
if [[ -z "$SMOKE_VERSION" ]]; then
echo "Could not resolve a previous release tag for cross-version smoke"
exit 1
fi
ci_time "upgrade smoke ${SMOKE_VERSION}" -- ./scripts/upgrade-smoke-test.sh "$SMOKE_VERSION"
nix:
name: Measure nix build
if: ${{ inputs.suite == 'nix' }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Install Nix
uses: DeterminateSystems/determinate-nix-action@61cbfe2efc2d4e7a8a6d56967c3c1058e846c858 # v3
- name: Measure commands
run: |
set -euo pipefail
source scripts/ci/lib/timing.sh
ci_time "nix build .#default" -- nix build .#default --print-build-logs
mcp-package:
name: Measure MCP package checks
if: ${{ inputs.suite == 'mcp-package' }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.14'
- name: Measure commands
run: |
set -euo pipefail
source scripts/ci/lib/timing.sh
ci_time "install uv" -- pip install uv==0.11.16
ci_time "mcp package gate" -- make ci-package-mcp
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-mcp-package
path: integrations/beads-mcp/dist/
retention-days: 7
if-no-files-found: ignore
npm-package:
name: Measure npm package checks
if: ${{ inputs.suite == 'npm-package' }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
with:
node-version: '24'
- name: Measure commands
run: |
set -euo pipefail
source scripts/ci/lib/timing.sh
ci_time "npm package gate" -- make ci-package-npm
- name: Upload measurement artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ci-measure-npm-package
path: artifacts/
retention-days: 7
if-no-files-found: ignore