mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-23 09:19:32 +00:00
Instead of connecting to the X server, let's run the Python tests with the testing backend, like we do for test-driver-rust, test-driver-cpp, etc. When building the Python package, pass --features backend-testing to Cargo, to forward to enabling the backend-testing feature in i-slint-backend-selector. That consequently enables SLINT_BACKEND=testing.
59 lines
2.1 KiB
YAML
59 lines
2.1 KiB
YAML
# 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: Python Test (Reusable)
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
name:
|
|
description: 'Name of the job'
|
|
required: true
|
|
type: string
|
|
os:
|
|
description: 'Operating system to run on'
|
|
required: true
|
|
type: string
|
|
|
|
env:
|
|
DYLD_FRAMEWORK_PATH: /Users/runner/work/slint/Qt/5.15.2/clang_64/lib
|
|
QT_QPA_PLATFORM: offscreen
|
|
RUSTFLAGS: -D warnings
|
|
CARGO_PROFILE_DEV_DEBUG: 0
|
|
CARGO_INCREMENTAL: false
|
|
RUST_BACKTRACE: full
|
|
SLINT_BACKEND: testing
|
|
MATURIN_PEP517_ARGS: --features backend-testing
|
|
|
|
jobs:
|
|
python_test:
|
|
name: ${{ inputs.name }}
|
|
runs-on: ${{ inputs.os }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: ./.github/actions/install-linux-dependencies
|
|
- uses: ./.github/actions/setup-rust
|
|
with:
|
|
key: x-python-v0-${{ 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.
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.12"
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v7
|
|
- name: Build and sync environment
|
|
working-directory: api/python/slint
|
|
run: uv sync
|
|
- name: Run ty
|
|
working-directory: api/python/slint
|
|
run: uvx ty check
|
|
- name: Run ruff linter
|
|
working-directory: api/python/slint
|
|
run: uv tool run ruff check
|
|
- name: Run ruff linter
|
|
working-directory: api/python/briefcase
|
|
run: uv tool run ruff check
|
|
- name: Run python tests
|
|
working-directory: api/python/slint
|
|
run: uv run pytest -s -v
|
|
- name: Run python test driver
|
|
run: cargo test -p test-driver-python
|