Skip to content

Commit

Permalink
Merge pull request #4 from bertt6/CI/CD-TEST
Browse files Browse the repository at this point in the history
Ci/cd test
  • Loading branch information
muratkaanmesum authored Mar 17, 2024
2 parents 052d344 + 7edafb4 commit 953a583
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@
name: Run Django Tests
on:
push:
branches: [main]
branches:
- '**'
jobs:
test-django-app:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 123
POSTGRES_DB: transcendenceDB
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
Expand All @@ -25,6 +36,10 @@ jobs:
- name: Run Django test
run: |
cd API
export PG_HOST=localhost
export PG_USER=postgres
export PG_PASSWORD=123
export PG_DB=transcendenceDB
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
Expand Down
14 changes: 7 additions & 7 deletions API/API/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.getenv('SECRET_KEY')
SECRET_KEY = '0a4fd7e3567eab20bab2f2d6682ea96d0d865050bfcde9c293aa7f9ec48bce55'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
Expand All @@ -43,7 +43,7 @@
"Apps.Auth.apps.AuthConfig",
"Apps.Profile.apps.ProfileConfig"
]

#asdafas
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
Expand Down Expand Up @@ -82,11 +82,11 @@
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": os.getenv('DB_NAME'),
"USER": os.getenv('DB_USER'),
"PASSWORD": os.getenv('DB_PASSWORD'),
"HOST": os.getenv('DB_HOST'),
"PORT": os.getenv('DB_PORT'),
"NAME": os.getenv('PG_DB'),
"USER": os.getenv('PG_USER'),
"PASSWORD": os.getenv('PG_PASSWORD'),
"HOST": os.getenv('PG_HOST'),
"PORT": os.getenv('PG_PORT'),
}
}

Expand Down

0 comments on commit 953a583

Please sign in to comment.