Repository navigation
74 lines (59 loc) · 1.93 KB
/
Copy pathtest.yml
File metadata and controls
74 lines (59 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Test packages
on: [push, pull_request, workflow_dispatch]
jobs:
prek:
name: Run prek hooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
- name: Install uv
uses: astral-sh/setup-uv@v10.2.0
with:
python-version: "3.13"
enable-cache: true
cache-dependency-glob: "uv.lock"
# The local hooks (ruff, Django checks) run through `uv run`, with the
# versions locked in uv.lock, exactly as on a developer machine.
- name: Install dependencies
run: uv sync --all-groups
# Installs prek, caches the hook environments and runs
# `prek run --show-diff-on-failure --all-files`.
- name: Run prek on all files
uses: j178/prek-action@v3.0.0
test:
name: Run code quality checks and tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
DJANGO_SETTINGS_MODULE: pythonie.settings.tests
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test_db
steps:
- uses: actions/checkout@v7.0.1
- name: Install uv
uses: astral-sh/setup-uv@v10.2.0
with:
python-version: "3.13"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: uv sync --all-groups
- name: Check code formatting with Ruff
run: uv run ruff format --check pythonie
- name: Lint code with Ruff
run: uv run ruff check pythonie
- name: Check for security vulnerabilities
run: uv run pip-audit
- name: Run Django tests
run: uv run python pythonie/manage.py test pythonie --verbosity=2