Skip to content

Commit 5090684

Browse files
committed
CI: Attempt to run python tests only on Linux when doing Slint internal changes
1 parent baf85ae commit 5090684

File tree

4 files changed

+98
-50
lines changed

4 files changed

+98
-50
lines changed

.github/ci_path_filters.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,19 @@ internal: &internal
5252
api_cpp:
5353
- 'api/cpp/**'
5454
- 'tools/compiler/**'
55+
- *ci_config
5556

5657
api_python:
5758
- 'api/python/**'
59+
- *ci_config
5860

5961
api_node:
6062
- 'api/node/**'
63+
- *ci_config
6164

6265
api_rs:
6366
- 'api/rs/**'
67+
- *ci_config
6468

6569
tests:
6670
- 'tests/**'

.github/workflows/ci.yaml

Lines changed: 21 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -128,57 +128,28 @@ jobs:
128128
working-directory: examples/imagefilter/node
129129
run: pnpm check
130130

131-
python_test:
131+
# For changes to Slint internals, do a quick test on Linux for Python only.
132+
python_test_linux:
132133
needs: files-changed
133-
if: needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.api_python == 'true' || needs.files-changed.outputs.tests == 'true'
134-
env:
135-
DYLD_FRAMEWORK_PATH: /Users/runner/work/slint/Qt/5.15.2/clang_64/lib
136-
QT_QPA_PLATFORM: offscreen
137-
RUSTFLAGS: -D warnings
138-
CARGO_PROFILE_DEV_DEBUG: 0
139-
CARGO_INCREMENTAL: false
140-
RUST_BACKTRACE: full
141-
SLINT_BACKEND: winit
142-
strategy:
143-
matrix:
144-
os: [ubuntu-22.04, macos-14, windows-2022]
145-
146-
runs-on: ${{ matrix.os }}
147-
148-
steps:
149-
- uses: actions/checkout@v5
150-
- uses: ./.github/actions/install-linux-dependencies
151-
- name: Install Qt
152-
if: runner.os == 'Linux'
153-
uses: jurplel/install-qt-action@v4
154-
with:
155-
version: "5.15.2"
156-
setup-python: false
157-
cache: true
158-
- name: Setup headless display
159-
if: runner.os != 'macOS'
160-
uses: pyvista/setup-headless-display-action@v4
161-
- uses: ./.github/actions/setup-rust
162-
with:
163-
key: x-napi-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.
164-
- uses: actions/setup-python@v6
165-
with:
166-
python-version: "3.12"
167-
- name: Install uv
168-
uses: astral-sh/setup-uv@v7
169-
- uses: fjwillemsen/[email protected]
170-
- name: Run python tests
171-
working-directory: api/python/slint
172-
run: nox --default-venv-backend uv
173-
- name: Run mypy
174-
working-directory: api/python/slint
175-
run: uv run mypy -p tests -p slint
176-
- name: Run ruff linter
177-
working-directory: api/python/slint
178-
run: uv tool run ruff check
179-
- name: Run ruff linter
180-
working-directory: api/python/briefcase
181-
run: uv tool run ruff check
134+
if: needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.api_python == 'true'
135+
uses: ./.github/workflows/python_test_reusable.yaml
136+
with:
137+
name: "Python Linux"
138+
os: "ubuntu-22.04"
139+
python_test_macos:
140+
needs: files-changed
141+
if: needs.files-changed.outputs.api_python == 'true'
142+
uses: ./.github/workflows/python_test_reusable.yaml
143+
with:
144+
name: "Python macOS"
145+
os: "macos-14-latest"
146+
python_test_windows:
147+
needs: files-changed
148+
if: needs.files-changed.outputs.api_python == 'true'
149+
uses: ./.github/workflows/python_test_reusable.yaml
150+
with:
151+
name: "Python Windows"
152+
os: "windows-2022"
182153

183154
cpp_test_driver:
184155
needs: files-changed

.github/workflows/nightly_tests.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,3 +302,12 @@ jobs:
302302
- uses: ./.github/actions/install-skia-dependencies
303303
- name: Build wgpu_texture demo
304304
run: cargo apk build -p wgpu_texture --target aarch64-linux-android --lib
305+
306+
python:
307+
strategy:
308+
matrix:
309+
os: [ubuntu-22.04, macos-14-latest, windows-2022]
310+
uses: ./.github/workflows/python_test_reusable.yaml
311+
with:
312+
name: "Python ${{ matrix.os }}"
313+
os: ${{ matrix.os }}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright © SixtyFPS GmbH <[email protected]>
2+
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
3+
4+
name: Python Test (Reusable)
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
name:
10+
description: 'Name of the job'
11+
required: true
12+
type: string
13+
os:
14+
description: 'Operating system to run on'
15+
required: true
16+
type: string
17+
18+
env:
19+
DYLD_FRAMEWORK_PATH: /Users/runner/work/slint/Qt/5.15.2/clang_64/lib
20+
QT_QPA_PLATFORM: offscreen
21+
RUSTFLAGS: -D warnings
22+
CARGO_PROFILE_DEV_DEBUG: 0
23+
CARGO_INCREMENTAL: false
24+
RUST_BACKTRACE: full
25+
SLINT_BACKEND: winit
26+
27+
jobs:
28+
python_test:
29+
name: ${{ inputs.name }}
30+
runs-on: ${{ inputs.os }}
31+
steps:
32+
- uses: actions/checkout@v5
33+
- uses: ./.github/actions/install-linux-dependencies
34+
- name: Install Qt
35+
if: runner.os == 'Linux'
36+
uses: jurplel/install-qt-action@v4
37+
with:
38+
version: "5.15.2"
39+
setup-python: false
40+
cache: true
41+
- name: Setup headless display
42+
if: runner.os != 'macOS'
43+
uses: pyvista/setup-headless-display-action@v4
44+
- uses: ./.github/actions/setup-rust
45+
with:
46+
key: x-napi-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.
47+
- uses: actions/setup-python@v6
48+
with:
49+
python-version: "3.12"
50+
- name: Install uv
51+
uses: astral-sh/setup-uv@v7
52+
- uses: fjwillemsen/[email protected]
53+
- name: Run python tests
54+
working-directory: api/python/slint
55+
run: nox --default-venv-backend uv
56+
- name: Run mypy
57+
working-directory: api/python/slint
58+
run: uv run mypy -p tests -p slint
59+
- name: Run ruff linter
60+
working-directory: api/python/slint
61+
run: uv tool run ruff check
62+
- name: Run ruff linter
63+
working-directory: api/python/briefcase
64+
run: uv tool run ruff check

0 commit comments

Comments
 (0)