Skip to content

Commit f9895d1

Browse files
committed
feat(ci): Add pre-commit GitHub Actions workflow and update gitignore
1 parent 25f44db commit f9895d1

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/pre-commit.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Lint with Pre-commit
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
9+
jobs:
10+
pre-commit:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
pull-requests: write
15+
16+
steps:
17+
- uses: actions/checkout@v5
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v6
21+
with:
22+
enable-cache: true
23+
24+
- name: Set up Python
25+
run: uv python install
26+
27+
- name: Install the project
28+
run: uv sync --locked --all-extras --dev
29+
30+
- name: Run pre-commit (all files on push, only changes on PR)
31+
run: |
32+
if [ "${{ github.event_name }}" = "push" ]; then
33+
uv run pre-commit run --all-files --show-diff-on-failure --color always
34+
else
35+
uv run pre-commit run --from-ref origin/${{ github.base_ref }} --to-ref HEAD --show-diff-on-failure --color always
36+
fi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,4 @@ dmypy.json
140140

141141
# Cython debug symbols
142142
cython_debug/
143+
/.secrets

0 commit comments

Comments
 (0)