Skip to content

Commit

Permalink
ci: improve mypy cache specificity
Browse files Browse the repository at this point in the history
  • Loading branch information
neersighted committed Mar 25, 2024
1 parent a6e902f commit 36d05d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/actions/bootstrap-poetry/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ inputs:
description: pip-compatible installation specification to use for Poetry
default: 'poetry'

outputs:
python-path:
description: Path to the installed Python interpreter
value: ${{ steps.setup-python.outputs.python-path }}
python-version:
description: Version of the installed Python interpreter
value: ${{ steps.setup-python.outputs.python-version }}

runs:
using: composite
steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/.tests-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- uses: actions/checkout@v4

- uses: ./.github/actions/bootstrap-poetry
id: bootstrap-poetry
with:
python-version: ${{ inputs.python-version }}

Expand All @@ -39,9 +40,9 @@ jobs:
- uses: actions/cache@v4
with:
path: .mypy_cache
key: mypy-${{ runner.os }}-py${{ inputs.python-version }}-${{ hashFiles('pyproject.toml', 'poetry.lock') }}
key: mypy-${{ runner.os }}-py${{ steps.bootstrap-poetry.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'poetry.lock') }}
restore-keys: |
mypy-${{ runner.os }}-py${{ inputs.python-version }}-
mypy-${{ runner.os }}-py${{ steps.bootstrap-poetry.outputs.python-version }}-
mypy-${{ runner.os }}-
- run: poetry run mypy
Expand Down

0 comments on commit 36d05d7

Please sign in to comment.