-
Notifications
You must be signed in to change notification settings - Fork 667
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 home-assistant/core#46696. Use PRE_COMMIT_CACHE instead of PRE_COMMIT_HOME as well.
- Loading branch information
Showing
1 changed file
with
7 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ on: | |
|
||
env: | ||
DEFAULT_PYTHON: "3.11" | ||
PRE_COMMIT_HOME: ~/.cache/pre-commit | ||
PRE_COMMIT_CACHE: ~/.cache/pre-commit | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref }}" | ||
|
@@ -49,7 +49,8 @@ jobs: | |
id: cache-precommit | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ env.PRE_COMMIT_HOME }} | ||
path: ${{ env.PRE_COMMIT_CACHE }} | ||
lookup-only: true | ||
key: | | ||
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | ||
restore-keys: | | ||
|
@@ -132,7 +133,7 @@ jobs: | |
id: cache-precommit | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ env.PRE_COMMIT_HOME }} | ||
path: ${{ env.PRE_COMMIT_CACHE }} | ||
key: | | ||
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: Fail job if cache restore failed | ||
|
@@ -208,7 +209,7 @@ jobs: | |
id: cache-precommit | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ env.PRE_COMMIT_HOME }} | ||
path: ${{ env.PRE_COMMIT_CACHE }} | ||
key: | | ||
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: Fail job if cache restore failed | ||
|
@@ -249,7 +250,7 @@ jobs: | |
id: cache-precommit | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ env.PRE_COMMIT_HOME }} | ||
path: ${{ env.PRE_COMMIT_CACHE }} | ||
key: | | ||
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: Fail job if cache restore failed | ||
|
@@ -325,7 +326,7 @@ jobs: | |
id: cache-precommit | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ env.PRE_COMMIT_HOME }} | ||
path: ${{ env.PRE_COMMIT_CACHE }} | ||
key: | | ||
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: Fail job if cache restore failed | ||
|