Skip to content

Commit

Permalink
Add pre-commit workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
maresb committed Sep 10, 2024
1 parent df16e4b commit 442302b
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Perform pre-commit checks

on:
push:
pull_request:
workflow_dispatch:

jobs:
pre-commit:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
name: ${{ matrix.os }} pre-commit
steps:
# Initialization
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11


# Basic install
- name: Install pre-commit
run: python -m pip install pre-commit
- name: List pip package versions
run: python -m pip freeze --local

# Run pre-commit
- name: RUN PRE-COMMIT
run: pre-commit run --show-diff-on-failure --color=always --all-files

# Upload logs
- name: Upload pre-commit log
if: always()
uses: actions/upload-artifact@v4
with:
name: pre-commit-log-${{ matrix.os }}
path: /home/runner/.cache/pre-commit/pre-commit.log

0 comments on commit 442302b

Please sign in to comment.