-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (58 loc) · 2.59 KB
/
run-tests.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Tests
on: [pull_request]
jobs:
test:
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7]
platform: [ubuntu-latest, macos-latest, windows-latest]
django-version: [2.2.*, 3.*]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies (using Django ${{ matrix.django-version }})
run: |
python -m pip install --upgrade pip
pip install Django==${{ matrix.django-version }}
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Install espressodb
run: pip install -e .
- name: Install my_project dependencies
run: pip install -r ./example/my_project/requirements.txt
- name: Run my_project test
working-directory: ./example/my_project/
run: pytest
- name: Run espressodb tests
working-directory: ./tests/espressodb_tests/
run: pytest
- name: Run migration check tests
working-directory: ./tests/migration_tests/
run: |
pytest tests/test_state1.py
pytest tests/test_state2.py
pytest tests/test_state3.py
pytest tests/test_state4.py
- name: Run create new project
working-directory: ./tests/
run: espressodb startproject espressodb_new_test
- name: Test new project
working-directory: ./tests/espressodb_new_test/
run: python manage.py test
- name: Run start app
working-directory: ./tests/espressodb_new_test/
run: |
python manage.py startapp new_app
echo "" >> espressodb_new_test/new_app/models.py
echo "class MyTable(Base):" >> espressodb_new_test/new_app/models.py
echo " name=models.TextField()" >> espressodb_new_test/new_app/models.py
sed -i -e "s/PROJECT_APPS: \[\]/PROJECT_APPS: \[espressodb_new_test.new_app\]/g" settings.yaml
python manage.py makemigrations
- name: Test new project app
working-directory: ./tests/espressodb_new_test/
run: python manage.py test