-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat) Added GitHub workflow to run pre-commit checks for pushes to m…
…aster and dev
- Loading branch information
abel
committed
Sep 19, 2023
1 parent
8698291
commit 144fe3b
Showing
2 changed files
with
38 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [master, dev] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install Python | ||
uses: actions/setup-python@v3 | ||
- name: Install poetry | ||
run: python -m pip install poetry | ||
|
||
- name: Configure poetry | ||
run: python -m poetry config virtualenvs.in-project true | ||
|
||
- name: Cache the virtualenv | ||
id: cache-venv | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./.venv | ||
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: python -m poetry install | ||
|
||
- name: Run pre-commit | ||
run: pre-commit run --show-diff-on-failure --color=always --all-files | ||
shell: bash |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[virtualenvs] | ||
create = true | ||
in-project = true |