mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
CI: Refactor workflows, update test matrix
* Split test, integration-test, and release workflows, simplifying config and logic for each. * Use environment to separate secrets for release workflow. * Update test matrix with newer Django and Python versions.
This commit is contained in:
107
.github/workflows/test.yml
vendored
Normal file
107
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
name: test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [ "main", "v[0-9]*" ]
|
||||
tags: [ "v[0-9]*" ]
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# Weekly test (on branch main) every Thursday at 12:00 UTC.
|
||||
# (Used to monitor compatibility with Django patches/dev and other dependencies.)
|
||||
- cron: "0 12 * * 4"
|
||||
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: ${{ matrix.config.tox }} ${{ matrix.config.options }}
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- { tox: "lint", python: "3.10" }
|
||||
- { tox: "docs", python: "3.10" }
|
||||
|
||||
# Anymail supports the same Python versions as Django, plus PyPy.
|
||||
# https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
|
||||
|
||||
# Django 2.0: Python 3.5+
|
||||
- { tox: django20-py35-all, python: "3.5" }
|
||||
- { tox: django20-py36-all, python: "3.6" }
|
||||
- { tox: django20-pypy3-all, python: "pypy-3.6" }
|
||||
# Django 2.1: Python 3.5, 3.6, or 3.7
|
||||
- { tox: django21-py35-all, python: "3.5" }
|
||||
- { tox: django21-py36-all, python: "3.6" }
|
||||
- { tox: django21-py37-all, python: "3.7" }
|
||||
- { tox: django21-pypy3-all, python: "pypy-3.7" }
|
||||
# Django 2.2: Python 3.5, 3.6, 3.7, 3.8 (added in 2.2.8), 3.9 (added in 2.2.17)
|
||||
- { tox: django22-py35-all, python: "3.5" }
|
||||
- { tox: django22-py36-all, python: "3.6" }
|
||||
- { tox: django22-py37-all, python: "3.7" }
|
||||
- { tox: django22-py38-all, python: "3.8" }
|
||||
- { tox: django22-py39-all, python: "3.9" }
|
||||
- { tox: django22-pypy3-all, python: "pypy-3.8" }
|
||||
# Django 3.0: Python 3.6, 3.7, 3.8, 3.9 (added in 3.0.11)
|
||||
- { tox: django30-py36-all, python: "3.6" }
|
||||
- { tox: django30-py37-all, python: "3.7" }
|
||||
- { tox: django30-py38-all, python: "3.8" }
|
||||
- { tox: django30-py39-all, python: "3.9" }
|
||||
- { tox: django30-pypy3-all, python: "pypy-3.8" }
|
||||
# Django 3.1: Python 3.6, 3.7, 3.8, 3.9 (added in 3.1.3)
|
||||
- { tox: django31-py36-all, python: "3.6" }
|
||||
- { tox: django31-py37-all, python: "3.7" }
|
||||
- { tox: django31-py38-all, python: "3.8" }
|
||||
- { tox: django31-py39-all, python: "3.9" }
|
||||
- { tox: django31-pypy3-all, python: "pypy-3.8" }
|
||||
# Django 3.2: Python 3.6, 3.7, 3.8, 3.9
|
||||
- { tox: django32-py36-all, python: "3.6" }
|
||||
- { tox: django32-py37-all, python: "3.7" }
|
||||
- { tox: django32-py38-all, python: "3.8" }
|
||||
- { tox: django32-py39-all, python: "3.9" }
|
||||
- { tox: django32-pypy3-all, python: "pypy-3.8" }
|
||||
# Django 4.0: Python 3.8, 3.9, 3.10
|
||||
- { tox: django40-py38-all, python: "3.8" }
|
||||
- { tox: django40-py39-all, python: "3.9" }
|
||||
- { tox: django40-py310-all, python: "3.10" }
|
||||
- { tox: django40-pypy3-all, python: "pypy-3.8" }
|
||||
# Django current development (direct from GitHub source)
|
||||
- { tox: djangoDev-py38-all, python: "3.8", options: allow-failures }
|
||||
- { tox: djangoDev-py39-all, python: "3.9", options: allow-failures }
|
||||
- { tox: djangoDev-py310-all, python: "3.10", options: allow-failures }
|
||||
- { tox: djangoDev-py311-all, python: "3.11.0-alpha - 3.11", options: allow-failures }
|
||||
# Install without optional extras (don't need to cover entire matrix)
|
||||
- { tox: django40-py310-none, python: "3.10" }
|
||||
- { tox: django40-py310-amazon_ses, python: "3.10" }
|
||||
- { tox: django40-py310-postal, python: "3.10" }
|
||||
# Test some specific older package versions
|
||||
- { tox: django22-py37-all-old_urllib3, python: "3.7" }
|
||||
|
||||
steps:
|
||||
- name: Get code
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Python ${{ matrix.config.python }}
|
||||
# Ensure matrix Python version is installed and available for tox
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.config.python }}
|
||||
- name: Setup default Python
|
||||
# Change default Python version back to something consistent
|
||||
# for installing/running tox
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.10"
|
||||
- name: Install tox
|
||||
run: |
|
||||
set -x
|
||||
python --version
|
||||
pip install tox
|
||||
tox --version
|
||||
- name: Test ${{ matrix.config.tox }}
|
||||
run: |
|
||||
tox -e ${{ matrix.config.tox }}
|
||||
continue-on-error: ${{ contains( matrix.config.options, 'allow-failures' ) }}
|
||||
env:
|
||||
CONTINUOUS_INTEGRATION: true
|
||||
TOX_FORCE_IGNORE_OUTCOME: false
|
||||
Reference in New Issue
Block a user