Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/ci_path_filters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ internal: &internal
api_cpp:
- 'api/cpp/**'
- 'tools/compiler/**'
- *ci_config

api_python:
- 'api/python/**'
- *ci_config

api_node:
- 'api/node/**'
- *ci_config

api_rs:
- 'api/rs/**'
- *ci_config

tests:
- 'tests/**'
Expand Down
135 changes: 41 additions & 94 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,106 +79,53 @@ jobs:
save_if: ${{ matrix.save_if }}
timeout_minutes: 120

node_test:
# 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'
env:
RUSTFLAGS: -D warnings
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_INCREMENTAL: false
RUST_BACKTRACE: 1
strategy:
matrix:
os: [ubuntu-22.04, macos-14, windows-2022]

runs-on: ${{ matrix.os }}
uses: ./.github/workflows/node_test_reusable.yaml
with:
name: "Node.js Linux"
os: "ubuntu-22.04"

steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/install-linux-dependencies
- uses: ./.github/actions/install-skia-dependencies
- name: Setup headless display
if: runner.os != 'macOS'
uses: pyvista/setup-headless-display-action@v4
- uses: actions/setup-node@v6
with:
node-version: 20
package-manager-cache: false
id: node-install
- uses: pnpm/[email protected]
with:
version: 10.18.2
- uses: ./.github/actions/setup-rust
with:
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.
- name: Run pnpm install
working-directory: api/node
run: pnpm install --frozen-lockfile
- name: Build node plugin in debug
run: pnpm build:testing
working-directory: api/node
- name: Run node tests
working-directory: api/node
run: pnpm test
- name: Run test-driver-nodejs
# Release is only applied to the harness that drives the node.js invocations, but needed
# to avoid crashing on Windows with what looks like an out of stack exception.
run: cargo test --verbose --release --all-features -p test-driver-nodejs
- name: Check image-filter example
working-directory: examples/imagefilter/node
run: pnpm check

python_test:
node_test_macos:
needs: files-changed
if: needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.api_python == '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_PROFILE_DEV_DEBUG: 0
CARGO_INCREMENTAL: false
RUST_BACKTRACE: full
SLINT_BACKEND: winit
strategy:
matrix:
os: [ubuntu-22.04, macos-14, windows-2022]
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"

runs-on: ${{ matrix.os }}
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"

steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/install-linux-dependencies
- name: Install Qt
if: runner.os == 'Linux'
uses: jurplel/install-qt-action@v4
with:
version: "5.15.2"
setup-python: false
cache: true
- name: Setup headless display
if: runner.os != 'macOS'
uses: pyvista/setup-headless-display-action@v4
- uses: ./.github/actions/setup-rust
with:
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.
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v7
- uses: fjwillemsen/[email protected]
- name: Run python tests
working-directory: api/python/slint
run: nox --default-venv-backend uv
- name: Run mypy
working-directory: api/python/slint
run: uv run mypy -p tests -p slint
- 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
# 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'
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'
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'
uses: ./.github/workflows/python_test_reusable.yaml
with:
name: "Python Windows"
os: "windows-2022"

cpp_test_driver:
needs: files-changed
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/nightly_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,21 @@ jobs:
- uses: ./.github/actions/install-skia-dependencies
- name: Build wgpu_texture demo
run: cargo apk build -p wgpu_texture --target aarch64-linux-android --lib

python:
strategy:
matrix:
os: [ubuntu-22.04, macos-14, windows-2022]
uses: ./.github/workflows/python_test_reusable.yaml
with:
name: "Python ${{ matrix.os }}"
os: ${{ matrix.os }}

node:
strategy:
matrix:
os: [ubuntu-22.04, macos-14, windows-2022]
uses: ./.github/workflows/node_test_reusable.yaml
with:
name: "Node.js ${{ matrix.os }}"
os: ${{ matrix.os }}
62 changes: 62 additions & 0 deletions .github/workflows/node_test_reusable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright © SixtyFPS GmbH <[email protected]>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0

name: Node.js 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:
RUSTFLAGS: -D warnings
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_INCREMENTAL: false
RUST_BACKTRACE: 1


jobs:
node_test:
name: ${{ inputs.name }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/install-linux-dependencies
- uses: ./.github/actions/install-skia-dependencies
- name: Setup headless display
if: runner.os != 'macOS'
uses: pyvista/setup-headless-display-action@v4
- uses: actions/setup-node@v6
with:
node-version: 20
package-manager-cache: false
id: node-install
- uses: pnpm/[email protected]
with:
version: 10.18.2
- uses: ./.github/actions/setup-rust
with:
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.
- name: Run pnpm install
working-directory: api/node
run: pnpm install --frozen-lockfile
- name: Build node plugin in debug
run: pnpm build:testing
working-directory: api/node
- name: Run node tests
working-directory: api/node
run: pnpm test
- name: Run test-driver-nodejs
# Release is only applied to the harness that drives the node.js invocations, but needed
# to avoid crashing on Windows with what looks like an out of stack exception.
run: cargo test --verbose --release --all-features -p test-driver-nodejs
- name: Check image-filter example
working-directory: examples/imagefilter/node
run: pnpm check
64 changes: 64 additions & 0 deletions .github/workflows/python_test_reusable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright © SixtyFPS GmbH <[email protected]>
# 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: winit

jobs:
python_test:
name: ${{ inputs.name }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/install-linux-dependencies
- name: Install Qt
if: runner.os == 'Linux'
uses: jurplel/install-qt-action@v4
with:
version: "5.15.2"
setup-python: false
cache: true
- name: Setup headless display
if: runner.os != 'macOS'
uses: pyvista/setup-headless-display-action@v4
- uses: ./.github/actions/setup-rust
with:
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.
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v7
- uses: fjwillemsen/[email protected]
- name: Run python tests
working-directory: api/python/slint
run: nox --default-venv-backend uv
- name: Run mypy
working-directory: api/python/slint
run: uv run mypy -p tests -p slint
- 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
Loading