-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (72 loc) · 2.43 KB
/
test.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
name: test
on:
push:
schedule:
- cron: "0 0 * * *"
jobs:
server:
env:
DJANGO_SUPERUSER_PASSWORD: django-password
DJANGO_SUPERUSER_USERNAME: admin
DJANGO_SUPERUSER_EMAIL: [email protected]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Build images
run: docker-compose -f "docker-compose.yml" build
- name: Install Tox
run: |
docker-compose run --rm django pip install --upgrade pip
docker-compose run --rm django pip install tox
- name: Start services
run: docker-compose -f "docker-compose.yml" up -d
- uses: ifaxity/wait-on-action@v1
with:
resource: 'tcp:localhost:5432 tcp:localhost:5672'
verbose: true
- name: Run tox
run: docker-compose run --rm django tox
env:
DJANGO_DATABASE_URL: postgres://postgres:postgres@localhost:5432/django
DJANGO_MINIO_STORAGE_ENDPOINT: localhost:9000
DJANGO_MINIO_STORAGE_ACCESS_KEY: minioAccessKey
DJANGO_MINIO_STORAGE_SECRET_KEY: minioSecretKey
DJANGO_API_URL: http://localhost:8000/api/v1
DJANGO_HOMEPAGE_REDIRECT_URL: http://localhost:8081
client:
env:
DJANGO_SUPERUSER_PASSWORD: django-password
DJANGO_SUPERUSER_USERNAME: admin
DJANGO_SUPERUSER_EMAIL: [email protected]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install tox
run: |
pip install --upgrade pip
pip install tox
- name: Build images
run: docker-compose build
- name: Run migrations
run: docker-compose run --rm django ./manage.py migrate
- name: Create super user
run: docker-compose run -e DJANGO_SUPERUSER_PASSWORD=$DJANGO_SUPERUSER_PASSWORD --rm django ./manage.py createsuperuser --noinput --email=$DJANGO_SUPERUSER_EMAIL
- name: Start server
run: docker-compose up -d
- uses: ifaxity/wait-on-action@v1
with:
resource: 'http://localhost:8000/api/docs/swagger/'
- name: Run tox
run: tox
working-directory: ./swcc
- name: Stop server
run: docker-compose down --volumes
if: ${{ always() }}