fix(CI): Fix tool invocation with Poetry, add cache action
This commit is contained in:
16
.github/workflows/python-app.yml
vendored
16
.github/workflows/python-app.yml
vendored
@@ -30,12 +30,22 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
poetry install
|
||||
- name: Cache
|
||||
uses: actions/cache@v2.1.6
|
||||
with:
|
||||
# A list of files, directories, and wildcard patterns to cache and restore
|
||||
path: .venv
|
||||
# An explicit key for restoring and saving the cache
|
||||
key: venv-cache-${{hashfiles("poetry.lock")
|
||||
restore-keys: |
|
||||
venv-cache-${{hashfiles("poetry.lock")
|
||||
venv-cache-
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pytest
|
||||
poetry run pytest
|
||||
|
||||
Reference in New Issue
Block a user