Skip to content

Commit

Permalink
added postgres to pipeline tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-gray-tangent committed Jun 13, 2024
1 parent 9a27eb0 commit 90726bf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .env.testing
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SECRET_KEY='django-insecure-w!h85bp^$$e8gm%c23r!0%9i7yzd=6w$$s&ic+6!%306&kj8@k*5'
DEBUG=True
DB_HOST=db
DB_HOST=localhost
DB_PORT=5432
DB_NAME=term_db
DB_USER=sadilar
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ on: [ pull_request, push ] # activates the workflow when there is a push or pull
jobs:
test_project:
runs-on: ubuntu-latest # operating system your code will run on
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: sadilar
POSTGRES_PASSWORD: sadilar
POSTGRES_DB: test_db_1
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand All @@ -20,6 +30,7 @@ jobs:
sudo chown runner:runner /logging
- name: Run validate_templates
run: |
export DJANGO_TEST_PROCESSES=1
cp .env.testing app/.env
cd app/
mkdir -p static_files
Expand All @@ -30,6 +41,9 @@ jobs:
cd app/
mkdir -p static_files
python manage.py test
env:
DJANGO_SETTINGS_MODULE: app.settings
DATABASE_URL: postgres://sadilar:sadilar@localhost:5432/test_db
- name: Manager Check
run: |
cd app/
Expand Down

0 comments on commit 90726bf

Please sign in to comment.