Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster github actions #72

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 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: 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 }}'