-
-
Notifications
You must be signed in to change notification settings - Fork 8
1694 lines (1472 loc) · 65.4 KB
/
Copy pathpr.yml
File metadata and controls
1694 lines (1472 loc) · 65.4 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: PR
# The only CI a pull request runs. Pushes to main and develop, and tags, are covered
# by the CircleCI config; this workflow mirrors its build-test workflow, not release.
on:
pull_request:
concurrency:
group: pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
# The OMG training corpus is not vendored. Requiring it here turns "corpus
# absent" into a test failure instead of a skip, so the gate cannot pass green
# without actually running (see tests/corpus/training_examples_test.go).
OPENSYSML_REQUIRE_TRAINING_CORPUS: "1"
# Same for the three pinned OMG pilot corpora, which are downloaded below and
# gated by tests/corpus/pilot_corpora_test.go.
OPENSYSML_REQUIRE_PILOT_CORPORA: "1"
# Same for the pinned OMG PSSM test suite, gated by tools/referee/pssm and tools/cmd/pssm-referee.
OPENSYSML_REQUIRE_PSSM_SUITE: "1"
# Same for the pinned OMG SysML v1 to v2 transformation model, gated by tools/census/transformation.
OPENSYSML_REQUIRE_SYSML_V1TOV2: "1"
# Same for the pinned fUML reference-implementation suite, gated by tools/referee/fuml.
OPENSYSML_REQUIRE_FUML_SUITE: "1"
# Same for the pilot's XMI of the standard library, downloaded below and
# compared against by tests/identity (TestPilotLibraryXMI).
OPENSYSML_REQUIRE_PILOT_LIBRARY_XMI: "1"
# z3 is installed below, so "no solver, therefore skip" would exercise nothing:
# this turns an absent solver into a failure (see internal/exec/solve).
OPENSYSML_REQUIRE_SMT: "1"
# The WebAssembly gate runs the wasm binaries under Node 24, set up by its jobs;
# without a runtime it would skip instead of proving they run (see tests/wasm).
OPENSYSML_REQUIRE_WASM: "1"
# Same for the Modelica Reference-FMUs, downloaded below and gated by
# tests/fmi and the Python runner's real test: absent means failure, not skip.
OPENSYSML_REQUIRE_REFERENCE_FMUS: "1"
jobs:
# Which areas the pull request touches. A path no area claims turns every area
# on, so a new directory is over-tested rather than untested.
changes:
name: Changed areas
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 5
outputs:
go: ${{ steps.areas.outputs.go }}
docs: ${{ steps.areas.outputs.docs }}
node: ${{ steps.areas.outputs.node }}
python: ${{ steps.areas.outputs.python }}
java: ${{ steps.areas.outputs.java }}
rust: ${{ steps.areas.outputs.rust }}
julia: ${{ steps.areas.outputs.julia }}
matlab: ${{ steps.areas.outputs.matlab }}
vscode: ${{ steps.areas.outputs.vscode }}
mdk: ${{ steps.areas.outputs.mdk }}
syson: ${{ steps.areas.outputs.syson }}
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Test the area filter
run: scripts/ci-changed-areas-test.sh
- name: Decide which areas to run
id: areas
env:
BASE_REF: ${{ github.base_ref }}
run: scripts/ci-changed-areas.sh "origin/$BASE_REF" HEAD | tee -a "$GITHUB_OUTPUT"
race-tests:
name: Go race tests (${{ matrix.shard }})
needs: changes
if: needs.changes.outputs.go == 'true'
# The shards split the suite's slowest packages across runners so each gets its own job cap (see scripts/race-shard.sh).
strategy:
fail-fast: false
matrix:
shard: [runtime, model, export, rest]
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 60
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
# Node 24, as the WebAssembly gate pins: Node 22's WASI host crashes on the wasm binaries.
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Download Go modules
run: go mod download
# Pinned by digest, so a substituted asset is not run. The release binary rather
# than `go run` keeps buf's own module tree out of the checksum-database path.
- name: Install buf
if: matrix.shard == 'rest'
run: |
curl -fsSL --proto '=https' --proto-redir '=https' -o /tmp/buf \
https://github.com/bufbuild/buf/releases/download/v1.57.2/buf-Linux-x86_64
echo "644e6fa4a62afc2b0d425d3ac9538d2f512947c0f2e82fc95c41a5eab6729414 /tmp/buf" | sha256sum --check --strict
sudo install -m 0755 /tmp/buf /usr/local/bin/buf
buf --version
# One buf template generates both the Go stubs and the Java client's message
# classes, so without this check the committed stubs can drift from the schema.
# `git add -N` puts a regenerated file the commit had deleted into the diff.
- name: Verify the committed Go and Java stubs are current
if: matrix.shard == 'rest'
run: |
make proto-buf BUF=buf
git add -N api/proto \
client/java/opensysml-client/src/main/java/org/openmbee/opensysml/proto
git diff --exit-code api/proto \
client/java/opensysml-client/src/main/java/org/openmbee/opensysml/proto
# The solver is an external process, never linked in: the solver-dependent
# tests need one on PATH to run rather than skip.
- name: Install Z3
run: |
sudo apt-get update
sudo apt-get install -y z3
z3 --version
# The second verified backend, for the portability gate below: cvc5 has no
# apt package, so the official static release is what CI runs, pinned by
# digest so a substituted asset is not run.
- name: Install cvc5
run: |
curl -fsSL --proto '=https' --proto-redir '=https' -o /tmp/cvc5.zip \
https://github.com/cvc5/cvc5/releases/download/cvc5-1.3.4/cvc5-Linux-x86_64-static.zip
echo "dcdbfada0ce493ee98259c0816e0daafc561c223aadb3af298c2968e73ea39c6 /tmp/cvc5.zip" | sha256sum --check --strict
unzip -p /tmp/cvc5.zip '*/bin/cvc5' > /tmp/cvc5-bin
sudo install -m 0755 /tmp/cvc5-bin /usr/local/bin/cvc5
cvc5 --version | head -1
# Keyed on the download script and the shared pilot pin, so a change to the
# pinned tag or the layout invalidates the cache. A restored cache is still
# verified below.
- name: Cache the OMG training corpus
uses: actions/cache@v4
with:
path: examples/sysml-v2-training
key: training-corpus-${{ hashFiles('scripts/download-training-examples.sh', 'scripts/pilot-pin.sh') }}
- name: Download the OMG training corpus
run: ./scripts/download-training-examples.sh
- name: Verify the OMG training corpus
run: |
count=$(find examples/sysml-v2-training -name '*.sysml' | wc -l)
echo "training corpus: $count .sysml files"
if [ "$count" -eq 0 ]; then
echo "error: the training corpus is empty; the corpus gate would not run" >&2
exit 1
fi
# Same keying as the training corpus: the download script plus the shared
# pilot pin. A restored cache is verified below rather than trusted.
- name: Cache the OMG pilot corpora
uses: actions/cache@v4
with:
path: examples/pilot-corpora
key: pilot-corpora-${{ hashFiles('scripts/download-pilot-corpora.sh', 'scripts/pilot-pin.sh') }}
- name: Download the OMG pilot corpora
run: ./scripts/download-pilot-corpora.sh
- name: Verify the OMG pilot corpora
run: |
for root in sysml-examples sysml-validation kerml-examples; do
count=$(find "examples/pilot-corpora/$root" -type f \( -name '*.sysml' -o -name '*.kerml' \) | wc -l)
echo "pilot corpus $root: $count model files"
if [ "$count" -eq 0 ]; then
echo "error: pilot corpus $root is empty; the corpora gate would not run" >&2
exit 1
fi
done
# The PSSM suite is one pinned file; keyed on its download script and pin.
- name: Cache the OMG PSSM test suite
uses: actions/cache@v4
with:
path: build/pssm
key: pssm-suite-${{ hashFiles('scripts/download-pssm-suite.sh', 'scripts/pssm-pin.sh') }}
- name: Download the OMG PSSM test suite
run: ./scripts/download-pssm-suite.sh
# The SysML v1 to v2 transformation model is one pinned file; keyed on its
# download script and pin.
- name: Cache the SysML v1 to v2 transformation model
uses: actions/cache@v4
with:
path: build/sysml-v1tov2
key: sysml-v1tov2-${{ hashFiles('scripts/download-sysml-v1tov2.sh', 'scripts/sysml-v1tov2-pin.sh') }}
- name: Download the SysML v1 to v2 transformation model
run: ./scripts/download-sysml-v1tov2.sh
# The fUML reference implementation's models and jar, checksummed; keyed
# on its download script and pin. Never run in CI: the Go tests read the
# committed expected-record (docs/project/fuml-referee.md).
- name: Cache the fUML reference-implementation suite
uses: actions/cache@v4
with:
path: build/fuml
key: fuml-suite-${{ hashFiles('scripts/download-fuml-suite.sh', 'scripts/fuml-pin.sh') }}
- name: Download the fUML reference-implementation suite
run: ./scripts/download-fuml-suite.sh
# The pilot's XMI of the standard library, one subtree of the release
# repository; keyed on its download script and the shared pilot pin.
- name: Cache the pilot library XMI
uses: actions/cache@v4
with:
path: build/pilot-library-xmi
key: pilot-library-xmi-${{ hashFiles('scripts/download-pilot-library-xmi.sh', 'scripts/pilot-pin.sh') }}
- name: Download the pilot library XMI
run: ./scripts/download-pilot-library-xmi.sh
# The FMI gate's simulator: the reference runner (client/python) is a
# Python subprocess, so the library it drives is installed here, pinned
# and wheel-only like every pip install of this workflow.
- name: Install fmpy
run: pip install --only-binary ":all:" fmpy==0.3.32
# The Modelica Reference-FMUs, checksummed; keyed on the download script
# and its pin. A restored cache is verified by the script's own check.
- name: Cache the Reference-FMUs
uses: actions/cache@v4
with:
path: examples/reference-fmus
key: reference-fmus-${{ hashFiles('scripts/download-reference-fmus.sh', 'scripts/reference-fmus-pin.sh') }}
- name: Download the Reference-FMUs
run: ./scripts/download-reference-fmus.sh
# Per-package timeout: under -race the runtime package runs 22-29 minutes on
# these runners. Matches `make test-shard`.
- name: Run Go race tests
env:
SHARD: ${{ matrix.shard }}
run: make test-shard SHARD="$SHARD"
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.shard }}
path: coverage.txt
if-no-files-found: error
race-coverage:
name: Go race coverage
needs: race-tests
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 5
# The shard package sets are disjoint, so their blocks concatenate under one mode line.
steps:
- name: Download shard profiles
uses: actions/download-artifact@v4
with:
pattern: coverage-*
path: shards
- name: Merge the shard profiles
run: |
set -euo pipefail
profiles=(shards/coverage-*/coverage.txt)
# One per race-tests shard.
if [ "${#profiles[@]}" -ne 4 ]; then echo "error: expected 4 shard profiles, found ${#profiles[@]}" >&2; exit 1; fi
for f in "${profiles[@]}"; do
[ "$(head -n 1 "$f")" = "mode: atomic" ] || { echo "error: $f is not an atomic-mode profile" >&2; exit 1; }
done
{ echo "mode: atomic"; for f in "${profiles[@]}"; do tail -n +2 "$f"; done; } > coverage.txt
wc -l coverage.txt
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.txt
if-no-files-found: error
static-and-integrity:
name: Go static and integrity checks
needs: changes
if: needs.changes.outputs.go == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 30
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Download Go modules
run: go mod download
- name: Install Z3
run: |
sudo apt-get update
sudo apt-get install -y z3
z3 --version
- name: Install cvc5
run: |
curl -fsSL --proto '=https' --proto-redir '=https' -o /tmp/cvc5.zip \
https://github.com/cvc5/cvc5/releases/download/cvc5-1.3.4/cvc5-Linux-x86_64-static.zip
echo "dcdbfada0ce493ee98259c0816e0daafc561c223aadb3af298c2968e73ea39c6 /tmp/cvc5.zip" | sha256sum --check --strict
unzip -p /tmp/cvc5.zip '*/bin/cvc5' > /tmp/cvc5-bin
sudo install -m 0755 /tmp/cvc5-bin /usr/local/bin/cvc5
cvc5 --version | head -1
# Every corpus below comes through this downloader, so it is checked first.
- name: Test the pilot downloader
run: scripts/pilot-pin-test.sh
# install.sh and install.ps1 against a release served from localhost.
- name: Test the install scripts
run: scripts/install-test.sh
- name: Cache the OMG training corpus
uses: actions/cache@v4
with:
path: examples/sysml-v2-training
key: training-corpus-${{ hashFiles('scripts/download-training-examples.sh', 'scripts/pilot-pin.sh') }}
- name: Download the OMG training corpus
run: ./scripts/download-training-examples.sh
- name: Verify the OMG training corpus
run: |
count=$(find examples/sysml-v2-training -name '*.sysml' | wc -l)
echo "training corpus: $count .sysml files"
if [ "$count" -eq 0 ]; then
echo "error: the training corpus is empty; the corpus gate would not run" >&2
exit 1
fi
- name: Cache the OMG pilot corpora
uses: actions/cache@v4
with:
path: examples/pilot-corpora
key: pilot-corpora-${{ hashFiles('scripts/download-pilot-corpora.sh', 'scripts/pilot-pin.sh') }}
- name: Download the OMG pilot corpora
run: ./scripts/download-pilot-corpora.sh
- name: Verify the OMG pilot corpora
run: |
for root in sysml-examples sysml-validation kerml-examples; do
count=$(find "examples/pilot-corpora/$root" -type f \( -name '*.sysml' -o -name '*.kerml' \) | wc -l)
echo "pilot corpus $root: $count model files"
if [ "$count" -eq 0 ]; then
echo "error: pilot corpus $root is empty; the corpora gate would not run" >&2
exit 1
fi
done
- name: Cache the OMG PSSM test suite
uses: actions/cache@v4
with:
path: build/pssm
key: pssm-suite-${{ hashFiles('scripts/download-pssm-suite.sh', 'scripts/pssm-pin.sh') }}
- name: Download the OMG PSSM test suite
run: ./scripts/download-pssm-suite.sh
- name: Cache the SysML v1 to v2 transformation model
uses: actions/cache@v4
with:
path: build/sysml-v1tov2
key: sysml-v1tov2-${{ hashFiles('scripts/download-sysml-v1tov2.sh', 'scripts/sysml-v1tov2-pin.sh') }}
- name: Download the SysML v1 to v2 transformation model
run: ./scripts/download-sysml-v1tov2.sh
- name: Cache the fUML reference-implementation suite
uses: actions/cache@v4
with:
path: build/fuml
key: fuml-suite-${{ hashFiles('scripts/download-fuml-suite.sh', 'scripts/fuml-pin.sh') }}
- name: Download the fUML reference-implementation suite
run: ./scripts/download-fuml-suite.sh
# The pilot's XMI of the standard library, one subtree of the release
# repository; keyed on its download script and the shared pilot pin.
- name: Cache the pilot library XMI
uses: actions/cache@v4
with:
path: build/pilot-library-xmi
key: pilot-library-xmi-${{ hashFiles('scripts/download-pilot-library-xmi.sh', 'scripts/pilot-pin.sh') }}
- name: Download the pilot library XMI
run: ./scripts/download-pilot-library-xmi.sh
- name: Check Go formatting
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "The following files are not gofmt'd:"
echo "$unformatted"
exit 1
fi
- name: Run Go vet
run: |
go vet ./...
go vet -C tools ./...
- name: Vet and test the production sysml build (-tags sysml_prod)
run: |
go vet -tags sysml_prod ./cmd/sysml/... ./internal/frontend/repl/...
go test -count=1 -tags sysml_prod ./cmd/sysml -run TestProdBuild
- name: Run static analysis (staticcheck + gosec)
run: make lint
# The embedded library snapshot is generated from the bundled OMG files;
# a change to either without regenerating it must not land.
- name: Check the library snapshot is current
run: make stdlib-snapshot-check
- name: Check grpc-go stays out of production code
run: ./scripts/check-grpc-imports.sh
- name: Lint the protobuf schema
run: make proto-lint
# Wire compatibility against the branch this pull request merges into;
# the baseline is a git archive, so a shallow fetch of it is enough.
- name: Check the protobuf schema for breaking changes
env:
BASE_REF: ${{ github.base_ref }}
run: |
git fetch --no-tags --depth=1 origin "$BASE_REF"
make proto-breaking BUF_BREAKING_REF="origin/$BASE_REF"
# Race shards skip tests gated here; keep Makefile RACE_SHARD_SKIP and RACE_SHARD_TOOLS_SKIP in sync.
# Re-run the corpus gate on its own so its verdict is legible in the log
# and a skip is impossible to miss. TestCorpusGates is the shared
# cache-independence case over all four OMG roots, which skips with them.
- name: Run training corpus gate
run: |
set -o pipefail
go test -count=1 -v ./tests/corpus -run 'TestTrainingExamples|TestCorpusGates' | tee corpus-gate.log
grep -E 'training files clean' corpus-gate.log
if grep -qE '^\s*--- SKIP' corpus-gate.log; then
echo "error: the corpus gate skipped" >&2
exit 1
fi
# The pilot corpora gate on its own, for the same reason: its per-root
# verdict lines are the reviewable output, and a skip must not pass.
# It gates our own diagnostics only; the comparison against the reference
# implementation (tools/referee/diff) needs Java validators and is not run here.
- name: Run pilot corpora gate
run: |
set -o pipefail
go test -count=1 -v ./tests/corpus -run 'TestPilotCorpora' | tee pilot-corpora-gate.log
grep -E 'pilot corpus files clean' pilot-corpora-gate.log
if grep -qE '^\s*--- SKIP' pilot-corpora-gate.log; then
echo "error: the pilot corpora gate skipped" >&2
exit 1
fi
# The normative-identity gate alone, for the same reason: its one verdict
# line names the counts, and a skip cannot hide behind a green suite.
- name: Run pilot library identity gate
run: |
set -o pipefail
go test -count=1 -v ./tests/identity -run 'TestPilotLibraryXMI' | tee pilot-library-xmi-gate.log
grep -E 'pilot library XMI: [0-9]+ derived' pilot-library-xmi-gate.log
if grep -qE '^\s*--- SKIP' pilot-library-xmi-gate.log; then
echo "error: the pilot library identity gate skipped" >&2
exit 1
fi
# The PSSM suite gates on their own, so a skip cannot hide behind a green suite.
- name: Run PSSM suite gates
run: |
set -o pipefail
go test -C tools -count=1 -v ./referee/pssm -run 'TestSuiteRead|TestSuiteClassification|TestEmitSuite' | tee pssm-gate.log
if grep -qE '^\s*--- SKIP' pssm-gate.log; then
echo "error: the PSSM suite gate skipped" >&2
exit 1
fi
# Bucket counts only, never pass/fail; see docs/project/pssm-referee.md.
- name: PSSM referee reproduces its baseline counts
run: go run -C tools ./cmd/pssm-referee -check
# The transformation census's baseline lists the mapping classes the
# pinned model declares; here the model is provisioned, so the baseline
# is compared against a fresh extraction.
- name: Transformation census lists what the pinned model contains
run: go run -C tools ./cmd/transformation-census -check -require-xmi
# The migration of the PSSM suite to v2 notation on its own, so its report
# totals are legible in the log and a skip must not pass; see
# docs/project/pssm-migration.md.
- name: Run PSSM migration gate
run: |
set -o pipefail
go test -count=1 -v ./tests/corpus -run 'TestPSSMSuiteMigration' | tee pssm-migration-gate.log
grep -E 'PSSM_TestSuite.xmi: migrated [0-9]+ element' pssm-migration-gate.log
if grep -qE '^\s*--- SKIP' pssm-migration-gate.log; then
echo "error: the PSSM migration gate skipped" >&2
exit 1
fi
# The fUML reader and classifier over the pinned models on their own, likewise.
- name: Run fUML suite gates
run: |
set -o pipefail
go test -C tools -count=1 -v ./referee/fuml -run 'TestSuite' | tee fuml-gate.log
if grep -qE '^\s*--- SKIP' fuml-gate.log; then
echo "error: the fUML suite gate skipped" >&2
exit 1
fi
# Bucket counts only, never pass/fail; see docs/project/fuml-referee.md.
- name: fUML referee reproduces its baseline counts
run: go run -C tools ./cmd/fuml-referee -check
# The RDF round-trip ratchet over every example on its own, so its
# per-verdict counts are legible in the log and a skip must not pass.
# The round-trip gates stay in the race shards too: their worker pool converts files concurrently.
- name: Run RDF corpus round-trip gate
run: |
set -o pipefail
go test -count=1 -v ./tests/corpus -run 'TestCorpusRoundTrip' | tee corpus-roundtrip-gate.log
grep -E 'corpus round trip: [0-9]+ files:' corpus-roundtrip-gate.log
if grep -qE '^\s*--- SKIP' corpus-roundtrip-gate.log; then
echo "error: the RDF corpus round-trip gate skipped" >&2
exit 1
fi
- name: Run api-json corpus round-trip gate
run: |
set -o pipefail
go test -count=1 -v ./tests/corpus -run 'TestCorpusAPIJSONRoundTrip' | tee api-json-roundtrip-gate.log
grep -E 'api-json corpus round trip: [0-9]+ files:' api-json-roundtrip-gate.log
if grep -qE '^\s*--- SKIP' api-json-roundtrip-gate.log; then
echo "error: the api-json corpus round-trip gate skipped" >&2
exit 1
fi
# Re-run the solver gate on its own, as the corpus gate is, so a skip
# cannot hide behind a green suite.
- name: Run solver gate (Z3)
run: |
set -o pipefail
go test -count=1 -v ./internal/exec/solve ./internal/frontend/repl -run 'TestSolver|TestDiscovery|TestSolved|TestDivisor|TestCheck|TestSolve|TestConfigure|TestSynthesis|TestPinned|TestFixed|TestOptimize|TestOptimum' | tee solver-gate.log
if grep -qE '^\s*--- SKIP' solver-gate.log; then
echo "error: a solver-dependent test skipped" >&2
exit 1
fi
# The differential gate compares the solver against the normative
# evaluator; its summary counts make coverage drift reviewable in the log.
- name: Run solver differential gate
run: |
set -o pipefail
go test -count=1 -v ./internal/exec/solve -run TestDifferential | tee differential-gate.log
grep -E 'differential gate .*: .* elements:' differential-gate.log
if grep -qE '^\s*--- SKIP' differential-gate.log; then
echo "error: a differential gate skipped" >&2
exit 1
fi
# Portability: the same subset run against both verified backends, so a
# feature one of them refuses is reported rather than discovered by a user.
# OPENSYSML_REQUIRE_SMT makes an absent solver a failure, not a skip.
- name: Run solver portability gate
run: |
set -o pipefail
for solver in z3 cvc5; do
OPENSYSML_SMT="$solver" go test -count=1 -v ./internal/exec/solve \
-run 'TestPortability' | tee "portability-$solver.log"
grep -E "portability of $solver" "portability-$solver.log"
if grep -qE '^\s*--- SKIP' "portability-$solver.log"; then
echo "error: the portability gate skipped for $solver" >&2
exit 1
fi
done
# The solver gate again against the second backend, not only the
# portability subset: what z3 answers, cvc5 must answer too.
- name: Run solver gate (cvc5)
run: |
set -o pipefail
OPENSYSML_SMT=cvc5 go test -count=1 -v ./internal/exec/solve ./internal/frontend/repl \
-run 'TestSolver|TestDiscovery|TestSolved|TestDivisor|TestCheck|TestSolve|TestConfigure|TestSynthesis|TestPinned|TestFixed|TestExplain|TestCore' \
| tee cvc5-gate.log
if grep -qE '^\s*--- SKIP' cvc5-gate.log; then
echo "error: a solver-dependent test skipped under cvc5" >&2
exit 1
fi
# The other half of the contract: with no solver to be found, every
# solver-dependent test must skip with a reason and the absent-solver paths
# must still report one. OPENSYSML_SMT names an executable that does not
# exist, which is discovery's absent case, and the requirement flag is
# dropped so a skip is the expected outcome here.
- name: Run solver-absent gate
run: |
set -o pipefail
env -u OPENSYSML_REQUIRE_SMT OPENSYSML_SMT=/nonexistent/no-such-solver \
go test -count=1 -v ./internal/exec/solve ./internal/frontend/repl | tee no-solver-gate.log
for name in TestCheckReportsAnAbsentSolver TestExplainReportsAnAbsentSolver \
TestSolveReportsAnAbsentSolver TestConfigureReportsAnAbsentSolver \
TestOptimizeReportsAnAbsentSolver; do
grep -qE "^\s*--- PASS: $name" no-solver-gate.log || {
echo "error: $name did not run without a solver" >&2
exit 1
}
done
wasm-gate:
name: WebAssembly gate
needs: changes
if: needs.changes.outputs.go == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 20
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '24'
# It compiles and vets the whole tree for both wasm targets, links the commands
# and runs them under Node, so a skip has to be visible and has to fail.
- name: Run the WebAssembly gate
run: |
set -o pipefail
node --version
go test -count=1 -v ./tests/wasm | tee wasm-gate.log
if grep -qE '^\s*--- SKIP' wasm-gate.log; then
echo "error: the WebAssembly gate skipped" >&2
exit 1
fi
# The Xpect oracle's committed baseline (docs/project/pilot-xpect-baseline.json)
# used to be reproduced only by the nightly oracle-reproduction workflow, so a
# checker change that moved a verdict surfaced a day after it merged. The check
# needs no Java — only the pinned .xt suites — so it runs here on every change
# that can move it: a rule under internal/ or a re-recorded baseline under docs/.
xpect-oracle:
name: Xpect oracle reproduces its baseline
needs: changes
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.docs == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Cache the pilot Xpect suites
uses: actions/cache@v4
with:
path: build/pilot-xpect-corpus
key: pilot-xpect-corpus-${{ hashFiles('scripts/download-pilot-xpect.sh', 'scripts/pilot-pin.sh') }}
- name: Download the pilot Xpect suites
run: ./scripts/download-pilot-xpect.sh
- name: Xpect oracle reproduces its baseline
run: go run -C tools ./cmd/pilot-xpect -check
# The client jobs download this binary rather than building one, so it runs
# whenever the service or any client does.
build:
name: Build binaries
needs: changes
if: |
needs.changes.outputs.go == 'true' ||
needs.changes.outputs.node == 'true' ||
needs.changes.outputs.python == 'true' ||
needs.changes.outputs.java == 'true' ||
needs.changes.outputs.rust == 'true' ||
needs.changes.outputs.julia == 'true' ||
needs.changes.outputs.matlab == 'true' ||
needs.changes.outputs.mdk == 'true' ||
needs.changes.outputs.syson == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Download Go modules
run: go mod download
- name: Build binaries
run: |
make build \
VERSION="pr-${{ github.event.pull_request.number }}" \
COMMIT="$(git rev-parse --short HEAD)" \
BUILD_TIME="$(date -u '+%Y-%m-%d_%H:%M:%S')" \
GO_VERSION="$(go version | awk '{print $3}')"
- name: Build the combined WebAssembly module
run: |
mkdir -p bin/wasm
GOOS=js GOARCH=wasm go build -trimpath -ldflags="-s -w" \
-o bin/wasm/sysml-wasm.wasm ./cmd/sysml-wasm
cp "$(go env GOROOT)/lib/wasm/wasm_exec.js" bin/wasm/
- name: Verify binaries
run: |
./bin/sysml --version
./bin/sysml-lsp --version
ls -lh bin/
make static-check
- name: Upload binary artifacts
uses: actions/upload-artifact@v4
with:
name: binaries
path: bin/
if-no-files-found: error
# A gated job that did not run reports `skipped`, which this gate accepts; a job
# skipped by a failed dependency is caught through that dependency's own result.
build-and-test:
name: Build and test
if: always()
needs:
- changes
- build
- mdk-plugin
- conformance-pkg
- docs
- java-test
- julia-client
- matlab-client
- syson-plugin
- node-test
- pdf-toolchain
- python-test
- race-tests
- race-coverage
- rust-test
- static-and-integrity
- vscode-extension
- wasm-gate
- xpect-oracle
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 5
steps:
- name: Verify required checks
env:
CHANGES_RESULT: ${{ needs.changes.result }}
BUILD_RESULT: ${{ needs.build.result }}
MDK_PLUGIN_RESULT: ${{ needs.mdk-plugin.result }}
CONFORMANCE_PKG_RESULT: ${{ needs.conformance-pkg.result }}
DOCS_RESULT: ${{ needs.docs.result }}
JAVA_TEST_RESULT: ${{ needs.java-test.result }}
JULIA_CLIENT_RESULT: ${{ needs.julia-client.result }}
MATLAB_CLIENT_RESULT: ${{ needs.matlab-client.result }}
SYSON_PLUGIN_RESULT: ${{ needs.syson-plugin.result }}
NODE_TEST_RESULT: ${{ needs.node-test.result }}
PDF_TOOLCHAIN_RESULT: ${{ needs.pdf-toolchain.result }}
PYTHON_TEST_RESULT: ${{ needs.python-test.result }}
RACE_TESTS_RESULT: ${{ needs.race-tests.result }}
RACE_COVERAGE_RESULT: ${{ needs.race-coverage.result }}
RUST_TEST_RESULT: ${{ needs.rust-test.result }}
STATIC_AND_INTEGRITY_RESULT: ${{ needs.static-and-integrity.result }}
VSCODE_EXTENSION_RESULT: ${{ needs.vscode-extension.result }}
WASM_GATE_RESULT: ${{ needs.wasm-gate.result }}
XPECT_ORACLE_RESULT: ${{ needs.xpect-oracle.result }}
run: |
ok() { [ "$1" = success ] || [ "$1" = skipped ]; }
if [ "$CHANGES_RESULT" != success ] ||
! ok "$BUILD_RESULT" ||
! ok "$MDK_PLUGIN_RESULT" ||
! ok "$CONFORMANCE_PKG_RESULT" ||
! ok "$DOCS_RESULT" ||
! ok "$JAVA_TEST_RESULT" ||
! ok "$JULIA_CLIENT_RESULT" ||
! ok "$MATLAB_CLIENT_RESULT" ||
! ok "$SYSON_PLUGIN_RESULT" ||
! ok "$NODE_TEST_RESULT" ||
! ok "$PDF_TOOLCHAIN_RESULT" ||
! ok "$PYTHON_TEST_RESULT" ||
! ok "$RACE_TESTS_RESULT" ||
! ok "$RACE_COVERAGE_RESULT" ||
! ok "$RUST_TEST_RESULT" ||
! ok "$STATIC_AND_INTEGRITY_RESULT" ||
! ok "$VSCODE_EXTENSION_RESULT" ||
! ok "$WASM_GATE_RESULT" ||
! ok "$XPECT_ORACLE_RESULT"; then
echo "changes=$CHANGES_RESULT"
echo "build=$BUILD_RESULT"
echo "mdk-plugin=$MDK_PLUGIN_RESULT"
echo "conformance-pkg=$CONFORMANCE_PKG_RESULT"
echo "docs=$DOCS_RESULT"
echo "java-test=$JAVA_TEST_RESULT"
echo "julia-client=$JULIA_CLIENT_RESULT"
echo "matlab-client=$MATLAB_CLIENT_RESULT"
echo "syson-plugin=$SYSON_PLUGIN_RESULT"
echo "node-test=$NODE_TEST_RESULT"
echo "pdf-toolchain=$PDF_TOOLCHAIN_RESULT"
echo "python-test=$PYTHON_TEST_RESULT"
echo "race-tests=$RACE_TESTS_RESULT"
echo "race-coverage=$RACE_COVERAGE_RESULT"
echo "rust-test=$RUST_TEST_RESULT"
echo "static-and-integrity=$STATIC_AND_INTEGRITY_RESULT"
echo "vscode-extension=$VSCODE_EXTENSION_RESULT"
echo "wasm-gate=$WASM_GATE_RESULT"
echo "xpect-oracle=$XPECT_ORACLE_RESULT"
exit 1
fi
# The PDF backend drives external tools (WeasyPrint, pandoc, mermaid-cli,
# KaTeX, Graphviz, the PlantUML jar) as subprocesses; the Go suite above
# tests that contract with fakes. This job runs the integration tests
# against the pinned toolchain, with an absent tool a failure, not a skip.
pdf-toolchain:
name: PDF toolchain tests
needs: changes
if: needs.changes.outputs.go == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 20
env:
OPENSYSML_REQUIRE_PDF_TOOLCHAIN: "1"
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
# Keyed on the provisioning script, whose pins and digests are the
# toolchain's identity; the venv is not restored across Python builds.
- name: Cache the PDF toolchain
id: toolchain-cache
uses: actions/cache@v4
with:
path: build/doc-pdf
key: doc-pdf-toolchain-${{ runner.os }}-${{ hashFiles('scripts/download-doc-pdf-toolchain.sh') }}-py${{ steps.setup-python.outputs.python-version }}
# WeasyPrint's venv links against the system's Pango, the browser
# mermaid-cli launches needs its shared libraries, Graphviz's neato
# layout plugin needs GTS; the tests read PDFs back with poppler-utils.
- name: Install the toolchain's system libraries
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libpango-1.0-0 libpangoft2-1.0-0 libharfbuzz-subset0 \
libnss3 libatk-bridge2.0-0 libgbm1 libxkbcommon0 libasound2t64 fonts-dejavu-core libgts-0.7-5 \
poppler-utils
- name: Provision the PDF toolchain
run: ./scripts/download-doc-pdf-toolchain.sh
- name: Run the PDF integration tests
env:
OPENSYSML_PANDOC: ${{ github.workspace }}/build/doc-pdf/pandoc-3.10.2/bin/pandoc
OPENSYSML_WEASYPRINT: ${{ github.workspace }}/build/doc-pdf/weasyprint/bin/weasyprint
OPENSYSML_MMDC: ${{ github.workspace }}/build/doc-pdf/mermaid/node_modules/.bin/mmdc
OPENSYSML_MMDC_PUPPETEER: ${{ github.workspace }}/build/doc-pdf/mermaid/puppeteer.json
OPENSYSML_KATEX: ${{ github.workspace }}/build/doc-pdf/katex/node_modules/.bin/katex
OPENSYSML_DOT: ${{ github.workspace }}/build/doc-pdf/graphviz/bin/dot
OPENSYSML_PLANTUML_JAR: ${{ github.workspace }}/build/doc-pdf/plantuml/plantuml-1.2026.8.jar
OPENSYSML_D2: ${{ github.workspace }}/build/doc-pdf/d2/d2-v0.9.0/bin/d2
run: go test -count=1 -v -run Installed ./internal/ir/view ./internal/doc/docpdf ./tests/migrate
vscode-extension:
name: VS Code extension
needs: changes
if: needs.changes.outputs.vscode == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: editors/vscode/package-lock.json
# Type-check, bundle and package. The generated TextMate grammars are
# gated by go test ./editors/... in the job above.
- name: Package the VS Code extension
run: make vscode-package
- name: Build landing-page diagram bundle
working-directory: editors/vscode
run: npm run build:landing
- name: Upload VS Code extension artifact
uses: actions/upload-artifact@v4
with:
name: vscode-extension
path: editors/vscode/opensysml-sysml.vsix
if-no-files-found: error
mdk-plugin:
name: OpenSysML MDK plugin
needs: [changes, build]
if: needs.changes.outputs.mdk == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: binaries
path: bin
# 17 is the plugin's compile target (the oldest supported Cameo runs on it).
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'