Skip to content

Commit 114ab50

Browse files
authored
Merge pull request MCP-Pipeline#3 from rafiattrach/github-precommit-action
Add GitHub Action for pre-commit checks on PRs
2 parents 7c2c964 + 210a42a commit 114ab50

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/pre-commit.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Pre-commit checks
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
pre-commit:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.11'
18+
19+
- name: Cache pip dependencies
20+
uses: actions/cache@v4
21+
with:
22+
path: ~/.cache/pip
23+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
24+
restore-keys: |
25+
${{ runner.os }}-pip-
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install pytest==7.4.3
31+
pip install -e ".[dev]" # Install package with dev dependencies
32+
33+
- uses: pre-commit/action@v3.0.1

0 commit comments

Comments
 (0)