Skip to content

Commit d952e8b

Browse files
committed
Migrate CI to uv
1 parent 5d21a43 commit d952e8b

File tree

2 files changed

+27
-44
lines changed

2 files changed

+27
-44
lines changed

.github/workflows/lint.yml

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,20 @@ jobs:
1010
lint:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
14-
- name: Set up lowest supported Python version
15-
uses: actions/setup-python@v4
16-
with:
17-
python-version: "3.10"
18-
- name: Install Poetry
19-
uses: snok/install-poetry@v1
20-
with:
21-
virtualenvs-create: true
22-
virtualenvs-in-project: true
23-
- name: Load cached venv
24-
id: cached-poetry-dependencies
25-
uses: actions/cache@v3
13+
- uses: actions/checkout@v4
14+
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v5
2617
with:
27-
path: .venv
28-
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
29-
- name: Install dependencies
30-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
31-
run: poetry install --no-interaction --no-root
32-
- name: Install library
33-
run: poetry install --no-interaction
18+
enable-cache: true
19+
20+
- name: Set up Python
21+
run: uv python install
22+
23+
- name: Install the project
24+
run: uv sync --all-extras --dev
25+
3426
- name: Lint
3527
run: |
36-
poetry run ruff check admin_anchors tests
37-
poetry run ruff format --check admin_anchors tests
28+
uv run ruff check admin_anchors tests
29+
uv run ruff format --check admin_anchors tests

.github/workflows/test.yml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,23 @@ jobs:
1414
django-version: ["4.2", "5.0", "5.1", "5.2"]
1515
python-version: ["3.10", "3.11", "3.12", "3.13"]
1616
steps:
17-
- uses: actions/checkout@v3
18-
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v4
17+
- uses: actions/checkout@v4
18+
19+
- name: Install uv and set the python version
20+
uses: astral-sh/setup-uv@v5
2021
with:
22+
enable-cache: true
2123
python-version: ${{ matrix.python-version }}
22-
- name: Install Poetry
23-
uses: snok/install-poetry@v1
24-
with:
25-
virtualenvs-create: true
26-
virtualenvs-in-project: true
27-
- name: Load cached venv
28-
id: cached-poetry-dependencies
29-
uses: actions/cache@v3
30-
with:
31-
path: .venv
32-
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
33-
- name: Install dependencies
34-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
35-
run: poetry install --no-interaction --no-root
36-
- name: Install library
37-
run: poetry install --no-interaction
24+
25+
- name: Install the project
26+
run: uv sync --all-extras --dev
27+
3828
- name: Install django ${{ matrix.django-version }}
39-
run: |
40-
poetry run pip install "Django==${{ matrix.django-version }}"
29+
run: uv add "django==${{ matrix.django-version }}"
30+
4131
- name: Run tests and collect coverage
42-
run: poetry run pytest -vv --cov=admin_anchors --cov-report=xml
32+
run: uv run pytest -vv --cov=admin_anchors --cov-report=xml
33+
4334
- name: Upload coverage reports to Codecov with GitHub Action
4435
uses: codecov/codecov-action@v4
4536
with:

0 commit comments

Comments
 (0)