Skip to content

Commit

Permalink
(feat) Added GitHub workflow to run pre-commit checks for pushes to m…
Browse files Browse the repository at this point in the history
…aster and dev
  • Loading branch information
abel committed Sep 19, 2023
1 parent 8698291 commit 144fe3b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/pre-commit.yml
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
3 changes: 3 additions & 0 deletions poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[virtualenvs]
create = true
in-project = true

0 comments on commit 144fe3b

Please sign in to comment.