Skip to content

Commit 4e63b91

Browse files
committed
set drf version based on django version in CI
1 parent f8edec8 commit 4e63b91

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,32 @@ jobs:
6969
run: |
7070
poetry install -E djangorestframework
7171
poetry run pip install -U "Django~=${{ matrix.django-version }}"
72+
# Check if Django version is 4.2 or higher
73+
if [[ "${{ matrix.django-version }}" =~ ^4\.2|^4\.3 ]]; then
74+
poetry run pip install "djangorestframework<3.15"
75+
fi
7276
- name: Run Unit Tests w/ djangorestframework
7377
run: |
7478
poetry run pytest --cov-fail-under=30
7579
- name: Install django-filters
7680
run: |
7781
poetry install -E filters
7882
poetry run pip install -U "Django~=${{ matrix.django-version }}"
83+
# Check if Django version is 4.2 or higher
84+
if [[ "${{ matrix.django-version }}" =~ ^4\.2|^4\.3 ]]; then
85+
poetry run pip install "djangorestframework<3.15"
86+
fi
7987
- name: Run Unit Tests w/ django-filter
8088
run: |
8189
poetry run pytest --cov-fail-under=30
8290
- name: Install all deps
8391
run: |
8492
poetry install -E all
8593
poetry run pip install -U "Django~=${{ matrix.django-version }}"
94+
# Check if Django version is 4.2 or higher
95+
if [[ "${{ matrix.django-version }}" =~ ^4\.2|^4\.3 ]]; then
96+
poetry run pip install "djangorestframework<3.15"
97+
fi
8698
- name: Run Full Unit Tests
8799
run: |
88100
poetry run pytest

0 commit comments

Comments
 (0)