Skip to content

Commit

Permalink
ci: run pre-commit for our testing
Browse files Browse the repository at this point in the history
  • Loading branch information
cardoe committed Sep 25, 2024
1 parent 88a551a commit c825eab
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: pre-commit

on: # yamllint disable-line rule:truthy
pull_request:
push:
branches:
- main

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
id: setup-python
with:
python-version: '3.11'
cache: 'pip'
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- run: pip install pre-commit
- name: "run pre-commit"
run: |
echo '```console' > $GITHUB_STEP_SUMMARY
pre-commit run --all-files --show-diff-on-failure --color=never >> $GITHUB_STEP_SUMMARY
exit_code=$?
echo '```' >> $GITHUB_STEP_SUMMARY
exit $exit_code

0 comments on commit c825eab

Please sign in to comment.