Skip to content

Commit

Permalink
Django functional tests (#23)
Browse files Browse the repository at this point in the history
Django standalone functional tests
  • Loading branch information
ruslan33 authored Oct 8, 2023
1 parent 78ee1f0 commit bddf5ad
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/django_functional_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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”

0 comments on commit bddf5ad

Please sign in to comment.