Skip to content

Release v4 #24

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

Merged
merged 15 commits into from
Feb 5, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "3.11"

- name: Generate projects from templates using cookiecutter
# minimal_project folder
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual_build_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "3.11"

- name: Generate projects from templates using cookiecutter
# minimal_project folder
Expand Down
44 changes: 7 additions & 37 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,30 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "3.11"

- name: Generate projects from templates using cookiecutter
# fastapi_users_project folder
# minimal_project folder
# Below will create fresh template in path: minimal_project
- name: Generate project from template using cookiecutter
run: |
pip install cookiecutter
python tests/create_minimal_project.py
python tests/create_fastapi_users_project.py

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

### template minimal ###

- name: Load cached venv-1
id: cached-poetry-dependencies-template-1
# run tests from folder minimal_project
- name: Load cached venv
id: cached-poetry-dependencies-template
uses: actions/cache@v2
with:
path: minimal_project/.venv
key: venv-${{ runner.os }}-${{ hashFiles('minimal_project/poetry.lock') }}

- name: Install template minimal dependencies
if: steps.cached-poetry-dependencies-template-1.outputs.cache-hit != 'true'
if: steps.cached-poetry-dependencies-template.outputs.cache-hit != 'true'
run: |
cd minimal_project
poetry install --no-interaction --no-root
Expand All @@ -66,30 +63,3 @@ jobs:
cd minimal_project
poetry run flake8 app --count --exit-zero --statistics
poetry run coverage run -m pytest

### template fastapi users ###

- name: Load cached venv-2
id: cached-poetry-dependencies-template-2
uses: actions/cache@v2
with:
path: fastapi_users_project/.venv
key: venv-${{ runner.os }}-${{ hashFiles('fastapi_users_project/poetry.lock') }}

- name: Install template fastapi users dependencies
if: steps.cached-poetry-dependencies-template-1.outputs.cache-hit != 'true'
run: |
cd fastapi_users_project
poetry install --no-interaction --no-root

- name: Run template fastapi users flake8 and then tests
env:
TEST_DATABASE_HOSTNAME: localhost
TEST_DATABASE_PASSWORD: postgres
TEST_DATABASE_PORT: 5432
TEST_DATABASE_USER: postgres
TEST_DATABASE_DB: postgres
run: |
cd fastapi_users_project
poetry run flake8 app --count --exit-zero --statistics
poetry run coverage run -m pytest
Loading