Skip to content

Commit

Permalink
ci: include basic testing running and drop python v3.12 support
Browse files Browse the repository at this point in the history
Signed-off-by: Sietze van Buuren <[email protected]>
  • Loading branch information
swvanbuuren committed Nov 27, 2024
1 parent f1217f5 commit f130c00
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Workflow for pull requests to master branch

name: Pull Request workflow

on:
pull_request:
branches:
- master

jobs:
lint-and-test:
uses: ./.github/workflows/test-and-lint.yaml
4 changes: 4 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ on:
- master

jobs:
test-and-lint:
uses: ./.github/workflows/test-and-lint.yaml

release:
name: Semantic Release
runs-on: ubuntu-latest
concurrency: push
needs: [test-and-lint]
if: github.repository == 'swvanbuuren/mlpyqtgraph'
environment:
name: pypi
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/test-and-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Lint and test

on:
workflow_call:

jobs:
lint-and-test:
name: Lint and test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
env:
DISPLAY: ':99.0'
QT_SELECT: "qt6"
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install the project
run: |
uv sync
# Commented out because linter rules violations are not fixed yet
# - name: Lint with ruff
# run: |
# uv run ruff check ${{ github.event.repository.name }}

- name: Install test dependencies
run: |
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 libxcb-shape0 libglib2.0-0 libgl1-mesa-dev
sudo apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
# start xvfb in the background
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1920x1080x24 &
- name: Test with pytest
run: |
uv run pytest -v -s
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
urls = { Homepage = "https://github.com/swvanbuuren/mlpyqtgraph" }
dependencies = [
"pyqtgraph",
"pqthreads==0.4.1",
"pyopengl",
"pyopengl"
]

[dependency-groups]
Expand Down

0 comments on commit f130c00

Please sign in to comment.