-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (61 loc) · 1.7 KB
/
django-code-quality.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
64
65
name: Django CI
on:
push:
branches: ["main", "acceptance", "production"]
pull_request:
branches: ["main", "acceptance", "production"]
defaults:
run:
working-directory: ./src
jobs:
build:
runs-on: ubuntu-latest
env:
DB_USER: postgres
DB_PASSWORD: postgres
DB_HOST: localhost # default host value for the database
DB_NAME: djtesting
DB_PORT: 5432
services:
postgres_main:
image: postgres:13.9
env:
POSTGRES_USER: ${{ env.DB_USER }}
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }}
POSTGRES_DB: ${{ env.DB_NAME }}
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
max-parallel: 4
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/test.txt
cd holon/services
- name: Lint with Black
uses: psf/black@stable
with:
options: --check --line-length 100 --exclude "^.*\b(migrations)\b.*$"
version: "~= 24.4.2"
- name: Run Tests
run: |
python manage.py test
env:
ALLOWED_HOSTS: "*"
MEDIA_PATH: ./media/
STATIC_PATH: ./static/
DJANGO_SETTINGS_MODULE: pipit.settings.test
SECRET_KEY: some-test-key-not-good-for-prod