-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (75 loc) · 2.55 KB
/
run_tests.yaml
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
name: Run tests
on:
pull_request:
branches:
- develop
- master
env:
DJANGO_SECRET_KEY: somekey
DJANGO_ALLOWED_HOSTS: localhost
CSRF_TRUSTED_ORIGINS: http://localhost
DJANGO_DEBUG: True
POSTGRES_DB_TEST: b2b-marketplace-test
POSTGRES_USER_TEST: b2b-marketplace-test
POSTGRES_PASSWORD_TEST: somepassword-test
POSTGRES_HOST_TEST: localhost
POSTGRES_PORT_TEST: 5432
EMAIL_HOST: fake.mail.ru
EMAIL_HOST_USER: [email protected]
EMAIL_HOST_PASSWORD: fake_password
EMAIL_PORT: 2525
jobs:
migrations:
name: Run tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DB: ${{env.POSTGRES_DB_TEST}}
POSTGRES_USER: ${{env.POSTGRES_USER_TEST}}
POSTGRES_PASSWORD: ${{env.POSTGRES_PASSWORD_TEST}}
ports:
- 5432:5432
steps:
-
name: Check out the repo
uses: actions/checkout@v3
-
name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
-
name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
-
name: Install Dependencies
run: poetry install
-
name: Create .env file
run: |
touch infra/.env
echo DJANGO_SECRET_KEY=$DJANGO_SECRET_KEY >> infra/.env
echo DJANGO_ALLOWED_HOSTS=$DJANGO_ALLOWED_HOSTS >> infra/.env
echo CSRF_TRUSTED_ORIGINS=$CSRF_TRUSTED_ORIGINS >> infra/.env
echo DJANGO_DEBUG=$DJANGO_DEBUG >> infra/.env
echo POSTGRES_DB=$POSTGRES_DB >> infra/.env
echo POSTGRES_USER=$POSTGRES_USER >> infra/.env
echo POSTGRES_PASSWORD=$POSTGRES_PASSWORD >> infra/.env
echo POSTGRES_HOST=$POSTGRES_HOST >> infra/.env
echo POSTGRES_PORT=$POSTGRES_PORT >> infra/.env
echo POSTGRES_DB_TEST=$POSTGRES_DB_TEST >> infra/.env
echo POSTGRES_USER_TEST=$POSTGRES_USER_TEST >> infra/.env
echo POSTGRES_PASSWORD_TEST=$POSTGRES_PASSWORD_TEST >> infra/.env
echo POSTGRES_HOST_TEST=$POSTGRES_HOST_TEST >> infra/.env
echo POSTGRES_PORT_TEST=$POSTGRES_PORT_TEST >> infra/.env
echo EMAIL_HOST=$EMAIL_HOST >> infra/.env
echo EMAIL_HOST_USER=$EMAIL_HOST_USER >> infra/.env
echo EMAIL_HOST_PASSWORD=$EMAIL_HOST_PASSWORD >> infra/.env
echo EMAIL_PORT=$EMAIL_PORT >> infra/.env
-
name: Run test
run: poetry run pytest