-
Notifications
You must be signed in to change notification settings - Fork 576
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split requirements files, integrate pre-commit hooks, and add pip cac…
…he to CI workflow
- Loading branch information
1 parent
18444c3
commit 76eed0b
Showing
4 changed files
with
60 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ["3.10", "3.11", "3.12", "3.13"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements*.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -r requirements-dev.txt | ||
- name: Run tests | ||
run: | | ||
pytest | ||
# Run pre-commit only on Python 3.13 + ubuntu. | ||
- name: Run pre-commit hooks | ||
if: ${{ matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest' }} | ||
run: | | ||
pre-commit run --all-files | ||
# Run pylint only on Python 3.13 + ubuntu. | ||
- name: Run pylint | ||
if: ${{ matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest' }} | ||
run: | | ||
pylint src/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-r requirements.txt | ||
black | ||
djlint | ||
pre-commit | ||
pylint | ||
pytest | ||
pytest-asyncio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters