-
Notifications
You must be signed in to change notification settings - Fork 984
1078 lines (1024 loc) · 48 KB
/
Copy pathci.yaml
File metadata and controls
1078 lines (1024 loc) · 48 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
# Copyright © SixtyFPS GmbH <info@slint.dev>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
name: CI
on:
workflow_dispatch:
inputs:
full:
type: boolean
default: true
description: "Run full CI including extended tests (false = PR mode with path filtering)"
workflow_call:
inputs:
full:
type: boolean
default: false
secrets:
CLOUDFLARE_API_TOKEN:
required: true
CLOUDFLARE_ACCOUNT_ID:
required: true
CLOUDFLARE_API_TOKEN_2:
required: true
CLOUDFLARE_ACCOUNT_ID_2:
required: true
ANDROID_KEYSTORE_PASSWORD:
required: true
ANDROID_KEYSTORE_BASE64:
required: true
READ_WRITE_PRIVATE_KEY:
required: true
env:
MACOSX_DEPLOYMENT_TARGET: "11.0"
SLINT_COMPILER_DENY_WARNINGS: 1
jobs:
files-changed:
runs-on: ubuntu-latest
timeout-minutes: 1
permissions:
pull-requests: read
outputs:
slint: ${{ inputs.full || steps.filter.outputs.slint == 'true' }}
figma_inspector: ${{ inputs.full || steps.filter.outputs.figma_inspector == 'true' }}
material_components: ${{ inputs.full || steps.filter.outputs.material_components == 'true' }}
safety_docs: ${{ inputs.full || steps.filter.outputs.safety_docs == 'true' }}
internal: ${{ inputs.full || steps.filter.outputs.internal == 'true' }}
api_cpp: ${{ inputs.full || steps.filter.outputs.api_cpp == 'true' }}
api_python: ${{ inputs.full || steps.filter.outputs.api_python == 'true' }}
api_node: ${{ inputs.full || steps.filter.outputs.api_node == 'true' }}
api_rs: ${{ inputs.full || steps.filter.outputs.api_rs == 'true' }}
tests: ${{ inputs.full || steps.filter.outputs.tests == 'true' }}
examples: ${{ inputs.full || steps.filter.outputs.examples == 'true' }}
examples_mcu: ${{ inputs.full || steps.filter.outputs.examples_mcu == 'true' }}
vsce: ${{ inputs.full || steps.filter.outputs.vsce == 'true' }}
slintpad: ${{ inputs.full || steps.filter.outputs.slintpad == 'true' }}
updater_test: ${{ inputs.full || steps.filter.outputs.updater_test == 'true' }}
servo_example: ${{ inputs.full || steps.filter.outputs.servo_example == 'true' }}
bevy_examples: ${{ inputs.full || steps.filter.outputs.bevy_examples == 'true' }}
rust_files: ${{ inputs.full || steps.filter.outputs.rust_files == 'true' }}
steps:
- uses: actions/checkout@v6
if: ${{ !inputs.full }}
- uses: dorny/paths-filter@v4
if: ${{ !inputs.full }}
id: filter
with:
token: ${{ github.token }}
filters: .github/ci_path_filters.yaml
build_and_test:
needs: files-changed
if: ${{ needs.files-changed.outputs.slint == 'true' || needs.files-changed.outputs.examples == 'true' }}
strategy:
matrix:
include:
- os: ubuntu-22.04
name: "Ubuntu 22.04 beta"
rust_version: "beta"
extra_args: "--exclude plotter --exclude material-gallery"
- os: windows-2022
name: "Windows 2022 1.92"
rust_version: "1.92"
extra_args: "--exclude ffmpeg --exclude gstreamer-player --exclude material-gallery"
- os: macos-14
name: "MacOS 14 stable"
rust_version: "stable"
extra_args: "--exclude ffmpeg --exclude gstreamer-player --exclude material-gallery"
uses: ./.github/workflows/build_and_test_reusable.yaml
with:
os: ${{ matrix.os }}
name: ${{ matrix.name }}
rust_version: ${{ matrix.rust_version }}
extra_args: ${{ matrix.extra_args }}
save_if: ${{ github.ref == 'refs/heads/master' }}
# For changes to Slint internals, do a quick test on Linux for Node.js only.
node_test_linux:
needs: files-changed
if: ${{ needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.api_node == 'true' || needs.files-changed.outputs.tests == 'true' }}
uses: ./.github/workflows/node_test_reusable.yaml
with:
name: "Node.js Linux"
os: "ubuntu-22.04"
node_test_macos:
needs: files-changed
if: ${{ needs.files-changed.outputs.api_node == 'true' || needs.files-changed.outputs.tests == 'true' }}
uses: ./.github/workflows/node_test_reusable.yaml
with:
name: "Node.js macOS"
os: "macos-14"
node_test_windows:
needs: files-changed
if: ${{ needs.files-changed.outputs.api_node == 'true' || needs.files-changed.outputs.tests == 'true' }}
uses: ./.github/workflows/node_test_reusable.yaml
with:
name: "Node.js Windows"
os: "windows-2022"
# For changes to Slint internals, do a quick test on Linux for Python only.
python_test_linux:
needs: files-changed
if: ${{ needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.api_python == 'true' || needs.files-changed.outputs.tests == 'true' }}
uses: ./.github/workflows/python_test_reusable.yaml
with:
name: "Python Linux"
os: "ubuntu-22.04"
python_test_macos:
needs: files-changed
if: ${{ needs.files-changed.outputs.api_python == 'true' || needs.files-changed.outputs.tests == 'true' }}
uses: ./.github/workflows/python_test_reusable.yaml
with:
name: "Python macOS"
os: "macos-14"
python_test_windows:
needs: files-changed
if: ${{ needs.files-changed.outputs.api_python == 'true' || needs.files-changed.outputs.tests == 'true' }}
uses: ./.github/workflows/python_test_reusable.yaml
with:
name: "Python Windows"
os: "windows-2022"
cpp_test_driver:
needs: files-changed
if: ${{ needs.files-changed.outputs.api_cpp == 'true' || needs.files-changed.outputs.tests == 'true' }}
env:
DYLD_FRAMEWORK_PATH: /Users/runner/work/slint/Qt/5.15.2/clang_64/lib
QT_QPA_PLATFORM: offscreen
RUSTFLAGS: -D warnings
CARGO_INCREMENTAL: false
RUST_BACKTRACE: 1
CARGO_PROFILE_DEV_DEBUG: 0
strategy:
matrix:
include:
- os: ubuntu-22.04
rust_version: "1.92"
- os: macos-14
rust_version: beta
- os: windows-2022
rust_version: stable
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/install-linux-dependencies
with:
force-gcc-10: true
- name: Install Qt
if: runner.os == 'Linux'
uses: jurplel/install-qt-action@v4
with:
version: "5.15.2"
cache: true
- name: Set default style
if: runner.os != 'Windows'
run: echo "SLINT_STYLE=native" >> $GITHUB_ENV
- name: Set default style
if: runner.os == 'Windows'
run: |
echo "SLINT_STYLE=fluent" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "SLINT_NO_QT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- uses: ./.github/actions/setup-rust
with:
toolchain: ${{ matrix.rust_version }}
- name: Run tests
run: cargo test --verbose -p test-driver-cpp --features slint-cpp/backend-qt
cpp_test_driver_32bit:
needs: files-changed
if: ${{ needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.api_cpp == 'true' || needs.files-changed.outputs.tests == 'true' }}
runs-on: ubuntu-24.04
env:
SLINT_NO_QT: 1
RUSTFLAGS: -D warnings
CARGO_INCREMENTAL: false
RUST_BACKTRACE: 1
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER: gcc
PKG_CONFIG_ALLOW_CROSS: 1
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/install-linux-dependencies
- name: Install 32-bit build dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib libfontconfig-dev:i386
- uses: ./.github/actions/setup-rust
with:
target: i686-unknown-linux-gnu
- name: Run tests
run: cargo test -p test-driver-cpp --target i686-unknown-linux-gnu --no-default-features
cpp_cmake_matrix:
needs: files-changed
if: ${{ needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.api_cpp == 'true' || needs.files-changed.outputs.examples == 'true' }}
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set.outputs.matrix }}
steps:
- id: set
run: |
# Windows runs for internal, api_cpp, or examples changes
# macOS and Ubuntu only run when api_cpp changed
entries='[{"os":"windows-2022","rust_version":"nightly"}]'
if [ "${{ inputs.full }}" = "true" ] || [ "${{ needs.files-changed.outputs.api_cpp }}" = "true" ]; then
entries='[{"os":"windows-2022","rust_version":"nightly"},{"os":"macos-14","rust_version":"1.92"},{"os":"ubuntu-22.04","rust_version":"stable"}]'
fi
echo "matrix={\"include\":$entries}" >> "$GITHUB_OUTPUT"
cpp_cmake:
needs: cpp_cmake_matrix
env:
DYLD_FRAMEWORK_PATH: /Users/runner/work/slint/Qt/6.5.1/clang_64/lib
QT_QPA_PLATFORM: offscreen
CARGO_INCREMENTAL: false
RUST_BACKTRACE: 1
CARGO_PROFILE_DEV_DEBUG: 0
SLINT_EMIT_DEBUG_INFO: 1
strategy:
matrix: ${{ fromJSON(needs.cpp_cmake_matrix.outputs.matrix) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/install-linux-dependencies
with:
force-gcc-10: true
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.5.1
cache: true
- uses: ./.github/actions/setup-rust
with:
toolchain: ${{ matrix.rust_version }}
- uses: ilammy/msvc-dev-cmd@v1
- name: Select MSVC (windows)
if: runner.os == 'Windows'
run: |
echo "CC=cl.exe" >> $GITHUB_ENV
echo "CXX=cl.exe" >> $GITHUB_ENV
- name: Enable test coverage for resource embedding in C++ when building examples
if: matrix.os == 'ubuntu-22.04'
run: |
echo "SLINT_EMBED_RESOURCES=true" >> $GITHUB_ENV
- name: C++ Build
uses: lukka/run-cmake@v3.4
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: CMakeLists.txt
cmakeAppendedArgs: "-DSLINT_BUILD_TESTING=ON -DSLINT_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Debug -DSLINT_FEATURE_RENDERER_SKIA=ON -DSLINT_FEATURE_BACKEND_QT=ON -DSLINT_FEATURE_EXPERIMENTAL=ON -DSLINT_FEATURE_TESTING=ON"
buildDirectory: ${{ runner.workspace }}/cppbuild
buildWithCMakeArgs: "--config Debug"
- name: ctest
working-directory: ${{ runner.workspace }}/cppbuild
run: ctest --verbose -C Debug
- name: cpack
working-directory: ${{ runner.workspace }}/cppbuild
run: cmake --build . --config Debug --target package
- name: "Create C++ packages artifact"
uses: actions/upload-artifact@v7
with:
name: cpp_bin-${{ matrix.os }}
path: ${{ runner.workspace }}/cppbuild/Slint-cpp-*
cpp_package_test:
needs: [cpp_cmake_matrix, cpp_cmake]
if: ${{ always() && !cancelled() && needs.cpp_cmake.result == 'success' && contains(fromJSON(needs.cpp_cmake_matrix.outputs.matrix).include.*.os, 'ubuntu-22.04') }}
runs-on: ubuntu-22.04
env:
QT_QPA_PLATFORM: offscreen
CARGO_INCREMENTAL: false
CARGO_PROFILE_DEV_DEBUG: 0
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/install-linux-dependencies
with:
force-gcc-10: true
- name: Install Qt (Ubuntu)
uses: jurplel/install-qt-action@v4
with:
version: 6.5.1
cache: true
- uses: actions/download-artifact@v8
with:
name: cpp_bin-ubuntu-22.04
path: cpp-package
- name: unpack package
run: |
mkdir package
tar xvf cpp-package/Slint-cpp-*.tar.gz -C package --strip-components=1
echo "CMAKE_PREFIX_PATH=`pwd`/package" >> $GITHUB_ENV
# Build the examples with a config different than the package (which is debug)
- name: Build examples
uses: lukka/run-cmake@v3.4
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: examples/CMakeLists.txt
cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release -DSLINT_FEATURE_INTERPRETER=1 -DSLINT_FEATURE_BACKEND_QT=1"
buildDirectory: ${{ runner.workspace }}/examples/build
buildWithCMakeArgs: "--config Release"
vsce_build_test:
needs: files-changed
if: ${{ needs.files-changed.outputs.vsce == 'true' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6.0.3
with:
version: 10.29.3
- uses: Swatinem/rust-cache@v2
with:
key: "vsce_1" # increment this to bust the cache if needed
- uses: ./.github/actions/install-linux-dependencies
- uses: actions/setup-node@v6
with:
node-version: 24
package-manager-cache: false
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Fake slint-lsp build
run: |
mkdir -p target/debug
echo 1 > target/debug/slint-lsp
- name: Run pnpm install
working-directory: editors/vscode
run: pnpm install --frozen-lockfile
- name: vscode prebuild
working-directory: editors/vscode
run: pnpm vscode:prepublish
- name: Build VS Code extension
working-directory: editors/vscode
run: pnpm local-package
- name: Typescript syntax check # has to run after the build as it depends on the wasm
working-directory: editors/vscode
run: pnpm type-check
- name: Check tmGrammar
working-directory: editors/vscode
run: pnpm test_grammar
# test to compile the mcu backend for the arm target (no_std)
mcu:
needs: files-changed
if: ${{ needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.examples_mcu == 'true' || needs.files-changed.outputs.api_rs == 'true' }}
env:
SLINT_FONT_SIZES: 8,11,10,12,13,14,15,16,18,20,22,24,32
RUSTFLAGS: --cfg slint_int_coord -D warnings
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_PROFILE_RELEASE_OPT_LEVEL: s
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- feature: pico-st7789
target: thumbv6m-none-eabi
- feature: pico2-st7789
target: thumbv8m.main-none-eabihf
- feature: pico2-touch-lcd-2-8
target: thumbv8m.main-none-eabihf
- feature: stm32h735g
target: thumbv7em-none-eabihf
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-rust
with:
target: ${{matrix.target}}
- name: Check
run: cargo check --target=${{matrix.target}} -p printerdemo_mcu --no-default-features --features=mcu-board-support/${{matrix.feature}} --release
# test to compile the mcu backend for the arm target (no_std) using embassy
mcu-embassy:
needs: files-changed
if: ${{ needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.examples_mcu == 'true' || needs.files-changed.outputs.api_rs == 'true' }}
env:
SLINT_FONT_SIZES: 8,11,10,12,13,14,15,16,18,20,22,24,32
RUSTFLAGS: --cfg slint_int_coord -D warnings
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_PROFILE_RELEASE_OPT_LEVEL: s
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-rust
with:
target: thumbv8m.main-none-eabihf
- name: Check
working-directory: examples/mcu-embassy
run: cargo check --bin ui_mcu --target=thumbv8m.main-none-eabihf --no-default-features --features="mcu-embassy/mcu" --release
# mcu_esp:
# env:
# RUSTFLAGS: -D warnings
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v6
# - uses: dtolnay/rust-toolchain@stable
# - uses: esp-rs/xtensa-toolchain@v1.7
# with:
# default: true
# buildtargets: esp32
# ldproxy: false
# - uses: Swatinem/rust-cache@v2
# - name: S3Box
# run: cargo +esp check -p printerdemo_mcu --target xtensa-esp32s3-none-elf --no-default-features --features=mcu-board-support/esp32-s3-box --config examples/mcu-board-support/esp32_s3_box/cargo-config.toml --release
ffi_32bit_build:
needs: files-changed
if: ${{ needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.api_cpp == 'true' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-rust
with:
target: armv7-unknown-linux-gnueabihf
- uses: baptiste0928/cargo-install@v3
with:
crate: cross
- name: Check
run: cross check --target=armv7-unknown-linux-gnueabihf -p slint-cpp --no-default-features --features=testing,interpreter,std
docs:
needs: files-changed
if: ${{ !inputs.full && needs.files-changed.outputs.slint == 'true' }}
uses: ./.github/workflows/build_docs.yaml
secrets:
READ_WRITE_PRIVATE_KEY: ${{ secrets.READ_WRITE_PRIVATE_KEY }}
CLOUDFLARE_API_TOKEN_2: ${{ secrets.CLOUDFLARE_API_TOKEN_2 }}
CLOUDFLARE_ACCOUNT_ID_2: ${{ secrets.CLOUDFLARE_ACCOUNT_ID_2 }}
with:
release: false
app-id: ${{ vars.READ_WRITE_APP_ID }}
slintpad:
needs: files-changed
if: ${{ !inputs.full && needs.files-changed.outputs.slintpad == 'true' }}
uses: ./.github/workflows/wasm_editor_and_interpreter.yaml
secrets:
CLOUDFLARE_API_TOKEN_2: ${{ secrets.CLOUDFLARE_API_TOKEN_2 }}
CLOUDFLARE_ACCOUNT_ID_2: ${{ secrets.CLOUDFLARE_ACCOUNT_ID_2 }}
wasm_demo:
needs: files-changed
if: ${{ needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.examples == 'true' || needs.files-changed.outputs.api_rs == 'true' }}
uses: ./.github/workflows/wasm_demos.yaml
with:
build_artifacts: false
tree-sitter:
needs: files-changed
if: ${{ needs.files-changed.outputs.slint == 'true' }}
uses: ./.github/workflows/tree_sitter.yaml
with:
latest: false
tag: "v0.26.5"
# Checkout a old version of the tests and example, then run the slint-updater on them
# and check that it worked with the interpreter test.
updater_test:
needs: files-changed
if: ${{ needs.files-changed.outputs.updater_test == 'true' }}
env:
SLINT_NO_QT: 1
CARGO_INCREMENTAL: false
RUST_BACKTRACE: 1
CARGO_PROFILE_DEV_DEBUG: 0
strategy:
matrix:
from_version: ["0.3.0"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: ./.github/actions/install-linux-dependencies
- uses: ./.github/actions/setup-rust
- name: Checkout old version
run: |
git checkout v${{ matrix.from_version }} --no-overlay -- examples
git checkout v${{ matrix.from_version }} --no-overlay -- tests/cases
git checkout v${{ matrix.from_version }} --no-overlay -- tests/helper_components
# Remove examples and demos from the workspace because they may no longer exist or their Cargo.toml might prevent the build of the updater
sed -i "/examples/d" Cargo.toml
sed -i "/demos/d" Cargo.toml
- name: "Commit old checkout"
run: |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
git commit -a -m "REVERT TESTS TO v${{ matrix.from_version }}"
- name: run the updater
run: |
cargo run -p slint-updater -- -i examples/*/*.slint
cargo run -p slint-updater -- -i examples/*/*/*.slint
cargo run -p slint-updater -- -i tests/cases/*.slint
cargo run -p slint-updater -- -i tests/cases/*/*.slint
- name: Show the diff
run: git diff
- name: test
# Skip a few tests that rely on private renamed properties.
# Skip the tests which makes two way binding to output property (these are warning in previous version)
# Skip the test that use impure functions in property bindings (this is also warning in previous version)
# Skip the example that did not exist or that are broken
# Skip the path layout related tests as the element has been removed
# Skip the booker as it use api from the LineEdit that wasn"t meant to be used
run: |
cargo test -p test-driver-interpreter -- \
--skip test_interpreter_text_cursor_move \
--skip test_interpreter_text_cursor_move_grapheme \
--skip test_interpreter_text_cut \
--skip test_interpreter_text_select_all \
--skip test_interpreter_text_surrogate_cursor \
--skip test_interpreter_text_text_change \
--skip test_interpreter_crashes_layout_deleted_item \
--skip test_interpreter_focus_focus_change_subcompo \
--skip test_interpreter_focus_focus_change_through_signal \
--skip test_interpreter_globals_alias_to_global \
--skip test_interpreter_text_default_color \
--skip test_interpreter_crashes_issue1271_set_in_if \
--skip test_interpreter_models_assign_equal_model \
--skip example_carousel \
--skip example_fancy_demo \
--skip example_dial \
--skip example_fancy_switches \
--skip example_sprite_sheet \
--skip example_grid_model_rows \
--skip example_grid_with_repeated_rows \
--skip example_vector_as_grid \
--skip example_vlayout \
--skip example_flexbox_interactive \
--skip test_interpreter_elements_path_fit \
--skip test_interpreter_layout_path \
--skip test_interpreter_7guis_booker \
# Test that the formater don't introduce slint compilation error
fmt_test:
needs: files-changed
if: ${{ needs.files-changed.outputs.slintpad == 'true' || needs.files-changed.outputs.tests == 'true' }}
env:
SLINT_NO_QT: 1
CARGO_INCREMENTAL: false
RUST_BACKTRACE: 1
CARGO_PROFILE_DEV_DEBUG: 0
RUSTFLAGS: -D warnings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/install-linux-dependencies
- uses: ./.github/actions/setup-rust
- name: run the formatter
run: |
cargo run -p slint-lsp --no-default-features -- format -i tests/cases/**/*.slint
cargo run -p slint-lsp --no-default-features -- format -i examples/**/*.slint
- name: Show the diff
run: git diff
- name: Run the intepreter test to make sure that the test are passing after format
run: cargo test -p test-driver-interpreter
- name: "Commit changes"
run: |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
git commit -a -m "Run slint-lsp format"
- name: Do another pass to check that it is idempotent
run: |
cargo run -p slint-lsp --no-default-features -- format -i tests/cases/**/*.slint
cargo run -p slint-lsp --no-default-features -- format -i examples/**/*.slint
git diff --exit-code
esp-idf-matrix:
needs: files-changed
if: ${{ needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.api_cpp == 'true' || needs.files-changed.outputs.examples == 'true' }}
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set.outputs.matrix }}
steps:
- id: set
run: |
# v5.2 always runs; v5.5 only in full mode
entries='[{"esp-idf-version":"release-v5.2","idf-extra-args":""}]'
if [ "${{ inputs.full }}" = "true" ]; then
entries='[{"esp-idf-version":"release-v5.2","idf-extra-args":""},{"esp-idf-version":"release-v5.5","idf-extra-args":"-D SLINT_ESP_LOCAL_EXAMPLE=OFF"}]'
fi
echo "matrix={\"include\":$entries}" >> "$GITHUB_OUTPUT"
esp-idf:
needs: esp-idf-matrix
strategy:
matrix: ${{ fromJSON(needs.esp-idf-matrix.outputs.matrix) }}
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.esp-idf-version }}
steps:
- name: Fix up pydantic regression (https://github.com/espressif/idf-component-manager/issues/97#issuecomment-3380777944)
run: |
. ${IDF_PATH}/export.sh
cd $IDF_PYTHON_ENV_PATH
bin/pip install pydantic==2.11.10
- uses: actions/checkout@v6
- run: apt-get update && apt-get install -y libfontconfig1-dev
- uses: dtolnay/rust-toolchain@stable
- uses: esp-rs/xtensa-toolchain@v1.7
with:
default: true
buildtargets: esp32
ldproxy: false
- uses: Swatinem/rust-cache@v2
- name: Build and Test Printer demo
shell: bash
working-directory: demos/printerdemo_mcu/esp-idf
run: |
. ${IDF_PATH}/export.sh
idf.py ${{ matrix.idf-extra-args }} build
- name: Build and Test Carousel example s3 box
if: ${{ inputs.full }}
shell: bash
working-directory: examples/carousel/esp-idf/s3-box
run: |
. ${IDF_PATH}/export.sh
idf.py -D SLINT_ESP_LOCAL_EXAMPLE=OFF build
android:
needs: files-changed
if: ${{ needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.api_rs == 'true' || needs.files-changed.outputs.examples == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/install-linux-dependencies
- name: Install Android API level 30
run: ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "platforms;android-30"
- name: Cache cargo-apk
id: cargo-apk-cache
uses: actions/cache@v5
with:
path: ~/.cargo/bin/cargo-apk
key: cargo-apk-cache
# Only build cargo-apk if not cached
- uses: dtolnay/rust-toolchain@stable
if: steps.cargo-apk-cache.outputs.cache-hit != 'true'
- name: Install cargo-apk
if: steps.cargo-apk-cache.outputs.cache-hit != 'true'
run: cargo install cargo-apk
- uses: ./.github/actions/setup-rust
with:
target: aarch64-linux-android
- name: Build todo demo
run: cargo apk build -p todo --target aarch64-linux-android --lib
- name: Build energy-monitor example
run: cargo apk build -p energy-monitor --target aarch64-linux-android --lib
- name: Build printerdemo example
run: cargo apk build -p printerdemo --target aarch64-linux-android --lib
- name: Build usecases demo
run: cargo apk build -p usecases --target aarch64-linux-android --lib
android_cpp:
needs: files-changed
if: ${{ needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.api_cpp == 'true' || needs.files-changed.outputs.examples == 'true' }}
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: false
CARGO_PROFILE_DEV_DEBUG: 0
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/install-linux-dependencies
- uses: ./.github/actions/setup-rust
with:
target: aarch64-linux-android
- name: Build Slint and usecases demo for Android (CMake cross-compile)
run: |
cmake -B build-android -S . \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-26 \
-DSLINT_BUILD_EXAMPLES=ON
cmake --build build-android --target usecases
test-figma-inspector:
needs: files-changed
if: ${{ needs.files-changed.outputs.figma_inspector == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
package-manager-cache: false
id: node-install
- uses: pnpm/action-setup@v6.0.3
with:
version: 10.29.3
- name: Run pnpm install
working-directory: tools/figma-inspector
run: pnpm install --frozen-lockfile
- name: Run build
working-directory: tools/figma-inspector
run: pnpm build
- name: Run tests
working-directory: tools/figma-inspector
run: pnpm test
- name: Type Check
working-directory: tools/figma-inspector
run: pnpm type-check
- name: Build zip
working-directory: tools/figma-inspector
run: pnpm zip
- name: Archive zip
uses: actions/upload-artifact@v7
with:
name: figma-plugin
path: tools/figma-inspector/zip
material-components:
needs: files-changed
if: ${{ needs.files-changed.outputs.material_components == 'true' }}
permissions:
contents: read
deployments: write
uses: ./.github/workflows/material.yaml
secrets:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN_2: ${{ secrets.CLOUDFLARE_API_TOKEN_2 }}
CLOUDFLARE_ACCOUNT_ID_2: ${{ secrets.CLOUDFLARE_ACCOUNT_ID_2 }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
safety-docs:
needs: files-changed
if: ${{ needs.files-changed.outputs.safety_docs == 'true' }}
uses: ./.github/workflows/safety_docs.yaml
secrets:
CLOUDFLARE_API_TOKEN_2: ${{ secrets.CLOUDFLARE_API_TOKEN_2 }}
CLOUDFLARE_ACCOUNT_ID_2: ${{ secrets.CLOUDFLARE_ACCOUNT_ID_2 }}
servo_example:
needs: files-changed
if: ${{ needs.files-changed.outputs.servo_example == 'true' }}
uses: ./.github/workflows/servo_example.yaml
bevy_examples:
needs: files-changed
if: ${{ needs.files-changed.outputs.bevy_examples == 'true' }}
uses: ./.github/workflows/bevy_examples.yaml
with:
# In full mode, run cargo update to test upstream dependency stability,
# but don't save the cache (would trash it for the next PR run).
update: ${{ inputs.full == true }}
save_if: ${{ inputs.full != true }}
clippy:
needs: files-changed
if: ${{ needs.files-changed.outputs.rust_files == 'true' }}
env:
RUSTFLAGS: -D warnings
CARGO_INCREMENTAL: false
CARGO_PROFILE_DEV_DEBUG: 0
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/install-linux-dependencies
- name: Install ffmpeg and alsa (Linux)
run: sudo apt-get install clang libavcodec-dev libavformat-dev libavutil-dev libavfilter-dev libavdevice-dev libasound2-dev pkg-config
- name: Install gstreamer and libunwind (Linux)
run: sudo apt-get install libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good
- uses: ./.github/actions/setup-rust
- name: Run Clippy
run: ./scripts/run_clippy.sh
# === Extended tests (only in full CI mode) ===
full_build_and_test:
if: ${{ inputs.full }}
strategy:
matrix:
include:
- os: ubuntu-22.04
name: "Ubuntu 22.04 1.92 (cargo update)"
rust_version: "1.92"
extra_args: "--exclude plotter"
- os: windows-2022
name: "Windows 2022 nightly (cargo update)"
rust_version: "nightly"
extra_args: "--exclude ffmpeg --exclude gstreamer-player"
- os: macos-14
name: "MacOS 14 nightly (cargo update)"
rust_version: "nightly"
extra_args: "--exclude ffmpeg --exclude gstreamer-player --exclude plotter"
uses: ./.github/workflows/build_and_test_reusable.yaml
with:
os: ${{ matrix.os }}
name: ${{ matrix.name }}
rust_version: ${{ matrix.rust_version }}
extra_args: ${{ matrix.extra_args }}
update: true
save_if: false
qa-tree-sitter-latest:
if: ${{ inputs.full }}
uses: ./.github/workflows/tree_sitter.yaml
with:
latest: true
qa-yocto-build:
if: ${{ inputs.full }}
strategy:
matrix:
include:
- sdk_url: https://nextcloud.slint.dev/s/SCXYDmEmr45pkak/download/poky-glibc-x86_64-core-image-weston-cortexa57-qemuarm64-toolchain-4.0.9.sh
env_setup: environment-setup-cortexa57-poky-linux
target: aarch64-unknown-linux-gnu
- sdk_url: https://nextcloud.slint.dev/s/BTL5NtLACjgS7Pf/download/poky-glibc-x86_64-core-image-weston-cortexa15t2hf-neon-qemuarm-toolchain-4.0.9.sh
env_setup: environment-setup-cortexa15t2hf-neon-poky-linux-gnueabi
target: armv7-unknown-linux-gnueabihf
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Downgrade cc and ring crate to work around https://github.com/slint-ui/slint/issues/6875
run: |
cargo update -p ring --precise 0.17.9
- name: Fetch Yocto SDK
run: |
# Fetch pre-built SDK built via populate_sdk for core-image-weston with setup from https://github.com/slint-ui/meta-slint/blob/main/.github/workflows/ci.yml
wget -O sdk.sh ${{ matrix.sdk_url }}
chmod +x sdk.sh
./sdk.sh -d ${{ runner.workspace }}/yocto-sdk -y
rm -f sdk.sh
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: ${{ matrix.target }}
- name: C++ Build
run: |
. ${{ runner.workspace }}/yocto-sdk/${{ matrix.env_setup }}
# Only needed for 32-bit arm builds where soft-fp/hard-fp affects header file lookup, hence the need to drag in these flags. See also commit
# f5c3908b7ec5131b7b19ff642b5975660c7484f8
export BINDGEN_EXTRA_CLANG_ARGS=$OECORE_TUNE_CCARGS
mkdir ${{ runner.workspace }}/cppbuild
cmake -GNinja -B ${{ runner.workspace }}/cppbuild -S . -DRust_CARGO_TARGET=${{ matrix.target }} -DSLINT_BUILD_TESTING=ON -DSLINT_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Debug -DSLINT_FEATURE_RENDERER_SKIA=ON -DSLINT_FEATURE_BACKEND_QT=OFF -DSLINT_FEATURE_BACKEND_LINUXKMS=ON -DSLINT_FEATURE_INTERPRETER=ON
cmake --build ${{ runner.workspace }}/cppbuild
mcu_zephyr:
if: ${{ inputs.full }}
strategy:
matrix:
include:
- board: native_sim/native/64
toolchain: nightly
target: x86_64-unknown-linux-gnu
extra-cmake-args: ''
- board: mimxrt1170_evk@B/mimxrt1176/cm7
toolchain: stable
target: thumbv7em-none-eabihf
extra-cmake-args: -DSHIELD=rk055hdmipi4ma0
fail-fast: false
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
with:
path: slint
- name: Install linux dependencies, including Zephyr dependencies
uses: ./slint/.github/actions/install-linux-dependencies
with:
extra-packages: |
git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1
- uses: ./slint/.github/actions/setup-rust
with:
toolchain: ${{matrix.toolchain}}
components: rust-src
target: ${{matrix.target}}
- name: Setup Zephyr project
uses: zephyrproject-rtos/action-zephyr-setup@v1.0.13
with:
app-path: slint
manifest-file-name: demos/zephyr-common/west.yaml
sdk-version: 0.16.8
- name: Export the Zephyr CMake package
run: west zephyr-export
- name: Build for ${{matrix.board}}
run: |
west build -b ${{matrix.board}} -p always slint/demos/printerdemo/zephyr -- -DCMAKE_BUILD_TYPE=Release ${{matrix.extra-cmake-args}}
uefi-demo:
if: ${{ inputs.full }}
env:
CARGO_PROFILE_DEV_DEBUG: 0
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-rust
with:
toolchain: stable
target: x86_64-unknown-uefi
- name: Check
run: cargo check --target=x86_64-unknown-uefi -p uefi-demo
ios:
if: ${{ inputs.full }}
strategy:
matrix:
demo:
- demos/home-automation/rust
- demos/energy-monitor
include:
- demo: demos/home-automation/rust
scheme: "Home Automation"
bundle_id: dev.slint.demos.HomeAutomation
device: iPad Pro 13-inch (M5)
- demo: demos/energy-monitor
scheme: "Energy Monitor"
bundle_id: dev.slint.demos.EnergyMonitor
device: iPhone 17
runs-on: macos-26
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-rust
with:
target: aarch64-apple-ios-sim
- run: brew install xcodegen
- run: xcodegen -s ios-project.yml
working-directory: ${{ matrix.demo }}
- name: "Find Simulator UDID from iOS 26.4 runtime"
run: |
echo "=== Finding device from iOS 26.4 runtime (default Xcode) ==="
DEVICE_LINE=$(xcrun simctl list devices available | grep -A 50 "iOS 26.4" | grep "${{ matrix.device }}" | head -n 1)
if [ -z "$DEVICE_LINE" ]; then
echo "ERROR: Could not find ${{ matrix.device }} in iOS 26.4 runtime"
echo "Available iOS 26.4 devices:"
xcrun simctl list devices available | grep -A 30 "iOS 26.4"
exit 1
fi
DEVICE_UDID=$(echo "$DEVICE_LINE" | sed -n 's/.*(\([A-F0-9-]\{36\}\)).*/\1/p')
if [ -z "$DEVICE_UDID" ]; then
echo "ERROR: Could not extract UDID from line: $DEVICE_LINE"
exit 1
fi
echo "Device: ${{ matrix.device }}"
echo "UDID: $DEVICE_UDID"
echo "SIMULATOR_UDID=$DEVICE_UDID" >> $GITHUB_ENV
- run: xcodebuild -scheme "${{ matrix.scheme }}" -destination "platform=iOS Simulator,id=${{ env.SIMULATOR_UDID }}" build
working-directory: ${{ matrix.demo }}
# This isn't working reliably. Sometimes the simulator doesn't boot, somethings launching fails, and sometimes screenshotting fails.
# - name: "Boot Simulator"
# timeout-minutes: 5
# run: |
# echo "=== Booting simulator by UDID ==="
# echo "Device: ${{ matrix.device }}"
# echo "UDID: ${{ env.SIMULATOR_UDID }}"
# echo "Start time: $(date '+%Y-%m-%d %H:%M:%S')"
#
# set -x # Enable command echoing
# xcrun simctl boot "${{ env.SIMULATOR_UDID }}"
# BOOT_RESULT=$?
# set +x # Disable command echoing
#
# echo "Boot command completed with exit code: $BOOT_RESULT"
# echo ""
#
# echo "=== Simulator state after boot command ==="
# SIMULATOR_STATUS=$(xcrun simctl list devices | grep "${{ env.SIMULATOR_UDID }}")
# echo "$SIMULATOR_STATUS"
#
# if echo "$SIMULATOR_STATUS" | grep -q "(Booted)"; then
# echo "Simulator is booted successfully at: $(date '+%Y-%m-%d %H:%M:%S')"
# else
# echo "ERROR: Simulator failed to boot properly"
# echo "Current status: $SIMULATOR_STATUS"
# exit 1
# fi
# - name: "Install"
# run: |