Use Ruff + uv for dev tooling + package metadata #16
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: Test | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12", "3.13"] | |
redis-client-version: ["4.6.0", "5.3.0", "6.2.0"] | |
services: | |
redis: | |
image: redis:7 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: true | |
cache-dependency-glob: "requirements*.txt" | |
- name: Set up Python ${{ matrix.python-version }} | |
run: uv python install ${{ matrix.python-version }} | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y lua5.1 luarocks | |
sudo luarocks install luacheck | |
- name: Install Python dependencies | |
run: | | |
uv sync --extra test | |
- name: Install specific Redis version | |
run: | | |
uv pip install redis==${{ matrix.redis-client-version }} | |
- name: Linting | |
run: | | |
uv run ruff check . | |
uv run ruff format --check . | |
luacheck --max-cyclomatic-complexity 11 --globals redis ARGV KEYS -r limitlion | |
- name: Run tests with coverage | |
run: | | |
uv run pytest --cov=limitlion --cov-report=xml | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report-py${{ matrix.python-version }}-redis${{ matrix.redis-client-version }} | |
path: coverage.xml |