8000 add a job to verify that pre-commit works · uutils/coreutils@aa4a85a · GitHub
[go: up one dir, main page]

Skip to content

Commit aa4a85a

Browse files
committed
add a job to verify that pre-commit works
1 parent 599a958 commit aa4a85a

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/code-quality.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,3 +216,43 @@ jobs:
216216
shell: bash
217217
run: |
218218
python3 -m unittest util/test_compare_test_results.py
219+
220+
pre_commit:
221+
name: Pre-commit hooks
222+
runs-on: ubuntu-latest
223+
steps:
224+
- name: Checkout repository
225+
uses: actions/checkout@v4
226+
with:
227+
persist-credentials: false
228+
229+
- name: Setup Rust toolchain
230+
uses: dtolnay/rust-toolchain@master
231+
with:
232+
toolchain: stable
233+
components: rustfmt, clippy
234+
235+
- name: Cache Rust dependencies
236+
uses: Swatinem/rust-cache@v2
237+
238+
- name: Setup Python
239+
uses: actions/setup-python@v5
240+
with:
241+
python-version: '3.x'
242+
243+
- name: Install pre-commit
244+
run: pip install pre-commit
245+
246+
- name: Install cspell
247+
run: npm install -g cspell
248+
249+
- name: Cache pre-commit environments
250+
uses: actions/cache@v4
251+
with:
252+
path: ~/.cache/pre-commit
253+
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
254+
restore-keys: |
255+
pre-commit-${{ runner.os }}-
256+
257+
- name: Run pre-commit
258+
run: pre-commit run

0 commit comments

Comments
 (0)
0