forked from slint-ui/slint
-
Notifications
You must be signed in to change notification settings - Fork 0
284 lines (270 loc) · 9.98 KB
/
ci.yaml
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
# Copyright © SixtyFPS GmbH <[email protected]>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
build_and_test:
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
SLINT_EXPERIMENTAL_SYNTAX: true
strategy:
matrix:
os: [ubuntu-20.04, macos-11, windows-2022]
rust_version: [stable, "1.60"]
include:
- os: windows-2022
extra_args: "--exclude slint-node --exclude test-driver-nodejs"
exclude:
- os: macos-11
rust_version: "1.60"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-linux-dependencies
# Python 3.11 breaks the neon-sys build
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Qt
if: runner.os != 'Windows'
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2'
setup-python: false
- name: Set default style
if: matrix.os != 'windows-2022'
run: |
echo "SLINT_STYLE=native" >> $GITHUB_ENV
- name: Set default style
if: matrix.os == 'windows-2022'
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/install-nodejs
id: node-install
- uses: ./.github/actions/setup-rust
with:
key: x-v2-${{ steps.node-install.outputs.node-version }} # the cache key consists of a manually bumpable version and the node version, as the cached rustc artifacts contain linking information where to find node.lib, which is in a versioned directory.
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --all-features --workspace ${{ matrix.extra_args }} --exclude test-driver-cpp --exclude mcu-board-support --exclude printerdemo_mcu --exclude carousel # mcu backend requires nightly
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all-features --workspace ${{ matrix.extra_args }} --exclude test-driver-cpp --exclude mcu-board-support --exclude printerdemo_mcu --exclude carousel # mcu backend requires nightly
cpp_test_driver:
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
strategy:
matrix:
os: [ubuntu-20.04, macos-11, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-linux-dependencies
with:
force-gcc-10: true
- name: Install Qt
if: runner.os != 'Windows'
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2'
- 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
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --lib -p slint-cpp --features testing,backend-qt
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose -p test-driver-cpp --features slint-cpp/backend-qt
cpp_cmake:
env:
DYLD_FRAMEWORK_PATH: /Users/runner/work/slint/Qt/6.2.1/clang_64/lib
QT_QPA_PLATFORM: offscreen
CARGO_INCREMENTAL: false
strategy:
matrix:
os: [ubuntu-20.04, macos-11, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-linux-dependencies
with:
force-gcc-10: true
- name: Install Qt (Ubuntu)
uses: jurplel/install-qt-action@v3
if: matrix.os == 'ubuntu-20.04'
with:
version: 5.15.2
- name: Install Qt (cached)
if: matrix.os != 'ubuntu-20.04'
uses: jurplel/install-qt-action@v3
with:
version: 6.2.1
- uses: ./.github/actions/setup-rust
- uses: ilammy/msvc-dev-cmd@v1
- name: Select MSVC (windows)
run: |
echo "CC=cl.exe" >> $GITHUB_ENV
echo "CXX=cl.exe" >> $GITHUB_ENV
if: matrix.os == 'windows-2022'
- name: Enable test coverage for resource embedding in C++ when building examples
if: matrix.os == 'ubuntu-20.04'
run: |
echo "SLINT_EMBED_RESOURCES=true" >> $GITHUB_ENV
- name: C++ Build
uses: lukka/[email protected]
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: CMakeLists.txt
cmakeAppendedArgs: '-DBUILD_TESTING=ON -DSLINT_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Debug'
buildDirectory: ${{ runner.workspace }}/cppbuild
buildWithCMakeArgs: '--config Debug'
- name: ctest
working-directory: ${{ runner.workspace }}/cppbuild
run: ctest --verbose
- name: cpack
working-directory: ${{ runner.workspace }}/cppbuild
run: cmake --build . --config Debug --target package
- name: "Create C++ packages artefact"
uses: actions/upload-artifact@v2
with:
name: cpp_bin-${{ matrix.os }}
path: ${{ runner.workspace }}/cppbuild/Slint-cpp-*
cpp_package_test:
needs: [cpp_cmake]
runs-on: ubuntu-20.04
env:
DYLD_FRAMEWORK_PATH: /Users/runner/work/slint/Qt/6.2.1/clang_64/lib
QT_QPA_PLATFORM: offscreen
CARGO_INCREMENTAL: false
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-linux-dependencies
with:
force-gcc-10: true
- name: Install Qt (Ubuntu)
uses: jurplel/install-qt-action@v3
with:
version: 5.15.2
- uses: actions/download-artifact@v2
with:
name: cpp_bin-ubuntu-20.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/[email protected]
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'
# test to compile the mcu backend with nightly and for the armv6 target (no_std)
mcu:
env:
SLINT_EMBED_GLYPHS: 1
SLINT_FONT_SIZES: 8,11,10,12,13,14,15,16,18,20,22,24,32
SLINT_PROCESS_IMAGES: 1
RUSTFLAGS: --cfg slint_int_coord
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup-rust
with:
toolchain: nightly
target: thumbv6m-none-eabi
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --target=thumbv6m-none-eabi -p printerdemo_mcu --no-default-features --features=mcu-board-support/pico-st7789
docs:
uses: ./.github/workflows/build_docs.yaml
wasm:
uses: ./.github/workflows/wasm_editor_and_interpreter.yaml
wasm_demo:
uses: ./.github/workflows/wasm_demos.yaml
# Checkout a old version of the tests and example, then run the syntax_updater on them
# and check that it worked with the interpreter test.
updater_test:
env:
SLINT_NO_QT: 1
CARGO_INCREMENTAL: false
RUST_BACKTRACE: 1
SLINT_EXPERIMENTAL_SYNTAX: true
strategy:
matrix:
from_version: ['0.3.0']
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
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 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
- 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 --bin syntax_updater -- -i examples/*/*.slint
cargo run --bin syntax_updater -- -i examples/*/*/*.slint
cargo run --bin syntax_updater -- -i tests/cases/*.slint
cargo run --bin syntax_updater -- -i tests/cases/*/*.slint
- name: Show the diff
run: git diff
- name: test
uses: actions-rs/cargo@v1
with:
command: test
# Skip a few tests that rely on private renamed properties.
args: |
--bin 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