Skip to content

Commit

Permalink
Hatch config + github action for running tests πŸš€
Browse files Browse the repository at this point in the history
  • Loading branch information
matagus committed Feb 7, 2024
1 parent 037d418 commit cd625b9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI
on:
push:
pull_request:
jobs:
test:
strategy:
fail-fast: true
matrix:
python-version: ['3.11', '3.12']
django-version: ['4.0', '5.0']
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade hatch
- name: Run tests for Python ${{ matrix.python-version }} and Django ${{ matrix.django-version }} on ${{ matrix.os }}
run: |
hatch run test.py${{ matrix.python-version }}-${{ matrix.django-version }}:test
15 changes: 11 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,22 @@ dependencies = [
"Django>=4.0", "ipython", "ipdb", "mypy", "typing-extensions",
]


# Test environment
[[tool.hatch.envs.test.matrix]]
django = ["4.0"]
python = ["3.9", "3.10"]

[[tool.hatch.envs.test.matrix]]
django = ["4.1"]
python = ["3.9", "3.10", "3.11"]
django = ["4.1", "4.2"]

[[tool.hatch.envs.test.matrix]]
python = ["3.11", "3.12"]
django = ["4.2", "5.0"]
django = ["4.2"]
python = ["3.9", "3.10", "3.11", "3.12"]

[[tool.hatch.envs.test.matrix]]
django = ["5.0"]
python = ["3.10", "3.11", "3.12"]

[tool.hatch.envs.test]
dependencies = ["coverage[toml]", "django~={matrix:django}.0"]
Expand Down

0 comments on commit cd625b9

Please sign in to comment.