Skip to content

Improve error handling and code robustness: - Add proper timeout impl… #31

Improve error handling and code robustness: - Add proper timeout impl…

Improve error handling and code robustness: - Add proper timeout impl… #31

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [created]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
fail-fast: false # Continue with other versions even if one fails
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
qtbase5-dev \
qttools5-dev-tools \
libxkbcommon-x11-0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
xvfb
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
# Install test dependencies first
python -m pip install pytest pytest-qt pytest-xvfb
# Install requirements first
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
# Then install package in development mode
python -m pip install -v -e .
# List installed packages for debugging
python -m pip list
- name: Run linting
run: |
black . --check --diff
flake8 . --count --show-source --statistics
continue-on-error: true # Make linting optional for now
- name: Run tests with xvfb
env:
QT_DEBUG_PLUGINS: 1
PYTHONPATH: ${{ github.workspace }}
run: |
# Print Python path and current directory
echo "PYTHONPATH: $PYTHONPATH"
echo "Current directory: $(pwd)"
echo "Directory contents:"
ls -la
# Run tests with maximum verbosity
xvfb-run --auto-servernum pytest -vv --tb=long
publish:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m build
twine upload dist/*