Skip to content

Commit 812d7c4

Browse files
committed
Add reusable lint workflow for tskit-dev repos
1 parent 32ff03c commit 812d7c4

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/lint.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Reusable Lint Workflow
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
pre-commit:
8+
name: Lint
9+
runs-on: ubuntu-24.04
10+
steps:
11+
- name: Cancel Previous Runs
12+
uses: styfle/[email protected]
13+
with:
14+
access_token: ${{ github.token }}
15+
16+
- uses: actions/[email protected]
17+
18+
- uses: actions/[email protected]
19+
with:
20+
python-version: '3.12'
21+
22+
- name: Install clang-format (if needed)
23+
run: |
24+
if grep -q "clang" .pre-commit-config.yaml 2>/dev/null; then
25+
echo "Installing clang-format..."
26+
pip install --upgrade setuptools
27+
pip install clang-format==6.0.1
28+
else
29+
echo "No clang-format needed"
30+
fi
31+
32+
- uses: pre-commit/[email protected]

0 commit comments

Comments
 (0)