mirror of
https://github.com/TurTaskProject/TurTaskWeb.git
synced 2025-12-19 22:14:07 +01:00
Add django.yml to run github action on tests (#11)
* Create django.yml * Update django.yml * Update django.yml * Connect to Postgres before do test * Fix Syntax Error * Fix Migrate error * Fix migration error / Modify requirments.txt * Fix Database secret value missing * Fix test error * Add badge to README.md
This commit is contained in:
parent
dc83c7b79c
commit
f032ae50d6
43
.github/workflows/django.yml
vendored
Normal file
43
.github/workflows/django.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
name: Django CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: github_actions
|
||||
ports:
|
||||
- 5432:5432
|
||||
# needed because the postgres container does not provide a healthcheck
|
||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python 3.11
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.11
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
- name: Run migrations
|
||||
run: |
|
||||
cd backend
|
||||
python manage.py migrate
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd backend
|
||||
python manage.py test
|
||||
9
README.md
Normal file
9
README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# TurTaskWeb
|
||||
|
||||
[](https://github.com/TurTaskProject/TurTaskWeb/actions/workflows/django.yml)
|
||||
|
||||
---
|
||||
|
||||
TurTask is a task and project management tool that incorporates gamification elements.
|
||||
|
||||
[Wiki Repository](https://github.com/TurTaskProject/TurTaskWiki)
|
||||
@ -22,7 +22,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = config('SECRET_KEY')
|
||||
SECRET_KEY = config('SECRET_KEY', default='j5&66&8@b-!3tbq!=w6-dypl($_0zzoi*ilxd1*&$_6s-59il5')
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = config('DEBUG', default=False, cast=bool)
|
||||
@ -82,8 +82,8 @@ REST_USE_JWT = True
|
||||
SOCIALACCOUNT_PROVIDERS = {
|
||||
'google': {
|
||||
'APP': {
|
||||
'client_id': config('GOOGLE_CLIENT_ID'),
|
||||
'secret': config('GOOGLE_CLIENT_SECRET'),
|
||||
'client_id': config('GOOGLE_CLIENT_ID', default='fake-client-id'),
|
||||
'secret': config('GOOGLE_CLIENT_SECRET', default='fake-client-secret'),
|
||||
'key': ''
|
||||
},
|
||||
"SCOPE": [
|
||||
@ -118,7 +118,7 @@ MIDDLEWARE = [
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
# "allauth.account.middleware.AccountMiddleware",
|
||||
"allauth.account.middleware.AccountMiddleware",
|
||||
]
|
||||
|
||||
ROOT_URLCONF = 'core.urls'
|
||||
@ -150,11 +150,11 @@ WSGI_APPLICATION = 'core.wsgi.application'
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': config('DB_NAME'),
|
||||
'USER': config('DB_USER'),
|
||||
'PASSWORD': config('DB_PASSWORD'),
|
||||
'HOST': config('DB_HOST'),
|
||||
'PORT': config('DB_PORT'),
|
||||
'NAME': config('DB_NAME', default='github_actions'),
|
||||
'USER': config('DB_USER', default='postgres'),
|
||||
'PASSWORD': config('DB_PASSWORD', default='postgres'),
|
||||
'HOST': config('DB_HOST', default='127.0.0.1'),
|
||||
'PORT': config('DB_PORT', default='5432'),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
requirements.txt
BIN
requirements.txt
Binary file not shown.
Loading…
Reference in New Issue
Block a user