Skip to content

Commit

Permalink
Faster github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jcugat committed Feb 17, 2022
1 parent 2f7e865 commit c3929e4
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: 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 targets for ${{ matrix.python-version }}
run: |
poetry run tox
poetry run tox -e ${{ steps.tox-environment-name.outputs.result }}

0 comments on commit c3929e4

Please sign in to comment.