-
Notifications
You must be signed in to change notification settings - Fork 2
35 lines (30 loc) · 1.02 KB
/
Django-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# GitHub Actions
# This workflow will prepare the testing environment and run test cases
name: Django Backend Test
on: [pull_request, push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f optional-requirements.txt ]; then pip install -r optional-requirements.txt; fi
- name: Setup environment and settings
run: |
cp ./npsat_backend/local_settings_template.py ./npsat_backend/local_settings.py
cp ./npsat_backend/databases_template.py ./npsat_backend/databases.py
mkdir ../logs
- name: Run migrations
run: |
python manage.py makemigrations
python manage.py migrate
- name: Run tests
run: python manage.py test