Skip to content

Commit 02de5c7

Browse files
committed
fix: the actions
1 parent ec3641f commit 02de5c7

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/python-ci.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff 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

app_python/docs/LAB03.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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 =========================
4242
platform 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

0 commit comments

Comments
 (0)