Skip to content

Commit a1317b8

Browse files
author
Jan Pazdziora
committed
Add support for testing with upstream (pip) versions of Django.
1 parent a035ecc commit a1317b8

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.github/workflows/test.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ on:
1111
jobs:
1212
docker-compose-keycloak:
1313
runs-on: ubuntu-24.04
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
django_version:
18+
-
19+
- 5.1
1420
steps:
1521
- uses: actions/checkout@v4
16-
- run: make build
22+
- run: make build DJANGO_VERSION=${{ matrix.django_version }}
1723
- run: sudo apt update && sudo apt install -y libwww-mechanize-perl libhttp-cookiejar-perl
1824
- run: echo '127.0.0.5 www keycloak' | sudo tee -a /etc/hosts
1925
- run: make run

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ endif
99
build:
1010
rm -rf tests/identity
1111
cp -rp identity tests/
12-
$(DOCKER_COMPOSE) -p django-identity-external -f tests/podman-compose.yml --profile test build
12+
$(DOCKER_COMPOSE) -p django-identity-external -f tests/podman-compose.yml --profile test build --build-arg DJANGO_VERSION=$(DJANGO_VERSION)
1313

1414
run:
1515
$(DOCKER_COMPOSE) -p django-identity-external -f tests/podman-compose.yml up &

tests/Dockerfile.app

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
FROM registry.fedoraproject.org/fedora
2-
RUN dnf install -y python3-django && dnf clean all
2+
ARG DJANGO_VERSION
3+
RUN if test -n "$DJANGO_VERSION" ; then \
4+
dnf install -y python3-pip && pip install "Django == $DJANGO_VERSION.*" ; \
5+
else \
6+
dnf install -y python3-django ; \
7+
fi \
8+
&& dnf clean all
39
RUN mkdir -p /var/www/django
410
WORKDIR /var/www/django
511
RUN django-admin startproject project

0 commit comments

Comments
 (0)