-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.7 KB
/
Copy pathtest.yaml
File metadata and controls
56 lines (54 loc) · 1.7 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
name: Run tests
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
postgres_version: ['14','16']
services:
postgres:
image: postgres:${{ matrix.postgres_version }}
env:
POSTGRES_DB: rp_sidekick
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
redis:
image: redis:6.0
ports:
- 6379:6379
env:
RP_SIDEKICK_DATABASE: postgres://postgres:postgres@localhost/rp_sidekick
steps:
- uses: actions/checkout@v4
- name: Install gettext
run: sudo apt-get install gettext
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: astral-sh/setup-uv@v3
- name: Install dependencies
id: install-deps
run: |
uv sync --dev
- name: Check formatting
# Lints/tests should always run, even if other lints/tests have failed.
if: success() || failure() && steps.install-deps.outcome == 'success'
run: |
uv run ruff format --check
- name: Lint
if: success() || failure() && steps.install-deps.outcome == 'success'
run: |
uv run ruff check
- name: Run migrations
if: success() || failure() && steps.install-deps.outcome == 'success'
run: |
uv run ./manage.py makemigrations rp_dtone rp_transferto\
sidekick --dry-run | grep 'No changes detected' || (echo 'There are\
changes which require migrations.' && exit 1)
- name: Run tests
if: success() || failure() && steps.install-deps.outcome == 'success'
run: |
uv run pytest -vv