Fix compatibility with pygfx #377
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| - name: Install only dev dependencies | |
| run: uv sync --only-group ruff | |
| - name: Lint | |
| run: uv run --no-sync ruff check . | |
| - name: Format | |
| run: uv run --no-sync ruff format --check . | |
| test: | |
| name: Test on ${{ matrix.name }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Linux py39 | |
| pyversion: "3.9" | |
| - name: Linux py310 | |
| pyversion: "3.10" | |
| - name: Linux py311 | |
| pyversion: "3.11" | |
| - name: Linux py312 | |
| pyversion: "3.12" | |
| - name: Linux py313 | |
| pyversion: "3.13" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python ${{ matrix.pyversion }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.pyversion }} | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update -y -qq | |
| sudo apt-get install -y libgles2-mesa-dev | |
| - name: Install dependencies | |
| run: uv sync --all-groups | |
| - name: Test | |
| run: uv run --no-sync pytest -v --cov=observ --cov-report=term-missing tests | |
| env: | |
| QT_QPA_PLATFORM: offscreen | |
| - name: Bench | |
| run: uv run --no-sync pytest -v bench | |
| build: | |
| name: Build and test wheel | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Build wheel | |
| run: uv build | |
| - name: Twine check | |
| run: uv run twine check dist/* | |
| - name: Upload wheel artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: dist | |
| name: dist | |
| publish: | |
| name: Publish to Github and Pypi | |
| runs-on: ubuntu-latest | |
| needs: [lint, test, build] | |
| if: success() && startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download wheel artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist | |
| - name: Release to GitHub | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| files: | | |
| dist/*.tar.gz | |
| dist/*.whl | |
| draft: true | |
| prerelease: false | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_PASSWORD }} |