Skip to content

Commit 210a42a

Browse files
committed
Improve pre-commit GitHub Action workflow
- Add pip dependency caching for faster workflow runs - Pin pytest version for reproducible test environments - Install package with dev dependencies using pip install -e ".[dev]" This enhances the reliability and performance of pre-commit checks on PRs.
1 parent b00b910 commit 210a42a

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/pre-commit.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,23 @@ jobs:
1111
- uses: actions/checkout@v4
1212
with:
1313
fetch-depth: 0
14+
1415
- uses: actions/setup-python@v5
1516
with:
1617
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+
1727
- name: Install dependencies
1828
run: |
1929
python -m pip install --upgrade pip
20-
pip install pytest # Install pytest
21-
pip install -e .
30+
pip install pytest==7.4.3
31+
pip install -e ".[dev]" # Install package with dev dependencies
32+
2233
- uses: pre-commit/action@v3.0.1

0 commit comments

Comments
 (0)