Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,25 @@ name: Release python package
on:
push:
tags:
- "*"
- released

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/checkout@v5
with:
python-version: "3.11"
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Set version
run: poetry version "${{ github.ref_name }}"
persist-credentials: false
- uses: astral-sh/setup-uv@v7
with:
enable-cache: false
python-version: "3.12"
version: "latest"
- run: uv version "${GITHUB_REF_NAME}"
- run: uv build
- name: Release package
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --build
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: uv publish
71 changes: 37 additions & 34 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,65 @@
name: Testing taskiq-redis

on:
push:
branches:
- main
- develop
pull_request:
paths-ignore:
- '*.md'
push:
paths-ignore:
- '*.md'

permissions:
actions: read
contents: read
pull-requests: read

jobs:
lint:
strategy:
matrix:
cmd:
- black
- ruff
- mypy
cmd: [ "black", "ruff", "mypy" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/checkout@v5
with:
persist-credentials: false
- id: setup-uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.11"
cache: "poetry"
enable-cache: true
cache-suffix: "3.12"
version: "latest"
python-version: "3.12"
- name: Install deps
run: poetry install
run: uv sync --all-extras
- name: Run lint check
run: poetry run pre-commit run -a ${{ matrix.cmd }}
run: uv run pre-commit run -a ${{ matrix.cmd }}
pytest:
strategy:
matrix:
py_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
py_version: [ "3.10", "3.11", "3.12", "3.13" ]
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Redis instance and Redis cluster
run: docker compose up -d
- name: Set up Python
uses: actions/setup-python@v2
- name: Set up uv and enable cache
id: setup-uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-suffix: "${{ matrix.py_version }}"
version: "latest"
python-version: "${{ matrix.py_version }}"
- name: Update pip
run: python -m pip install -U pip
- name: Install poetry
run: python -m pip install poetry
- name: Install deps
run: poetry install
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Run pytest check
run: poetry run pytest -vv -n auto --cov="taskiq_redis" .
- name: Generate report
run: poetry run coverage xml
run: uv sync --all-extras
- name: Run pytest
run: uv run pytest -vv -n auto --cov="taskiq_redis" .
- name: Generate coverage report
run: uv run coverage xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
if: matrix.py_version == '3.9'
uses: codecov/codecov-action@v5
if: matrix.py_version == '3.10'
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
rev: v6.0.0
hooks:
- id: check-ast
- id: trailing-whitespace
- id: check-toml
- id: end-of-file-fixer

- repo: https://github.com/asottile/add-trailing-comma
rev: v2.1.0
rev: v4.0.0
hooks:
- id: add-trailing-comma

- repo: local
hooks:
- id: black
name: Format with Black
entry: poetry run black
entry: uv run black
language: system
types: [python]

- id: ruff
name: Run ruff lints
entry: poetry run ruff
entry: uv run ruff
language: system
pass_filenames: false
types: [python]
Expand All @@ -36,6 +36,6 @@ repos:

- id: mypy
name: Validate types with MyPy
entry: poetry run mypy
entry: uv run mypy
language: system
types: [ python ]
Loading