This repository has been archived by the owner on Aug 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
112 lines (101 loc) · 2.86 KB
/
deployment.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Deployment
on:
- push
- workflow_dispatch
permissions:
contents: read
jobs:
commit-format:
runs-on: ubuntu-latest
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: ./requirements-dev.txt
- name: Install dependencies
run: |
make env-python
make install-dev
- name: Format with autopep8
run: make format-check
commit-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: ./requirements-dev.txt
- name: Install dependencies
run: |
make env-python
make install-dev
- name: Lint with ruff
run: make lint-check
commit-test:
runs-on: ubuntu-latest
env:
ADMIN: NAME,[email protected]
ALLOWED_HOSTS: localhost,0.0.0.0,127.0.0.1
CSRF_TRUSTED_ORIGINS: ""
DB_NAME: reboot
DB_USER: root
DB_PASSWORD: ${{ github.run_id }}-${{ github.run_attempt }}
DEBUG: False
DJANGO_DATABASE: local
EMAIL_HOST: smtp.gmail.com
EMAIL_HOST_USER: ""
EMAIL_HOST_PASSWORD: ""
REDIS_URL: "redis://localhost:6379/0"
SECRET_KEY: ${{ github.run_id }}-${{ github.run_attempt }}
SECURE_SSL_REDIRECT: False
services:
postgres:
image: postgres:14.10
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
redis:
image: redis:7
ports:
- 6379:6379
options: --entrypoint redis-server --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
- name: Set up RabbitMQ 3.12
uses: namoshek/rabbitmq-github-action@v1
with:
version: "3.12"
ports: "5671:5671 5672:5672"
certificates: ${{ github.workspace }}/dev/ssl/cert
config: ${{ github.workspace }}/rabbitmq-actions.conf
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: |
./requirements-dev.txt
./requirements.txt
- name: Install dependencies
run: |
make env-python
make install
make install-dev
- name: Test with unittest
run: |
make celery &
make test
make coverage