diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7104fec --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + pull_request: + +jobs: + quality: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install dependencies + run: pip install -e ".[dev]" + + - name: ruff check + run: ruff check . + + - name: ruff format --check + run: ruff format --check . + + - name: mypy + run: mypy src + + - name: pytest + run: pytest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a4e354e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,26 @@ +repos: + - repo: local + hooks: + - id: ruff-check + name: ruff check + entry: ruff check . + language: system + pass_filenames: false + + - id: ruff-format-check + name: ruff format --check + entry: ruff format --check . + language: system + pass_filenames: false + + - id: mypy + name: mypy + entry: mypy src + language: system + pass_filenames: false + + - id: pytest + name: pytest + entry: pytest + language: system + pass_filenames: false diff --git a/pyproject.toml b/pyproject.toml index 9cc7d60..e25220f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ dev = [ "respx>=0.21", "ruff>=0.4", "mypy>=1.10", + "pre-commit>=3.0", ] [project.urls]