Skip to content

Fix #402

Fix #402 #217

Workflow file for this run

name: Test django-admin-sortable2
on:
push:
branches:
- master
paths-ignore:
- '**.md'
- '**.rst'
- '/docs/**'
pull_request:
branches:
- master
paths-ignore:
- '**.md'
- '**.rst'
- '/docs/**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
node-version: ["18.x"]
django-version: ["4.2.*", "5.0.*", "5.1.*"]
exclude: # https://docs.djangoproject.com/en/5.0/faq/install/#what-python-version-can-i-use-with-django
- python-version: "3.9"
django-version: "5.0.*"
- python-version: "3.9"
django-version: "5.1.*"
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
npm ci --include=dev
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel
python -m pip install "Django==${{ matrix.django-version }}"
python -m pip install -r testapp/requirements.txt
python -m playwright install
python -m playwright install-deps
- name: Build Client
run: |
npm run build
- name: Patch templates
run: |
mkdir -p adminsortable2/templates/adminsortable2/edit_inline
DJANGO_VERSIONS=("4.2" "5.0" "5.1")
for django_version in ${DJANGO_VERSIONS[@]}; do
echo $django_version
curl --silent --output adminsortable2/templates/adminsortable2/edit_inline/stacked-django-$django_version.html https://raw.githubusercontent.com/django/django/stable/$django_version.x/django/contrib/admin/templates/admin/edit_inline/stacked.html
curl --silent --output adminsortable2/templates/adminsortable2/edit_inline/tabular-django-$django_version.html https://raw.githubusercontent.com/django/django/stable/$django_version.x/django/contrib/admin/templates/admin/edit_inline/tabular.html
patch -p0 adminsortable2/templates/adminsortable2/edit_inline/stacked-django-$django_version.html patches/stacked-django-4.0.patch
patch -p0 adminsortable2/templates/adminsortable2/edit_inline/tabular-django-$django_version.html patches/tabular-django-4.0.patch
done
- name: Test with pytest
run: |
mkdir -p workdir
python -m pytest testapp