Skip to content

Commit

Permalink
Add CI to run linters and pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
owenlamont committed Dec 7, 2024
1 parent 3241a5f commit 88c9ecd
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Pre-commit checks
on:
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install pre-commit globally
run: uv tool install pre-commit --with pre-commit-uv --force
- name: Run pre-commit hooks
env:
SKIP: no-commit-to-branch # Skip the main branch protection hook in CI
run: pre-commit run --all-files
22 changes: 22 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Pytest
on:
pull_request:
jobs:
pytest:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install the project
run: uv sync --all-extras --dev
- name: Run tests
run: uv run pytest tests

0 comments on commit 88c9ecd

Please sign in to comment.