summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Ganssle <git@m.ganssle.io>2022-12-03 13:20:12 -0500
committerPaul Ganssle <git@m.ganssle.io>2022-12-03 14:16:15 -0500
commit5edf7d739a434c28d636ea7b42707383e5e50a53 (patch)
tree9761897faa807bc16df7e0dd9bf15edf660e651f
parent95e20ce2afaf9f744b0ccb990b32565d19eef349 (diff)
downloaddateutil-git-5edf7d739a434c28d636ea7b42707383e5e50a53.tar.gz
Run pre-commit hooks on GHA
-rw-r--r--.github/workflows/validate.yml6
-rw-r--r--tox.ini10
2 files changed, 15 insertions, 1 deletions
diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml
index 39d5d92..5a4d122 100644
--- a/.github/workflows/validate.yml
+++ b/.github/workflows/validate.yml
@@ -78,12 +78,16 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
- toxenv: ["docs", "tz"]
+ toxenv: ["docs", "tz", "precommit"]
env:
TOXENV: ${{ matrix.toxenv }}
+ PRE_COMMIT_FROM_REF: ${{ github.base_ref }}
+ PRE_COMMIT_TO_REF: "HEAD"
steps:
- uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
- name: ${{ matrix.toxenv }}
uses: actions/setup-python@v4
with:
diff --git a/tox.ini b/tox.ini
index c5f63cb..a03e480 100644
--- a/tox.ini
+++ b/tox.ini
@@ -68,6 +68,16 @@ source = dateutil
skip_covered = True
show_missing = True
+[testenv:precommit]
+description = Run the pre-commit hooks on all files
+passenv =
+ PRE_COMMIT*
+deps =
+ pre-commit
+commands =
+ pre-commit install -f --install-hooks
+ pre-commit run --all-files
+
[testenv:tz]
# Warning: This will modify the repository and is only intended to be run
# as part of the CI process, not locally.