Skip to content

Commit 75054b3

Browse files
CI: Add GitHub CI job to check pre-commit to .github/workflows/main.yml
Signed-off-by: Bernhard Kaindl <[email protected]>
1 parent 49377ca commit 75054b3

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ env:
2525
PIP_DISABLE_PIP_VERSION_CHECK: "1" # Reduce noise in logs
2626

2727
jobs:
28+
pre-commit:
29+
env:
30+
SKIP: pytest,pytype,tox,no-commit-to-branch
31+
runs-on: ubuntu-22.04
32+
steps:
33+
- uses: actions/checkout@v5
34+
- uses: actions/setup-python@v6
35+
with:
36+
python-version: 3.11
37+
- uses: pre-commit/[email protected]
38+
- uses: pre-commit-ci/[email protected]
39+
if: always()
40+
2841
test:
2942
strategy:
3043
# See: https://github.com/xenserver/python-libs/pull/26#discussion_r1179482169
@@ -43,13 +56,13 @@ jobs:
4356
env:
4457
PYTHON_VERSION_USED_FOR_COVERAGE: ${{ '3.11' }}
4558
steps:
46-
- uses: actions/checkout@v4
59+
- uses: actions/checkout@v5
4760
with:
4861
fetch-depth: 0 # Needed by diff-cover to get the changed lines: origin/master..HEAD
4962
- name: Set up Python ${{ matrix.python-version }}
5063
# Python 3.11 is not supported in the nektos/act container, so we skip this step
5164
if: ${{ !(matrix.python-version == '3.11' && github.actor == 'nektos/act') }}
52-
uses: actions/setup-python@v5
65+
uses: actions/setup-python@v6
5366
with:
5467
python-version: ${{ matrix.python-version }}
5568

0 commit comments

Comments
 (0)