From cd625b93e2def120c458c2f3aec6a14c97f5c8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20M=C3=A9ndez?= Date: Tue, 6 Feb 2024 18:12:16 -0600 Subject: [PATCH] =?UTF-8?q?Hatch=20config=20+=20github=20action=20for=20ru?= =?UTF-8?q?nning=20tests=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ pyproject.toml | 15 +++++++++++---- 2 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6b46444 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 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"]