Repository navigation
59 lines (55 loc) · 2.18 KB
/
Copy pathpython_test_reusable.yaml
File metadata and controls
59 lines (55 loc) · 2.18 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
# 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@v7
- 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 --manifest-path tests/Cargo.toml -p test-driver-python