|
1 | 1 | name: Testing taskiq-redis |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - main |
7 | | - - develop |
8 | 4 | pull_request: |
| 5 | + paths-ignore: |
| 6 | + - '*.md' |
| 7 | + push: |
| 8 | + paths-ignore: |
| 9 | + - '*.md' |
| 10 | + |
| 11 | +permissions: |
| 12 | + actions: read |
| 13 | + contents: read |
| 14 | + pull-requests: read |
9 | 15 |
|
10 | 16 | jobs: |
11 | 17 | lint: |
12 | 18 | strategy: |
13 | 19 | matrix: |
14 | | - cmd: |
15 | | - - black |
16 | | - - ruff |
17 | | - - mypy |
| 20 | + cmd: [ "black", "ruff", "mypy" ] |
18 | 21 | runs-on: ubuntu-latest |
19 | 22 | steps: |
20 | | - - uses: actions/checkout@v4 |
21 | | - - name: Install poetry |
22 | | - run: pipx install poetry |
23 | | - - name: Set up Python |
24 | | - uses: actions/setup-python@v4 |
| 23 | + - uses: actions/checkout@v5 |
| 24 | + with: |
| 25 | + persist-credentials: false |
| 26 | + - id: setup-uv |
| 27 | + uses: astral-sh/setup-uv@v7 |
25 | 28 | with: |
26 | | - python-version: "3.11" |
27 | | - cache: "poetry" |
| 29 | + enable-cache: true |
| 30 | + cache-suffix: "3.12" |
| 31 | + version: "latest" |
| 32 | + python-version: "3.12" |
28 | 33 | - name: Install deps |
29 | | - run: poetry install |
| 34 | + run: uv sync --all-extras |
30 | 35 | - name: Run lint check |
31 | | - run: poetry run pre-commit run -a ${{ matrix.cmd }} |
| 36 | + run: uv run pre-commit run -a ${{ matrix.cmd }} |
32 | 37 | pytest: |
33 | 38 | strategy: |
34 | 39 | matrix: |
35 | | - py_version: ["3.9", "3.10", "3.11", "3.12", "3.13"] |
| 40 | + py_version: [ "3.10", "3.11", "3.12", "3.13" ] |
36 | 41 | runs-on: "ubuntu-latest" |
37 | 42 | steps: |
38 | | - - uses: actions/checkout@v4 |
| 43 | + - uses: actions/checkout@v5 |
39 | 44 | - name: Set up Redis instance and Redis cluster |
40 | 45 | run: docker compose up -d |
41 | | - - name: Set up Python |
42 | | - uses: actions/setup-python@v2 |
| 46 | + - name: Set up uv and enable cache |
| 47 | + id: setup-uv |
| 48 | + uses: astral-sh/setup-uv@v7 |
43 | 49 | with: |
| 50 | + enable-cache: true |
| 51 | + cache-suffix: "${{ matrix.py_version }}" |
| 52 | + version: "latest" |
44 | 53 | python-version: "${{ matrix.py_version }}" |
45 | | - - name: Update pip |
46 | | - run: python -m pip install -U pip |
47 | | - - name: Install poetry |
48 | | - run: python -m pip install poetry |
49 | 54 | - name: Install deps |
50 | | - run: poetry install |
51 | | - env: |
52 | | - POETRY_VIRTUALENVS_CREATE: false |
53 | | - - name: Run pytest check |
54 | | - run: poetry run pytest -vv -n auto --cov="taskiq_redis" . |
55 | | - - name: Generate report |
56 | | - run: poetry run coverage xml |
| 55 | + run: uv sync --all-extras |
| 56 | + - name: Run pytest |
| 57 | + run: uv run pytest -vv -n auto --cov="taskiq_redis" . |
| 58 | + - name: Generate coverage report |
| 59 | + run: uv run coverage xml |
57 | 60 | - name: Upload coverage reports to Codecov with GitHub Action |
58 | | - uses: codecov/codecov-action@v3 |
59 | | - if: matrix.py_version == '3.9' |
| 61 | + uses: codecov/codecov-action@v5 |
| 62 | + if: matrix.py_version == '3.10' |
60 | 63 | with: |
61 | 64 | token: ${{ secrets.CODECOV_TOKEN }} |
62 | 65 | fail_ci_if_error: false |
|
0 commit comments