mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Use mypy caching [ci] (#86715)
This commit is contained in:
parent
c727f403ff
commit
54fcf58449
19
.github/workflows/ci.yaml
vendored
19
.github/workflows/ci.yaml
vendored
@ -30,6 +30,7 @@ on:
|
|||||||
env:
|
env:
|
||||||
CACHE_VERSION: 3
|
CACHE_VERSION: 3
|
||||||
PIP_CACHE_VERSION: 3
|
PIP_CACHE_VERSION: 3
|
||||||
|
MYPY_CACHE_VERSION: 3
|
||||||
HA_SHORT_VERSION: 2023.3
|
HA_SHORT_VERSION: 2023.3
|
||||||
DEFAULT_PYTHON: "3.10"
|
DEFAULT_PYTHON: "3.10"
|
||||||
ALL_PYTHON_VERSIONS: "['3.10']"
|
ALL_PYTHON_VERSIONS: "['3.10']"
|
||||||
@ -756,6 +757,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
- name: Generate partial mypy restore key
|
||||||
|
id: generate-mypy-key
|
||||||
|
run: |
|
||||||
|
mypy_version=$(cat requirements_test.txt | grep mypy | cut -d '=' -f 3)
|
||||||
|
echo "version=$mypy_version" >> $GITHUB_OUTPUT
|
||||||
|
echo "key=mypy-${{ env.MYPY_CACHE_VERSION }}-$mypy_version-${{
|
||||||
|
env.HA_SHORT_VERSION }}-$(date -u '+%Y-%m-%dT%H:%M:%s')" >> $GITHUB_OUTPUT
|
||||||
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
|
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache/restore@v3.2.3
|
uses: actions/cache/restore@v3.2.3
|
||||||
@ -769,6 +777,17 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Failed to restore Python virtual environment from cache"
|
echo "Failed to restore Python virtual environment from cache"
|
||||||
exit 1
|
exit 1
|
||||||
|
- name: Restore mypy cache
|
||||||
|
uses: actions/cache@v3.2.3
|
||||||
|
with:
|
||||||
|
path: .mypy_cache
|
||||||
|
key: >-
|
||||||
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
|
||||||
|
steps.generate-mypy-key.outputs.key }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-${{ steps.python.outputs.python-version }}-mypy-${{
|
||||||
|
env.MYPY_CACHE_VERSION }}-${{ steps.generate-mypy-key.outputs.version }}-${{
|
||||||
|
env.HA_SHORT_VERSION }}-
|
||||||
- name: Register mypy problem matcher
|
- name: Register mypy problem matcher
|
||||||
run: |
|
run: |
|
||||||
echo "::add-matcher::.github/workflows/matchers/mypy.json"
|
echo "::add-matcher::.github/workflows/matchers/mypy.json"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user