#67 gh action to build demo image #36
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: unittests | |
on: | |
pull_request: | |
branches: | |
- master | |
- develop | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
django: | |
- "3.2" | |
- "4.0" | |
- "4.1" | |
- "4.2" | |
env: | |
DJANGO_SETTINGS_MODULE: sites.test.settings | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Set up pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install Django ${{ matrix.django }} | |
run: | | |
DJANGO_VERSION_MAJOR=$(echo ${{ matrix.django }} | cut -d. -f1) | |
DJANGO_VERSION_NEXT_MINOR=$(($(echo ${{ matrix.django }} | cut -d. -f2) + 1)) | |
python -m pip install "Django>=${{ matrix.django }},<$DJANGO_VERSION_MAJOR.$DJANGO_VERSION_NEXT_MINOR" | |
- name: Install django-admin-sortable2 for Django 3.2 | |
if: ${{ matrix.django == '3.2' }} | |
run: | | |
python -m pip install django-admin-sortable2==1.0.4 | |
- name: Install dependencies | |
run: | | |
python -m pip install -r requirements.test.txt | |
- name: Test | |
run: | | |
py.test tests |