diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..deffd8a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI +on: + push: + pull_request: +jobs: + test: + strategy: + fail-fast: true + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12"] + django-version: ["4.0", "4.1", "4.2", "5.0"] + os: [ubuntu-latest] + exclude: + - django-version: "4.0" + python-version: "3.11" + - django-version: "4.0" + python-version: "3.12" + - django-version: "4.1" + python-version: "3.12" + - django-version: "5.0" + python-version: "3.9" + 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 diff --git a/pyproject.toml b/pyproject.toml index ee21033..dd04518 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"]