Skip to content

Commit

Permalink
Update the GH Actions workflow to run pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen committed May 30, 2021
1 parent 4c8168b commit d5c29b4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 43 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/lint_python.yaml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/run_precommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Run pre-commit

on: [push, pull_request]

jobs:
run_precommit:
name: Run pre-commit
runs-on: ubuntu-latest

steps:
# Checkout repository
- uses: actions/checkout@v2

# Setup Python and install pre-commit
- uses: actions/setup-python@v2
with:
python_version: "3.8"
- name: Install pre-commit
run: |
pip install -U pre-commit
# Load cached pre-commit environment
- name: set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v2
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}

# Run pre-commit
- name: Run pre-commit
run: |
pre-commit run --show-diff-on-failure --color=never --all-files --verbose
17 changes: 0 additions & 17 deletions .github/workflows/style.yaml

This file was deleted.

0 comments on commit d5c29b4

Please sign in to comment.