diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0190c0d..22884d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,8 +22,20 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] - + python-version: ["3.8", "3.9", "3.10"] + django-version: ["django32", "django40", "djangomaster"] + database-version: ["mysql", "postgres", "sqlite"] + # This is needed because Python 3.7 is only supported by Django 3.2 + include: + - python-version: "3.7" + django-version: "django32" + database-version: "mysql" + - python-version: "3.7" + django-version: "django32" + database-version: "postgres" + - python-version: "3.7" + django-version: "django32" + database-version: "sqlite" services: mysql: image: mysql @@ -50,14 +62,28 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | python -m pip install --upgrade pip poetry setuptools wheel poetry install -v - - name: Run tox targets for ${{ matrix.python-version }} + + - name: Compute tox environment name + id: tox-environment-name + shell: python + run: | + import sys + python_version = "py{}{}".format(*sys.version_info[:2]) + django_version = "${{ matrix.django-version }}" + database_version = "${{ matrix.database-version }}" + result = "{}-{}-{}".format(python_version, django_version, database_version) + print("::set-output name=result::{}".format(result)) + + - name: Run tox for ${{ steps.tox-environment-name.outputs.result }} run: | - poetry run tox + poetry run tox -e '${{ steps.tox-environment-name.outputs.result }}'