Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds github actions #287

Merged
merged 1 commit into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: FinSL-signbank CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Set Django DATABASES environment variable for SQLite
run: |
echo "DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3','NAME': 'db.sqlite3'}}" >> ./signbank/settings/development.py
- name: Make migrations for translatable fields
run: |
python bin/develop.py makemigrations
- name: Migrate
run: |
python bin/develop.py migrate
- name: Run Tests
run: |
python bin/develop.py test
2 changes: 1 addition & 1 deletion signbank/settings/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@
MIDDLEWARE.append('debug_toolbar.middleware.DebugToolbarMiddleware')
INSTALLED_APPS += ('debug_toolbar',)
DEBUG_TOOLBAR_CONFIG = {'RESULTS_CACHE_SIZE': 100}
except ImportError:
except (ImportError, ModuleNotFoundError):
pass
19 changes: 11 additions & 8 deletions signbank/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,17 @@
path('info/', infopage, name='infopage'),
]
if settings.DEBUG:
import debug_toolbar
from django.conf.urls.static import static
# Add debug_toolbar when DEBUG=True, also add static+media folders when in development.
# DEBUG should be False when in production!
urlpatterns += [
path('__debug__/', include(debug_toolbar.urls)),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)\
+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
try:
import debug_toolbar
from django.conf.urls.static import static
# Add debug_toolbar when DEBUG=True, also add static+media folders when in development.
# DEBUG should be False when in production!
urlpatterns += [
path('__debug__/', include(debug_toolbar.urls)),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)\
+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
except (ImportError, ModuleNotFoundError):
pass

# This is a catchall pattern, will try to match the rest of the urls with flatpages.
urlpatterns += [re_path('(?P<url>.*/)', flatpages_views.flatpage), ] # Keep this as the last URL in the file!
Expand Down