Skip to content

Commit 0d7f65b

Browse files
committed
Pytest github action using uv.
1 parent 1fad0de commit 0d7f65b

File tree

2 files changed

+10
-34
lines changed

2 files changed

+10
-34
lines changed

.github/workflows/pytest.yml

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,18 @@ defaults:
66
working-directory: backend
77

88
jobs:
9-
test:
9+
uv-example:
10+
name: python
1011
runs-on: ubuntu-latest
11-
timeout-minutes: 10
1212

1313
steps:
14-
- name: Check out repository code
15-
uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1615

17-
- name: Setup Python
18-
uses: actions/setup-python@v4
19-
with:
20-
python-version: "3.9"
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v5
2118

22-
- name: Install pipenv
23-
run: |
24-
python -m pip install --upgrade pipenv wheel
19+
- name: Install the project
20+
run: uv sync --all-extras --dev
2521

26-
- id: cache-pipenv
27-
uses: actions/cache@v3
28-
with:
29-
path: ~/.local/share/virtualenvs
30-
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
31-
32-
- name: Install dependencies
33-
if: steps.cache-pipenv.outputs.cache-hit != 'true'
34-
run: |
35-
pipenv install --deploy --dev
36-
37-
- name: Start env
38-
run: docker compose -f ../docker-compose.dev.yml up -d
39-
40-
# wait for docker containers to come up before running tests
41-
- name: Sleep for 60 seconds
42-
run: sleep 60s
43-
shell: bash
44-
45-
- name: Run test suite
46-
run: |
47-
pipenv run pytest -v
22+
- name: Run tests
23+
run: uv run pytest app/tests/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ repos:
3636
exclude: 'openapi.json|frontend/src/openapi/v2/'
3737
- repo: https://github.com/astral-sh/ruff-pre-commit
3838
# Ruff version.
39-
rev: v0.8.2
39+
rev: v0.9.4
4040
hooks:
4141
# Run the linter.
4242
- id: ruff

0 commit comments

Comments
 (0)