This repository was archived by the owner on May 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (75 loc) · 1.84 KB
/
pull_request.yml
File metadata and controls
77 lines (75 loc) · 1.84 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
75
76
77
name: Pull request
on:
pull_request:
branches:
- main
jobs:
# lint_python:
# name: Lint python
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: server
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: Install Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# check-latest: true
# - name: Setup Poetry
# uses: Gr1N/setup-poetry@v7
# - name: Install dependencies
# run: poetry install
# - name: Lint python code
# run: poetry run flake8
test_server:
name: Test server
runs-on: ubuntu-latest
# needs: lint_python
defaults:
run:
working-directory: server
services:
postgres:
image: postgres
env:
POSTGRES_DB: devind
POSTGRES_PASSWORD: 1234
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
check-latest: true
- name: Setup Poetry
uses: Gr1N/setup-poetry@v8
- name: Install dependencies
run: poetry install
- name: Copy env
run: cp .env.example .env
- name: Run migration
run: poetry run python manage.py migrate
- name: Run tests
run: poetry run python manage.py test