File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,13 +27,22 @@ jobs:
2727 - uses : actions/setup-python@v4
2828 with :
2929 python-version : ${{ matrix.python-version }}
30- cache : poetry
31- cache-dependency-path : app_python/poetry.lock
3230 - uses : snok/install-poetry@v1
3331 with :
3432 version : ${{ matrix.poetry-version }}
33+ - name : Configure Poetry virtualenv location
34+ run : poetry config virtualenvs.in-project true
35+ - name : Cache Poetry dependencies
36+ uses : actions/cache@v4
37+ with :
38+ path : |
39+ ~/.cache/pypoetry
40+ app_python/.venv
41+ key : ${{ runner.os }}-py${{ matrix.python-version }}-poetry${{ matrix.poetry-version }}-${{ hashFiles('app_python/poetry.lock') }}
42+ restore-keys : |
43+ ${{ runner.os }}-py${{ matrix.python-version }}-poetry${{ matrix.poetry-version }}-
3544 - name : Install dependencies
36- run : poetry install
45+ run : poetry install --with dev --no-interaction --no-ansi
3746 - name : Lint with flake8
3847 run : poetry run flake8 src tests
3948 - name : Test using pytest with coverage report
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ Provide links/terminal output for:
3636- Status badge in ` app_python/README.md ` :
3737 - < https://github.com/LocalT0aster/DevOps-Core-S25/actions/workflows/python-ci.yml >
3838
39- ``` text
39+ ``` log
4040$ poetry run pytest --cov=src --cov-report=term-missing
4141========================= test session starts =========================
4242platform linux -- Python 3.14.2, pytest-9.0.2, pluggy-1.6.0
@@ -71,7 +71,7 @@ Coverage note:
7171- ** Practice 1: Path-based trigger filtering** : avoids running Python CI when unrelated folders change.
7272- ** Practice 2: Lint + test stages in CI** : catches style and functional issues early.
7373- ** Practice 3: Coverage reporting in CI command** : makes test quality visible, not just pass/fail.
74- - ** Caching** : ` actions/setup-python ` Poetry cache enabled with lockfile -based invalidation .
74+ - ** Caching** : ` actions/cache ` stores ` ~/. cache/pypoetry ` and ` app_python/.venv ` using a ` poetry.lock ` -based key .
7575- ** Snyk** : ` TODO ` (not integrated/documented yet).
7676
7777## 4. Key Decisions
You can’t perform that action at this time.
0 commit comments