-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
4 additions
and
17 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 |
---|---|---|
|
@@ -7,25 +7,12 @@ env: | |
CACHE_NUM: 2 | ||
|
||
jobs: | ||
run-pre-commit: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set CACHE_DIR (hard-coded in cache action) | ||
run: echo "CACHE_DIR=$(echo ~/.pre_commit_cache)" >> $GITHUB_ENV | ||
- uses: actions/checkout@main | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.pre_commit_cache | ||
key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }}|${{ env.CACHE_NUM }} | ||
|
||
- name: Install and run pre-commit hooks | ||
run: | | ||
export PIP_CACHE_DIR="${CACHE_DIR}/pip" | ||
export PRE_COMMIT_HOME="${CACHE_DIR}/pre-commit" | ||
pip install pre-commit | ||
pre-commit install | ||
pre-commit run --all | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: pre-commit/[email protected] | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
|