Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
so-saf committed Sep 7, 2024
1 parent 88058d3 commit 7ff26e8
Show file tree
Hide file tree
Showing 4 changed files with 420 additions and 165 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Linting

on:
push:
branches:
- master
pull_request:
workflow_dispatch:

env:
DEFAULT_PYTHON: "3.12"

jobs:
ruff:
name: Ruff
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Poetry
run: pipx install poetry
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Install Python dependencies
run: poetry install --no-interaction
- name: Run Ruff
run: poetry run ruff check .
77 changes: 77 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
name: Testing

on:
push:
branches:
- master
pull_request:
workflow_dispatch:

env:
DEFAULT_PYTHON: "3.12"

jobs:
pytest:
name: Python ${{ matrix.python }}
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python }}
cache: "poetry"
- name: Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install --no-interaction
- name: Run pytest
run: poetry run pytest --cov pydantic_filters tests
- name: Upload coverage artifact
uses: actions/[email protected]
with:
name: coverage-${{ matrix.python }}
path: .coverage

coverage:
runs-on: ubuntu-latest
needs: pytest
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Download coverage data
uses: actions/[email protected]
- name: Set up Poetry
run: pipx install poetry
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install --no-interaction
- name: Process coverage results
run: |
poetry run coverage combine coverage*/.coverage*
poetry run coverage xml -i
- name: Upload coverage report
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
Loading

0 comments on commit 7ff26e8

Please sign in to comment.