forked from constverum/ProxyBroker
-
-
Notifications
You must be signed in to change notification settings - Fork 135
50 lines (46 loc) · 1.75 KB
/
python-test-versions.yml
File metadata and controls
50 lines (46 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# Enhanced with modern ruff toolchain while preserving original matrix testing approach
name: build & test
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
poetry-version: ["1.8.4", "2.1.3"]
steps:
- uses: actions/checkout@v4
- name: Install and configure Poetry
uses: snok/install-poetry@v1.4.1
with:
version: ${{ matrix.poetry-version }}
virtualenvs-in-project: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install library
run: poetry install --no-interaction
- name: Lint with ruff (modern replacement for flake8)
run: |
# Install ruff for fast, comprehensive linting
poetry run pip install ruff
# stop the build if there are Python syntax errors or undefined names
poetry run ruff check . --select=E9,F63,F7,F82 --output-format=github
# comprehensive linting with GitHub integration
poetry run ruff check . --output-format=github
- name: Check code formatting with ruff
run: |
# Verify code is properly formatted (replaces black/isort)
poetry run ruff format --check .
- name: Test with pytest
run: |
# Run full test suite with coverage
poetry run pytest tests/ -v --cov=proxybroker --cov-report=term-missing --cov-fail-under=60