mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-08 17:56:33 +00:00
Fix pre-commit GitHub Action cache (#4746)
Currently pre-commit caching seems not to work properly: There is no cache stored according to GitHub Action tab, and the Prepare Python dependencies job shows the following warning: Warning: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved. This seems to be similar to what have been observed and solved in Home Assistant Core with https://github.com/home-assistant/core/pull/46696. Use PRE_COMMIT_CACHE instead of PRE_COMMIT_HOME as well.
This commit is contained in:
parent
d63f0d5e0b
commit
8c8122eee0
13
.github/workflows/ci.yaml
vendored
13
.github/workflows/ci.yaml
vendored
@ -9,7 +9,7 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
DEFAULT_PYTHON: "3.11"
|
DEFAULT_PYTHON: "3.11"
|
||||||
PRE_COMMIT_HOME: ~/.cache/pre-commit
|
PRE_COMMIT_CACHE: ~/.cache/pre-commit
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||||
@ -49,7 +49,8 @@ jobs:
|
|||||||
id: cache-precommit
|
id: cache-precommit
|
||||||
uses: actions/cache@v3.3.2
|
uses: actions/cache@v3.3.2
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_HOME }}
|
path: ${{ env.PRE_COMMIT_CACHE }}
|
||||||
|
lookup-only: true
|
||||||
key: |
|
key: |
|
||||||
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
|
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
@ -132,7 +133,7 @@ jobs:
|
|||||||
id: cache-precommit
|
id: cache-precommit
|
||||||
uses: actions/cache@v3.3.2
|
uses: actions/cache@v3.3.2
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_HOME }}
|
path: ${{ env.PRE_COMMIT_CACHE }}
|
||||||
key: |
|
key: |
|
||||||
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
|
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
|
||||||
- name: Fail job if cache restore failed
|
- name: Fail job if cache restore failed
|
||||||
@ -208,7 +209,7 @@ jobs:
|
|||||||
id: cache-precommit
|
id: cache-precommit
|
||||||
uses: actions/cache@v3.3.2
|
uses: actions/cache@v3.3.2
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_HOME }}
|
path: ${{ env.PRE_COMMIT_CACHE }}
|
||||||
key: |
|
key: |
|
||||||
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
|
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
|
||||||
- name: Fail job if cache restore failed
|
- name: Fail job if cache restore failed
|
||||||
@ -249,7 +250,7 @@ jobs:
|
|||||||
id: cache-precommit
|
id: cache-precommit
|
||||||
uses: actions/cache@v3.3.2
|
uses: actions/cache@v3.3.2
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_HOME }}
|
path: ${{ env.PRE_COMMIT_CACHE }}
|
||||||
key: |
|
key: |
|
||||||
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
|
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
|
||||||
- name: Fail job if cache restore failed
|
- name: Fail job if cache restore failed
|
||||||
@ -325,7 +326,7 @@ jobs:
|
|||||||
id: cache-precommit
|
id: cache-precommit
|
||||||
uses: actions/cache@v3.3.2
|
uses: actions/cache@v3.3.2
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PRE_COMMIT_HOME }}
|
path: ${{ env.PRE_COMMIT_CACHE }}
|
||||||
key: |
|
key: |
|
||||||
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
|
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
|
||||||
- name: Fail job if cache restore failed
|
- name: Fail job if cache restore failed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user