-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (50 loc) · 1.58 KB
/
django_functional_tests.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
name: Django CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
services:
db:
image: postgres
env:
POSTGRES_DB: dbname
POSTGRES_USER: login
POSTGRES_PASSWORD: password
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Install PostgreSQL Client
run: sudo apt-get install -y postgresql-client
- name: Test PostgreSQL Connection
run: psql "host=localhost user=login dbname=dbname password=password"
- uses: actions/checkout@v3
with:
path: nopayloaddb
- name: Install Dependencies
run: |
cd nopayloaddb/
pip install -r requirements.txt
- name: Change permissions of /var/log/
run: sudo chmod a+w /var/log/
#- name: Wait for PostgreSQL to become ready
# run: until pg_isready -h localhost -p 5432; do sleep 2; done
- name: Run Django
env:
POSTGRES_DB: dbname
POSTGRES_USER: login
POSTGRES_PASSWORD: password
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
run: |
cd nopayloaddb/
python manage.py makemigrations cdb_rest && python manage.py migrate && python manage.py runserver 0.0.0.0:8000 &
- name: Access Django API
run: |
curl http://localhost:8000/api/cdb_rest/payloadiovs/?gtName=Test&majorIOV=0&minorIOV=0”