mirror of
https://github.com/simple-login/app.git
synced 2024-09-20 06:55:59 +08:00
Use install-poetry to use poetry with caching.
This commit is contained in:
parent
4800274b33
commit
7f765e83b7
7
.flake8
7
.flake8
|
@ -1,5 +1,5 @@
|
|||
[flake8]
|
||||
ignore =
|
||||
ignore =
|
||||
# line length is handled by black
|
||||
E501,
|
||||
# W503 & E203 are not PEP 8 compliant and conflicts with black
|
||||
|
@ -9,10 +9,11 @@ ignore =
|
|||
F541,
|
||||
# allow bare "except"
|
||||
E722
|
||||
exclude =
|
||||
exclude =
|
||||
.git,
|
||||
__pycache__,
|
||||
.pytest_cache,
|
||||
.venv,
|
||||
static,
|
||||
templates,
|
||||
# migrations are generated by alembic
|
||||
|
@ -22,4 +23,4 @@ exclude =
|
|||
|
||||
per-file-ignores =
|
||||
# ignore unused imports in __init__
|
||||
__init__.py:F401
|
||||
__init__.py:F401
|
||||
|
|
31
.github/workflows/main.yml
vendored
31
.github/workflows/main.yml
vendored
|
@ -38,25 +38,34 @@ jobs:
|
|||
--health-retries 5
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- uses: actions/cache@v1
|
||||
- name: Install poetry
|
||||
uses: snok/install-poetry@v1
|
||||
with:
|
||||
path: ~/.cache/poetry
|
||||
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-poetry-
|
||||
virtualenvs-create: true
|
||||
virtualenvs-in-project: true
|
||||
installer-parallel: true
|
||||
|
||||
- name: Run caching
|
||||
id: cached-poetry-dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .venv
|
||||
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install poetry==1.0.10
|
||||
poetry config virtualenvs.create false
|
||||
poetry install
|
||||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
||||
run: poetry install --no-interaction --no-root
|
||||
|
||||
- name: Install library
|
||||
run: poetry install --no-interaction
|
||||
|
||||
- name: Check formatting & linting
|
||||
run: |
|
||||
|
@ -65,7 +74,7 @@ jobs:
|
|||
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pytest
|
||||
poetry run pytest
|
||||
env:
|
||||
GITHUB_ACTIONS_TEST: true
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
[run]
|
||||
branch = True
|
||||
source = .
|
||||
omit =
|
||||
.venv/*
|
||||
|
||||
[report]
|
||||
fail_under = 55
|
||||
|
|
Loading…
Reference in a new issue