Skip to content

Commit 144fe3b

Browse files
author
abel
committed
(feat) Added GitHub workflow to run pre-commit checks for pushes to master and dev
1 parent 8698291 commit 144fe3b

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

.github/workflows/pre-commit.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master, dev]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Install Python
15+
uses: actions/setup-python@v3
16+
- name: Install poetry
17+
run: python -m pip install poetry
18+
19+
- name: Configure poetry
20+
run: python -m poetry config virtualenvs.in-project true
21+
22+
- name: Cache the virtualenv
23+
id: cache-venv
24+
uses: actions/cache@v3
25+
with:
26+
path: ./.venv
27+
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
28+
29+
- name: Install dependencies
30+
if: steps.cache-venv.outputs.cache-hit != 'true'
31+
run: python -m poetry install
32+
33+
- name: Run pre-commit
34+
run: pre-commit run --show-diff-on-failure --color=always --all-files
35+
shell: bash

poetry.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[virtualenvs]
2+
create = true
3+
in-project = true

0 commit comments

Comments
 (0)