@@ -32,33 +32,64 @@ jobs:
3232 uses : actions/setup-python@v2
3333 with :
3434 python-version : ${{ matrix.python-version }}
35- - name : Load cached venv
36- id : cached-poetry-dependencies
35+ - name : Load cached venv1
36+ id : cached-poetry-dependencies1
3737 uses : actions/cache@v2
3838 with :
39- path : .venv
40- key : venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('** /poetry.lock') }}
39+ path : .venv1
40+ key : venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('{{cookiecutter.project_name}}/template_minimal /poetry.lock') }}
4141 - name : Install dependencies and actiavte virtualenv
42- if : steps.cached-poetry-dependencies .outputs.cache-hit != 'true'
42+ if : steps.cached-poetry-dependencies1 .outputs.cache-hit != 'true'
4343 run : |
44- python -m venv .venv
45- source .venv /bin/activate
46- pip install -r {{cookiecutter.project_name}}/requirements-dev.txt
44+ python -m venv .venv1
45+ source .venv1 /bin/activate
46+ pip install -r {{cookiecutter.project_name}}/template_minimal/ requirements-dev.txt
4747 pip install cookiecutter
48- - name : Lint with flake8
48+ - name : Load cached venv2
49+ id : cached-poetry-dependencies2
50+ uses : actions/cache@v2
51+ with :
52+ path : .venv2
53+ key : venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('{{cookiecutter.project_name}}/template_fastapi_users/poetry.lock') }}
54+ - name : Install dependencies and actiavte virtualenv
55+ if : steps.cached-poetry-dependencies2.outputs.cache-hit != 'true'
56+ run : |
57+ python -m venv .venv2
58+ source .venv2/bin/activate
59+ pip install -r {{cookiecutter.project_name}}/template_minimal/requirements-dev.txt
60+ pip install cookiecutter
61+ - name : Lint with flake8 minimal project
62+ run : |
63+ source .venv1/bin/activate
64+ # stop the build if there are Python syntax errors or undefined names
65+ cd \{\{cookiecutter.project_name\}\}/template_minimal
66+ flake8 app --count --exit-zero --statistics
67+ - name : Lint with flake8 fastapi_users project
4968 run : |
50- source .venv /bin/activate
69+ source .venv2 /bin/activate
5170 # stop the build if there are Python syntax errors or undefined names
52- cd \{\{cookiecutter.project_name\}\}/
71+ cd \{\{cookiecutter.project_name\}\}/template_fastapi_users
5372 flake8 app --count --exit-zero --statistics
54- - name : Test new cookiecuttered project is passing pytest test
73+ - name : Test minimal project is passing pytest test
74+ run : |
75+ source .venv1/bin/activate
76+ python tests/create_minimal_project.py
77+ export TEST_DATABASE_HOSTNAME=localhost
78+ export TEST_DATABASE_USER=test
79+ export TEST_DATABASE_PASSWORD=test
80+ export TEST_DATABASE_PORT=30000
81+ export TEST_DATABASE_DB=test
82+
83+ pytest minimal_project
84+
85+ - name : Test fastapi_users project is passing pytest test
5586 run : |
56- source .venv /bin/activate
57- python tests/create_test_project .py
87+ source .venv2 /bin/activate
88+ python tests/create_fastapi_users_project .py
5889 export TEST_DATABASE_HOSTNAME=localhost
5990 export TEST_DATABASE_USER=test
6091 export TEST_DATABASE_PASSWORD=test
6192 export TEST_DATABASE_PORT=30000
6293 export TEST_DATABASE_DB=test
6394
64- pytest generated_project_for_tests
95+ pytest fastapi_users_project
0 commit comments