From c825eabfb6f17043fe490f3163ca4fed9e619a40 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Wed, 25 Sep 2024 15:41:53 -0500 Subject: [PATCH] ci: run pre-commit for our testing --- .github/workflows/pre-commit.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 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 000000000..35dae536b --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -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