-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update CI action to enforce hooks (#277)
* update CI action to enforce hooks * update action
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 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 |
---|---|---|
|
@@ -61,6 +61,28 @@ jobs: | |
- name: 🔎 poetry run python run_test.py | ||
run: poetry run python run_test.py | ||
|
||
# Enforce pre-commit hooks =========================== | ||
- name: Get changed files | ||
if: (matrix.codecov) | ||
id: changed-files | ||
uses: tj-actions/changed-files@v45 | ||
|
||
- uses: actions/cache@v4 | ||
if: (matrix.codecov) | ||
id: cache-precommit | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: ${{ runner.os }}-precommit-hooks-v2-${{ hashFiles('**/.pre-commit-config.yaml') }} | ||
|
||
- name: Installing pre-commit hooks (cached) | ||
if: (matrix.codecov) && (steps.cache-precommit.outputs.cache-hit != 'true') | ||
run: poetry run pre-commit install --install-hooks | ||
|
||
- name: Run style checking via pre-commit | ||
if: (matrix.codecov) | ||
run: poetry run pre-commit run --files ${{ steps.changed-files.outputs.all_changed_files }} | ||
# ====================================================== | ||
|
||
- name: 🔼 Upload coverage to Codecov | ||
if: (matrix.codecov) | ||
uses: codecov/[email protected] | ||
|