Skip to content

[test] fix x11 problems #198

[test] fix x11 problems

[test] fix x11 problems #198

Workflow file for this run

name: Tests
on:
push:
branches-ignore: ["main", "master"]
paths:
- 'pytron/**'
- 'tests/**'
- 'pyproject.toml'
pull_request:
branches: ["**"]
paths:
- 'pytron/**'
- 'tests/**'
- 'pyproject.toml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: 🚪 Check for Rust changes
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
rust_native:
- 'pytron/engines/native/**'
- 'pytron/engines/native/Cargo.toml'
rust_loader:
- 'pytron/pack/secure_loader/**'
- 'pytron/pack/secure_loader/Cargo.toml'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- name: 🦀 Install Rust
uses: dtolnay/rust-toolchain@stable
- name: 🕰️ Setup Rust Cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
workspaces: |
pytron/engines/native
pytron/pack/secure_loader
- name: 🐧 Install Linux System Dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y \
libcairo2-dev \
libgirepository1.0-dev \
libglib2.0-dev \
pkg-config \
python3-dev \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
libxdo-dev \
libssl-dev \
libwayland-dev \
libxkbcommon-dev \
libx11-dev \
patchelf
- name: 🍎 Install macOS Dependencies
if: matrix.os == 'macos-latest'
run: |
python -m pip install pyobjc-framework-Quartz pyobjc-framework-Cocoa
# On PRs: fast cargo check to catch compile errors without a full build
- name: 🪶 Fast Rust Check (PRs only)
if: github.event_name == 'pull_request' && (steps.filter.outputs.rust_native == 'true' || steps.filter.outputs.rust_loader == 'true')
shell: bash
run: |
if [ "${{ steps.filter.outputs.rust_native }}" == "true" ]; then
cargo check --manifest-path pytron/engines/native/Cargo.toml
fi
if [ "${{ steps.filter.outputs.rust_loader }}" == "true" ]; then
cargo check --manifest-path pytron/pack/secure_loader/Cargo.toml
fi
- name: 🦾 Build Native Engine
if: steps.filter.outputs.rust_native == 'true' || github.event_name == 'push' || startsWith(github.ref, 'refs/tags/v')
env:
PYO3_PYTHON: python3
run: python pytron/engines/native/build.py
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install pytest pytest-asyncio
- name: Run Tests
run: pytest