diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6df2879..28195cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,14 +25,65 @@ env: PIP_CACHE_DIR: ${{ github.workspace }}/.pip-cache jobs: + test-lts: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.11"] + django: ["4.2"] + wagtail: ["5.2"] + db: ["sqlite", "postgres"] + + services: + postgres: + image: postgres:15 + env: + POSTGRES_PASSWORD: postgres + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + + steps: + - name: ๐Ÿ“ฅ Checkout repository + uses: actions/checkout@v4 + + - name: ๐Ÿ Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: | + pyproject.toml + tox.ini + + - name: ๐Ÿ“ฆ Install dependencies + run: | + python -Im pip install --upgrade pip flit tox tox-gh-actions || (echo "::error::Failed to install dependencies" && exit 1) + + - name: ๐Ÿ’พ Cache tox environments + uses: actions/cache@v4 + with: + path: .tox + key: tox-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.django }}-${{ matrix.wagtail }}-${{ hashFiles('tox.ini') }} + + - name: ๐Ÿ—๏ธ Build wheel + run: python -Im flit build --format wheel || (echo "::error::Failed to build wheel" && exit 1) + + - name: ๐Ÿงช Run tests + env: + TOXENV: py${{ matrix.python-version }}-django${{ matrix.django }}-wagtail${{ matrix.wagtail }}-sqlite + run: | + tox --installpkg ./dist/*.whl || (echo "::error::Tests failed" && exit 1) + test-sqlite: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.11", "3.12"] - django: ["5.1"] - wagtail: ["6.2", "6.3"] + django: ["5.0", "5.2"] + wagtail: ["6.0", "6.2", "6.3"] db: ["sqlite"] steps: @@ -81,8 +132,8 @@ jobs: fail-fast: false matrix: python-version: ["3.12"] - django: ["5.1"] - wagtail: ["6.2", "6.3"] + django: ["5.0", "5.1"] + wagtail: ["6.0", "6.2", "6.3"] db: ["postgres"] services: diff --git a/tox.ini b/tox.ini index ea6e9cb..68b0c07 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ min_version = 4.11 envlist = - py{3.11,3.12}-django{5.1}-wagtail{6.2,6.3} + py{3.11,3.12}-django{4.2,5.0,5.1,5.2}-wagtail{5.2,6.0,6.1,6.2,6.3} [gh-actions] python = @@ -31,7 +31,12 @@ setenv = extras = testing deps = + django5.0: Django>=5.0,<5.1 django5.1: Django>=5.1,<5.2 + django5.2: Django>=5.2,<5.3 + wagtail5.2: wagtail>=5.2,<6.0 + wagtail6.0: wagtail>=6.0,<6.1 + wagtail6.1: wagtail>=6.1,<6.2 wagtail6.2: wagtail>=6.2,<6.3 wagtail6.3: wagtail>=6.3,<6.4 postgres: psycopg2>=2.9