From 442302bfa54c16fe436d0ba7505419d0ed91d4ff Mon Sep 17 00:00:00 2001 From: Ben Mares Date: Tue, 10 Sep 2024 18:34:18 +0200 Subject: [PATCH] Add pre-commit workflow --- .github/workflows/pre-commit.yml | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 00000000..6140d2f0 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -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