diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cca23aa4b..1a116b30b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -140,6 +140,18 @@ jobs: key: poetry-${{ hashFiles('poetry.lock') }} restore-keys: poetry- + # Mypy is incremental: with a restored .mypy_cache it only re-checks + # modules whose dependencies changed. The key includes the commit SHA so + # every run saves a fresh snapshot (actions/cache never overwrites an + # existing key); restore-keys falls back to the most recent snapshot for + # the same deps/config. + - name: Cache mypy incremental state + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 + with: + path: .mypy_cache + key: mypy-${{ hashFiles('poetry.lock', 'pyproject.toml') }}-${{ github.sha }} + restore-keys: mypy-${{ hashFiles('poetry.lock', 'pyproject.toml') }}- + - name: Install dependencies run: | python -m pip install --upgrade pip