Skip to content

Commit b8115ff

Browse files
committed
Move pre-commit to its own workflow
1 parent cc78c8b commit b8115ff

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,11 @@ jobs:
4242
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
4343
run: |
4444
source actions-ci/install.sh
45-
- name: Pip install Sphinx, pre-commit
45+
- name: Pip install Sphinx
4646
run: |
47-
pip install --force-reinstall Sphinx sphinx-rtd-theme sphinx-autoapi pre-commit
47+
pip install --force-reinstall Sphinx sphinx-rtd-theme sphinx-autoapi
4848
- name: Library version
4949
run: git describe --dirty --always --tags
50-
- name: Pre-commit hooks
51-
run: |
52-
pre-commit run --all-files
5350
- name: Clone and build circuitpython unix port
5451
run: |
5552
set -e

.github/workflows/pre-commit.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2019 Anthony Sottile
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: pre-commit
6+
7+
on: [pull_request, push]
8+
9+
jobs:
10+
pre-commit:
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- uses: actions/checkout@v1
14+
- uses: actions/setup-python@v1
15+
- name: set PY
16+
run: echo >>$GITHUB_ENV "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
17+
- uses: actions/cache@v1
18+
with:
19+
path: ~/.cache/pre-commit
20+
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
21+
- uses: pre-commit/action@v1.1.0

0 commit comments

Comments
 (0)