diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index ef7728e..fd1ff32 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -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