-
Notifications
You must be signed in to change notification settings - Fork 210
1603 lines (1454 loc) · 55.3 KB
/
Copy pathci.yaml
File metadata and controls
1603 lines (1454 loc) · 55.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
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
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: CI
on:
push:
tags:
- "v*.*.*"
branches:
- main
# Long-lived maintenance branches for shipped major.minor lines,
# e.g. `1.5.x`. The wildcard means a new `1.6.x` branch starts running
# CI on push automatically when it is created.
- "[0-9]+.[0-9]+.x"
# Skip the heavy Rust/Docker/etc. CI when only docs/ changes were pushed.
# Documentation has its own workflow in .github/workflows/docs.yaml.
# NOTE: this also applies to tag pushes — if a tag points at a commit that
# only touches docs/, this workflow won't run. Tag releases normally bump
# version files outside docs/, so this is rarely an issue in practice.
paths-ignore:
- "docs/**"
pull_request:
paths-ignore:
- "docs/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
checks: write
pull-requests: write
actions: read
contents: read
env:
BUILD_TARGET: "x86_64-unknown-linux-gnu"
WASM_RQUICKJS_VERSION: "0.4.4"
MOONBIT_INSTALL_VERSION: "0.10.11+6ff76a5f9"
WASI_SDK_VERSION: "25"
WASI_SDK_PATH: /opt/wasi-sdk
NPM_CONFIG_AUDIT: 'false'
jobs:
build-and-store:
env:
CARGO_BUILD_JOBS: 20
runs-on: blacksmith-32vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: ./.github/actions/setup-rust
with:
cache-save-if: 'true'
install-protoc: 'true'
# Test the build tooling (dev-tools/) first so a broken tool fails fast
- name: Test build tools (dev-tools)
run: cargo make --profile ci dev-tools-tests
- uses: taiki-e/install-action@v2
with:
tool: nextest
- name: Building all executables
env:
QUIET: true
run: cargo make --profile ci build-all-bins-including-tests
timeout-minutes: 30
- name: Packaging all binaries with cargo-nextest
run: |
mkdir -pv tmp
cargo nextest -v archive --archive-file tmp/golem-binaries.tar.zst --zstd-level -7 --cargo-profile dev-ci
timeout-minutes: 5
- name: Extract archive
run: |
mkdir tmp/golem-binaries
tar --zstd -xvf tmp/golem-binaries.tar.zst -C tmp/golem-binaries
timeout-minutes: 5
- name: Save packaged binaries to cache
uses: actions/cache/save@v5
with:
path: tmp/golem-binaries
key: golem-binaries-${{ github.run_id }}
check-clippy-and-format:
env:
CARGO_BUILD_JOBS: 10
runs-on: blacksmith-8vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: ./.github/actions/setup-rust
with:
install-protoc: 'true'
- name: Check formatting and clippy rules
run: cargo make --profile ci check
unit-tests-and-checks:
env:
CARGO_BUILD_JOBS: 10
runs-on: blacksmith-8vcpu-ubuntu-2204
needs: build-and-store
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: ./.github/actions/setup-rust
with:
use-cache: 'false'
install-cargo-binstall: 'true'
install-protoc: 'true'
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Setup SBT
uses: sbt/setup-sbt@v1
- uses: ./.github/actions/restore-binaries
with:
run-id: ${{ github.run_id }}
copy-to-target: 'true'
# Bun is needed by check-openapi (which depends on check-docs-openapi)
# and by check-docs-skills to regenerate docs from the in-tree
# sources and detect drift.
- name: Setup Bun (for docs drift checks)
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Cache Bun install (docs/)
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('docs/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Check openapi is up to date (includes docs/src/content/rest-api/)
run: cargo make --profile ci check-openapi
- name: Check how-to-guides docs are in sync with golem-skills/
run: cargo make --profile ci check-docs-skills
- name: Check configs are up to date
run: cargo make --profile ci check-configs
- name: Check WIT deps are synced
run: cargo make --profile ci check-wit
- name: Unit tests
run: cargo make --profile ci unit-tests
- uses: ./.github/actions/publish-test-report
if: always()
with:
artifact-name: unit-tests-report
github-token: ${{ secrets.GITHUB_TOKEN }}
worker-tests:
env:
CARGO_BUILD_JOBS: 10
runs-on: blacksmith-8vcpu-ubuntu-2204
needs:
- build-and-store
- merge-test-components
strategy:
fail-fast: false
matrix:
group:
- name: misc
- name: group1
- name: group2
- name: group3
- name: group4
name: worker-tests-${{ matrix.group.name }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: ./.github/actions/setup-rust
with:
use-cache: 'false'
install-cargo-binstall: 'true'
- name: Setup Redis
uses: shogo82148/actions-setup-redis@v1.49.0
with:
redis-version: latest
auto-start: false
- uses: ./.github/actions/restore-binaries
with:
run-id: ${{ github.run_id }}
- uses: ./.github/actions/restore-test-components
with:
run-id: ${{ github.run_id }}
- name: Worker Executor integration tests
run: cargo make --profile ci worker-executor-tests-${{ matrix.group.name }}
timeout-minutes: 20
- uses: ./.github/actions/publish-test-report
if: always()
with:
artifact-name: worker-executor-tests-${{ matrix.group.name }}-report
github-token: ${{ secrets.GITHUB_TOKEN }}
managed-xfs-tests:
name: managed-xfs-tests
runs-on: blacksmith-8vcpu-ubuntu-2404
needs:
- build-and-store
- merge-test-components
timeout-minutes: 45
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: ./.github/actions/setup-rust
with:
use-cache: 'false'
install-cargo-binstall: 'true'
- uses: ./.github/actions/restore-binaries
with:
run-id: ${{ github.run_id }}
fail-on-cache-miss: 'true'
- uses: ./.github/actions/restore-test-components
with:
run-id: ${{ github.run_id }}
- name: Set up Lima
id: lima
env:
GH_TOKEN: ${{ github.token }}
LIMA_VERSION: v2.2.0
run: |
sudo sed -i -E 's#http://(([a-z]{2}\.)?archive\.ubuntu\.com|security\.ubuntu\.com)/ubuntu#https://\1/ubuntu#g' \
/etc/apt/sources.list.d/ubuntu.sources \
/etc/apt/blacksmith-ubuntu-mirrors.txt
sudo apt-get update -qq
sudo apt-get install -qqy --no-install-recommends ovmf qemu-system-x86 qemu-utils
test -c /dev/kvm
sudo chown "$(whoami)" /dev/kvm
archive="lima-${LIMA_VERSION#v}-Linux-x86_64.tar.gz"
curl -fOSL "https://github.com/lima-vm/lima/releases/download/${LIMA_VERSION}/${archive}"
gh attestation verify --owner lima-vm "${archive}"
sudo tar -C /usr/local -xzf "${archive}"
rm "${archive}"
echo "version=${LIMA_VERSION}" >> "${GITHUB_OUTPUT}"
- name: Cache Lima images
uses: actions/cache@v5
with:
path: ~/.cache/lima
key: lima-${{ runner.os }}-${{ steps.lima.outputs.version }}
- name: Run managed XFS suite
env:
GOLEM_MANAGED_XFS_REUSE_TEST_BINARIES: 1
GOLEM_MANAGED_XFS_TARGET_DIR: ${{ github.workspace }}/target
GOLEM_MANAGED_XFS_CARGO_TEST_R: ${{ github.workspace }}/target/cargo-test-r
run: |
cp "$(command -v cargo-test-r)" "${GOLEM_MANAGED_XFS_CARGO_TEST_R}"
integration-tests/scripts/managed-filesystem/run-lima.sh
build-cli-test-bins:
env:
CARGO_BUILD_JOBS: 20
GOLEM_CLI_TEST_BIN_PROFILE: dev-release-ci
runs-on: blacksmith-32vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: ./.github/actions/setup-rust
with:
cache-shared-key: 'cli-dev-release-ci'
cache-save-if: 'true'
install-protoc: 'true'
- name: Build CLI test binaries
env:
QUIET: true
run: cargo make --profile ci build-cli-test-bins
timeout-minutes: 20
- name: Package CLI test binaries
run: |
mkdir -pv tmp/golem-cli-test-binaries
cp target/dev-release-ci/golem target/dev-release-ci/golem-cli tmp/golem-cli-test-binaries/
find tmp/golem-cli-test-binaries -type f | sort
timeout-minutes: 2
- name: Save CLI test binaries to cache
uses: actions/cache/save@v5
with:
path: tmp/golem-cli-test-binaries
key: golem-cli-test-binaries-${{ github.run_id }}
it:
env:
CARGO_BUILD_JOBS: 10
runs-on: ${{ matrix.group.runner || 'blacksmith-8vcpu-ubuntu-2204' }}
needs:
- build-and-store
- build-golem-ts
- merge-test-components
strategy:
fail-fast: false
matrix:
group:
- name: integration-tests-group1
description: "IT #1"
- name: integration-tests-group2
description: "IT #2"
- name: integration-tests-group3
description: "IT #3"
- name: integration-tests-group4
description: "IT #4"
- name: integration-tests-group5
description: "IT #5"
- name: integration-tests-group6-coordinated
description: "IT #6a"
- name: integration-tests-group6-rest
description: "IT #6b"
- name: integration-tests-group7
description: "IT #7"
- name: integration-tests-group8
description: "IT #8"
- name: integration-tests-group9
description: "IT #9"
- name: integration-tests-group10
description: "IT #10"
- name: integration-tests-group11
description: "IT #11"
- name: integration-tests-group12
description: "IT #12"
- name: integration-tests-group13
description: "IT #13"
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: actions/setup-node@v5
if: ${{ matrix.group.name == 'integration-tests-group10' || matrix.group.name == 'integration-tests-group11' }}
with:
node-version: 'lts/*'
- uses: ./.github/actions/setup-rust
with:
use-cache: 'false'
rust-targets: 'wasm32-wasip1 wasm32-wasip2'
install-cargo-binstall: 'true'
- name: Setup Redis
uses: shogo82148/actions-setup-redis@v1.49.0
with:
redis-version: latest
auto-start: false
- uses: ./.github/actions/restore-binaries
with:
run-id: ${{ github.run_id }}
copy-to-target: 'true'
- uses: ./.github/actions/restore-test-components
with:
run-id: ${{ github.run_id }}
- name: ${{ matrix.group.description }}
env:
QUIET: true
run: cargo make --profile ci ${{ matrix.group.name }}
timeout-minutes: 45
- uses: ./.github/actions/publish-test-report
if: always()
with:
artifact-name: '${{ matrix.group.name }}-report'
github-token: ${{ secrets.GITHUB_TOKEN }}
it-cli:
name: it-cli (${{ matrix.group.shard }})
env:
CARGO_BUILD_JOBS: 10
GOLEM_CLI_TEST_BIN_PROFILE: dev-release-ci
runs-on: blacksmith-32vcpu-ubuntu-2204
needs:
- build-and-store
- build-golem-effect
- build-golem-ts
- build-cli-test-bins
- build-golem-scala
- merge-test-components
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
group:
- { name: cli-integration-tests-agents, shard: agents }
- { name: cli-integration-tests-agents-guest-bridge, shard: agents_guest_bridge }
- { name: cli-integration-tests-agents-streaming, shard: agents_streaming }
- { name: cli-integration-tests-bridge, shard: bridge_gen }
- { name: cli-integration-tests-bridge-rust, shard: bridge_gen_rust }
- { name: cli-integration-tests-deploy, shard: deploy }
- { name: cli-integration-tests-core, shard: core }
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: ./.github/actions/setup-rust
with:
use-cache: 'false'
rust-targets: 'wasm32-wasip1 wasm32-wasip2'
install-cargo-binstall: 'true'
- name: Setup Redis
uses: shogo82148/actions-setup-redis@v1.49.0
with:
redis-version: latest
auto-start: false
- name: Install wasm-tools
run: cargo binstall --force --locked wasm-tools@1.248.0
- name: Install wit-bindgen
run: cargo binstall --force --locked wit-bindgen-cli@0.40.0
- name: Setup Node
uses: ./.github/actions/setup-js-wasm-tools
with:
wasm-rquickjs-version: ${{ env.WASM_RQUICKJS_VERSION }}
wasi-sdk-version: ${{ env.WASI_SDK_VERSION }}
wasi-sdk-path: ${{ env.WASI_SDK_PATH }}
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Setup SBT
uses: sbt/setup-sbt@v1
# Warm the coursier cache for the bridge shard's Scala deps.
- name: Cache scala dependencies
uses: coursier/cache-action@v8
- name: Setup MoonBit
uses: hustcer/setup-moonbit@v1
with:
version: ${{ env.MOONBIT_INSTALL_VERSION }}
core-version: ${{ env.MOONBIT_INSTALL_VERSION }}
- name: Install MoonBit SDK tools dependencies
working-directory: sdks/moonbit/golem_sdk_tools
run: moon update
- name: Sync WIT dependencies
run: cargo make wit
- name: Restore Scala guest runtime WASMs (built by build-golem-scala)
uses: actions/download-artifact@v8
with:
name: agent-guest-wasm
path: tmp/sdk-artifacts
- name: Extract Scala guest runtime WASMs
run: tar -xzf tmp/sdk-artifacts/agent-guest-wasm.tar.gz
- name: Restore Scala SDK ivy local repo (published by build-golem-scala)
uses: actions/download-artifact@v8
with:
name: scala-sdk-ivy-local
path: tmp/sdk-artifacts
- name: Extract Scala SDK ivy local repo
run: |
mkdir -p ~/.ivy2
tar -xzf tmp/sdk-artifacts/scala-sdk-ivy-local.tar.gz -C ~/.ivy2
- name: Restore built TS SDK
uses: actions/download-artifact@v8
with:
name: golem-ts-sdk
path: tmp/sdk-artifacts
- name: Extract built TS SDK
run: tar -xzf tmp/sdk-artifacts/golem-ts-sdk.tar.gz
- name: Install TS SDK dependencies
working-directory: sdks/ts
run: pnpm install --frozen-lockfile
- name: Restore built Effect SDK
uses: actions/download-artifact@v8
with:
name: golem-effect-sdk
path: tmp/sdk-artifacts
- name: Extract built Effect SDK
run: tar -xzf tmp/sdk-artifacts/golem-effect-sdk.tar.gz
- name: Install Effect SDK dependencies
working-directory: sdks/effect
run: npm ci
- uses: ./.github/actions/restore-binaries
with:
run-id: ${{ github.run_id }}
copy-to-target: 'true'
- name: Restore CLI test binaries
uses: actions/cache/restore@v5
with:
path: tmp/golem-cli-test-binaries
key: golem-cli-test-binaries-${{ github.run_id }}
fail-on-cache-miss: true
- name: Install CLI test binaries
run: |
mkdir -pv target/dev-release-ci
cp tmp/golem-cli-test-binaries/* target/dev-release-ci/
chmod +x target/dev-release-ci/*
- name: Restore streaming test components
if: matrix.group.shard == 'agents_streaming'
uses: ./.github/actions/restore-test-components
with:
run-id: ${{ github.run_id }}
- name: it-cli ${{ matrix.group.shard }}
env:
QUIET: true
GOLEM_CLI_TEST_SERVER_LOG_DIR: ${{ github.workspace }}/tmp/golem-cli-test-server-logs
run: cargo make --profile ci ${{ matrix.group.name }}
timeout-minutes: 30
- name: Upload golem server logs
if: failure()
uses: actions/upload-artifact@v6
with:
name: '${{ matrix.group.name }}-server-logs-attempt${{ github.run_attempt }}'
path: tmp/golem-cli-test-server-logs
if-no-files-found: ignore
retention-days: 7
- uses: ./.github/actions/publish-test-report
if: always()
with:
artifact-name: '${{ matrix.group.name }}-report'
github-token: ${{ secrets.GITHUB_TOKEN }}
consolidate-test-reports:
name: consolidate-test-reports
if: ${{ always() }}
runs-on: ubuntu-latest
needs:
- unit-tests-and-checks
- worker-tests
- it
- it-cli
steps:
- name: Download test reports for this attempt
uses: actions/download-artifact@v8
with:
pattern: '*-report-attempt${{ github.run_attempt }}'
path: tmp/test-reports
merge-multiple: false
- name: Preserve the source artifact name for a single report
env:
GH_TOKEN: ${{ github.token }}
run: |
if [[ -f tmp/test-reports/ctrf-report.json ]]; then
mapfile -t artifact_names < <(
gh api --paginate "/repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/artifacts?per_page=100" \
--jq ".artifacts[].name | select(endswith(\"-report-attempt${GITHUB_RUN_ATTEMPT}\"))"
)
if [[ "${#artifact_names[@]}" -ne 1 ]]; then
echo "Expected one report artifact for attempt ${GITHUB_RUN_ATTEMPT}, found ${#artifact_names[@]}" >&2
exit 1
fi
mkdir -p "tmp/test-reports/${artifact_names[0]}"
mv tmp/test-reports/ctrf-report.json "tmp/test-reports/${artifact_names[0]}/"
fi
- name: Upload consolidated test reports
uses: actions/upload-artifact@v6
with:
name: ci-test-reports-attempt${{ github.run_attempt }}
path: tmp/test-reports
if-no-files-found: error
retention-days: 35
scala-sdk-integration-tests:
runs-on: blacksmith-8vcpu-ubuntu-2204
needs:
- build-and-store
- build-golem-ts
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: ./.github/actions/setup-rust
with:
use-cache: 'false'
rust-targets: 'wasm32-wasip2'
install-cargo-binstall: 'true'
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Setup SBT
uses: sbt/setup-sbt@v1
- name: Cache scala dependencies
uses: coursier/cache-action@v8
- uses: ./.github/actions/setup-js-wasm-tools
with:
wasi-sdk-version: ${{ env.WASI_SDK_VERSION }}
wasi-sdk-path: ${{ env.WASI_SDK_PATH }}
wasm-rquickjs-version: ${{ env.WASM_RQUICKJS_VERSION }}
- name: Sync WIT dependencies
run: cargo make wit
- name: Build Scala guest runtime WASMs
working-directory: sdks/scala
run: ./scripts/generate-agent-guest-wasm.sh
- uses: ./.github/actions/restore-binaries
with:
run-id: ${{ github.run_id }}
copy-to-target: 'true'
- name: Restore built TS SDK
uses: actions/download-artifact@v8
with:
name: golem-ts-sdk
path: tmp/sdk-artifacts
- name: Extract built TS SDK
run: tar -xzf tmp/sdk-artifacts/golem-ts-sdk.tar.gz
- name: Install TS SDK dependencies
working-directory: sdks/ts
run: pnpm install --frozen-lockfile
- name: Add golem to PATH
run: echo "${{ github.workspace }}/target/debug" >> $GITHUB_PATH
- name: Publish Scala SDK locally
working-directory: sdks/scala
run: |
sbt -batch '++3.8.2; set ThisBuild / version := "0.0.0-SNAPSHOT"; set ThisBuild / packageDoc / publishArtifact := false; set every (publish / skip) := false; modelJVM/publishLocal; modelJS/publishLocal; macros/publishLocal; core/publishLocal; codegen/publishLocal; ++2.12.21; codegen/publishLocal; sbtPlugin/publishLocal'
- name: Run Scala SDK integration tests
working-directory: sdks/scala
env:
GOLEM_TS_PACKAGES_PATH: ${{ github.workspace }}/sdks/ts/packages
RUST_BACKTRACE: 1
run: sbt -batch "++3.8.2; integrationTests/test"
timeout-minutes: 20
- name: Upload Scala integration server log
if: always()
uses: actions/upload-artifact@v6
with:
name: scala-sdk-integration-server-log
path: sdks/scala/target/scala-integration/golem-server.log
if-no-files-found: warn
retention-days: 7
golem-schema-guest:
runs-on: blacksmith
env:
CARGO_BUILD_JOBS: 10
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: ./.github/actions/setup-rust
with:
rust-targets: 'wasm32-wasip2'
- name: Prepare WIT dependencies
run: cargo make wit
- name: Build golem-schema in guest mode
run: cargo build --target wasm32-wasip2 -p golem-schema --no-default-features --features guest
- name: Test owned typed values in guest mode
run: cargo test -p golem-schema --no-default-features --features guest --test owned_typed_wit -- --nocapture --report-time
golem-client:
runs-on: blacksmith
env:
CARGO_BUILD_JOBS: 10
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: ./.github/actions/setup-rust
with:
install-cargo-binstall: 'true'
- name: Prepare WIT dependencies
run: cargo make wit
- name: Build golem-client (dependencies in features=client mode)
run: cargo build -p golem-client
build-golem-scala:
runs-on: blacksmith-8vcpu-ubuntu-2204
timeout-minutes: 25
steps:
- uses: actions/checkout@v5
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Setup SBT
uses: sbt/setup-sbt@v1
- name: Cache scala dependencies
uses: coursier/cache-action@v8
- uses: ./.github/actions/setup-rust
with:
use-cache: 'false'
rust-targets: 'wasm32-wasip2'
install-cargo-binstall: 'true'
- uses: ./.github/actions/setup-wasm-component-tools
with:
wasi-sdk-version: ${{ env.WASI_SDK_VERSION }}
wasi-sdk-path: ${{ env.WASI_SDK_PATH }}
wasm-rquickjs-version: ${{ env.WASM_RQUICKJS_VERSION }}
- name: Sync WIT dependencies
run: cargo make wit
- name: Build Scala guest runtime WASMs
working-directory: sdks/scala
run: ./scripts/generate-agent-guest-wasm.sh
- name: Verify Scala WIT d.ts files are committed
uses: ./.github/actions/check-scala-sdk-generated
- name: Run Golem tests (Scala 3.8.2)
working-directory: sdks/scala
run: sbt -mem 4096 "++3.8.2; modelJVM/test; modelJS/test; core/test; macros/test; codegen/test"
- name: Compile sbt plugin
working-directory: sdks/scala
run: sbt "++2.12.21!; sbtPlugin/compile"
# Published for the it-cli shards to restore. Must run after the guest role runtimes are built,
# since the sbt plugin jar embeds them.
- name: Publish Scala SDK locally
working-directory: sdks/scala
run: |
sbt -batch '++3.8.2; set ThisBuild / version := "0.0.0-SNAPSHOT"; set ThisBuild / packageDoc / publishArtifact := false; set every (publish / skip) := false; modelJVM/publishLocal; modelJS/publishLocal; macros/publishLocal; core/publishLocal; codegen/publishLocal; ++2.12.21; codegen/publishLocal; sbtPlugin/publishLocal'
- name: Package Scala guest runtime WASMs for it-cli
run: |
tar -czf "$RUNNER_TEMP/agent-guest-wasm.tar.gz" \
sdks/scala/sbt/src/main/resources/golem/wasm/*.wasm \
sdks/scala/mill/resources/golem/wasm/*.wasm \
sdks/scala/wit/dts
- name: Upload Scala guest runtime WASMs for it-cli
uses: actions/upload-artifact@v6
with:
name: agent-guest-wasm
path: ${{ runner.temp }}/agent-guest-wasm.tar.gz
if-no-files-found: error
overwrite: true
retention-days: 7
- name: Package Scala SDK ivy local repo for it-cli
run: tar -czf "$RUNNER_TEMP/scala-sdk-ivy-local.tar.gz" -C ~/.ivy2 local
- name: Upload Scala SDK ivy local repo for it-cli
uses: actions/upload-artifact@v6
with:
name: scala-sdk-ivy-local
path: ${{ runner.temp }}/scala-sdk-ivy-local.tar.gz
if-no-files-found: error
overwrite: true
retention-days: 7
build-golem-moonbit:
runs-on: blacksmith
steps:
- uses: actions/checkout@v5
- name: Setup MoonBit
uses: hustcer/setup-moonbit@v1
with:
version: ${{ env.MOONBIT_INSTALL_VERSION }}
core-version: ${{ env.MOONBIT_INSTALL_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update MoonBit workspace dependencies
run: moon update
working-directory: sdks/moonbit
- name: Check SDK
run: find . -name moon.pkg -exec dirname {} \; | xargs moon check --target wasm
working-directory: sdks/moonbit/golem_sdk
- name: Test SDK
run: ./scripts/run-sdk-tests.sh
working-directory: sdks/moonbit/golem_sdk
- name: Check tools
run: moon check cmd lib
working-directory: sdks/moonbit/golem_sdk_tools
- name: Test tools
run: moon test cmd lib
working-directory: sdks/moonbit/golem_sdk_tools
# The Rust SDK test suite is dominated by three integration test targets that each shell out to
# cargo (tool: one `cargo check` per test, tool_middleware_component: a full wasm component
# build, ui: trybuild). They run as separate matrix entries; the `check` entry runs lint and every
# other test target and fails if a test target is added without being assigned to an entry.
build-golem-rust:
name: build-golem-rust (${{ matrix.part.name }})
runs-on: blacksmith-16vcpu-ubuntu-2204
strategy:
fail-fast: false
matrix:
part:
- name: check
test-args: --lib --bins --test agent --test http_router --test tool_canonical --test schema_reexport --test reflection_recipe_compile
- name: tool
test-args: --test tool
- name: tool-middleware-component
test-args: --test tool_middleware_component
- name: ui
test-args: --test ui
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-rust
with:
rust-targets: 'wasm32-wasip2'
cache-prefix-key: 'v2-golem-rust'
install-cargo-make: 'false'
install-cargo-binstall: 'true'
- name: Install wasm-tools
run: cargo binstall --force --locked wasm-tools@1.248.0
- name: Check formatting
if: matrix.part.name == 'check'
run: cargo fmt -- --check
working-directory: sdks/rust
- name: Clippy
if: matrix.part.name == 'check'
run: cargo clippy -- -Dwarnings
working-directory: sdks/rust
- name: Check that every test target is covered by the matrix
if: matrix.part.name == 'check'
working-directory: sdks/rust
run: |
expected='agent
http_router
reflection_recipe_compile
schema_reexport
tool
tool_canonical
tool_middleware_component
ui'
actual=$(cargo metadata --no-deps --format-version 1 \
| jq -r '.packages[].targets[] | select(.kind | index("test")) | .name' | sort)
if [ "$actual" != "$expected" ]; then
echo "Test targets of sdks/rust changed; update the build-golem-rust matrix in ci.yaml:"
diff <(echo "$expected") <(echo "$actual") || true
exit 1
fi
- name: Tests
run: cargo test --all-features ${{ matrix.part.test-args }}
working-directory: sdks/rust
- name: Doc tests
if: matrix.part.name == 'check'
run: cargo test --all-features --doc
working-directory: sdks/rust
build-golem-ts:
runs-on: blacksmith
env:
NODE_OPTIONS: --max-old-space-size=4096
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: ./.github/actions/setup-rust
with:
use-cache: 'false'
rust-targets: 'wasm32-wasip2'
install-cargo-make: 'false'
install-cargo-binstall: 'true'
- uses: ./.github/actions/setup-js-wasm-tools
with:
wasi-sdk-version: ${{ env.WASI_SDK_VERSION }}
wasi-sdk-path: ${{ env.WASI_SDK_PATH }}
wasm-rquickjs-version: ${{ env.WASM_RQUICKJS_VERSION }}
- name: Install dependencies
working-directory: sdks/ts
run: |
pnpm install
- name: Check code quality
working-directory: sdks/ts
run: |
pnpm run lint || (
echo "Linting issues found. Please fix them before proceeding. `npm run lint:fix` may help"
exit 1
)
- name: Check code formatting
working-directory: sdks/ts
run: |
pnpm run format:check || (
echo "Code formatting issues found. Please run 'npm run format' to fix them."
exit 1
)
- name: Build the package
working-directory: sdks/ts
run: |
pnpm run build
- name: Verify golem-ts-sdk types are committed
working-directory: sdks/ts
run: |
if ! git diff --exit-code packages/golem-ts-sdk/types; then
echo "❌ The files in packages/golem-ts-sdk/types differ from the committed version."
echo "Please run 'pnpm run build' and commit the updated files."
exit 1
fi
- name: Build the agent template WASM binary
working-directory: sdks/ts
run: pnpm run build-agent-template
- name: Check packed SDK HTTP contract
working-directory: sdks/ts
run: pnpm --filter @golemcloud/golem-ts-sdk run check:package
- name: Run tests
working-directory: sdks/ts
run: |
pnpm run test
- name: Package built TS SDK for dependent jobs
run: |
tar -czf "$RUNNER_TEMP/golem-ts-sdk.tar.gz" \
sdks/ts/packages/golem-ts-sdk/dist \
sdks/ts/packages/golem-ts-sdk/types \
sdks/ts/packages/golem-ts-sdk/wasm \
sdks/ts/packages/golem-ts-bridge/dist \
sdks/ts/packages/golem-ts-repl/dist
- name: Upload built TS SDK for dependent jobs
uses: actions/upload-artifact@v6
with:
name: golem-ts-sdk
path: ${{ runner.temp }}/golem-ts-sdk.tar.gz
if-no-files-found: error
overwrite: true
retention-days: 7
build-golem-effect:
runs-on: blacksmith
env:
NODE_OPTIONS: --max-old-space-size=4096
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: ./.github/actions/setup-rust
with:
use-cache: 'false'
rust-targets: 'wasm32-wasip2'
install-cargo-make: 'false'
install-cargo-binstall: 'true'
- uses: ./.github/actions/setup-js-wasm-tools
with:
wasi-sdk-version: ${{ env.WASI_SDK_VERSION }}
wasi-sdk-path: ${{ env.WASI_SDK_PATH }}
wasm-rquickjs-version: ${{ env.WASM_RQUICKJS_VERSION }}
- name: Install dependencies
working-directory: sdks/effect
run: npm ci
- name: Check code quality
working-directory: sdks/effect
run: npm run lint
- name: Check code formatting
working-directory: sdks/effect
run: npm run format:check
- name: Typecheck
working-directory: sdks/effect
run: npm run typecheck
- name: Build the package and agent template
working-directory: sdks/effect
run: |
npm test
npm run build
npm run build-agent-template
npm run check:dts
npm run check:contracts
npm run check:artifacts
npm run check:package
- name: Package built Effect SDK for CLI integration tests
run: |
tar -czf "$RUNNER_TEMP/golem-effect-sdk.tar.gz" \
sdks/effect/dist sdks/effect/wasm sdks/effect/golem-types
- name: Upload built Effect SDK for CLI integration tests
uses: actions/upload-artifact@v6
with:
name: golem-effect-sdk
path: ${{ runner.temp }}/golem-effect-sdk.tar.gz
if-no-files-found: error
overwrite: true