-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (49 loc) · 1.37 KB
/
django.yml
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
name: Django CI
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
env:
DATABASE_URL: postgresql://postgres:[email protected]:5432/github_actions
DJANGO_SETTINGS_MODULE: website.settings.test
SECRET_KEY: 3573c6f0e4f7793
services:
postgres:
image: postgres:16-alpine3.17
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: github_actions
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python
run: uv python install
- name: Check Code Style
uses: pre-commit/[email protected]
- name: Set up Python
run: uv python install
- name: Install the project
run: uv sync --all-extras
- name: Run Django Check
env:
DJANGO_SETTINGS_MODULE: website.settings.prod
run: uv run python manage.py check --deploy
- name: Run Mypy Check
run: uv run mypy .
- name: Collect Static
run: uv run python manage.py collectstatic --noinput
- name: Run Tests
run: uv run coverage run -m pytest
- name: Show coverage report
run: uv run coverage report