From 4d14f4c2cff3df2efe66c9e7cf7d05763813f604 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 1 Feb 2024 12:20:47 -0500 Subject: [PATCH] Run pre-commit in GitHub Actions (#17) * Run pre-commit in GitHub Actions * Don't run pre-commit from Python * Review feedback --- .github/workflows/lint.yaml | 25 +++++++++++++++++++++++++ ci/lint.sh | 8 ++++++++ 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/lint.yaml create mode 100755 ci/lint.sh diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..0e63be0 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,25 @@ +name: Lint + +on: + pull_request: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Lint + run: ./ci/lint.sh diff --git a/ci/lint.sh b/ci/lint.sh new file mode 100755 index 0000000..a50a4f9 --- /dev/null +++ b/ci/lint.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Runs pre-commit + +set -ue + +pip install pre-commit + +pre-commit run --all-files --show-diff-on-failure