Files
django-anymail/.github/workflows/test.yml
medmunds 4d93183e5e CI: get GitHub test matrix from tox envlist
Stop maintaining duplicate (and often not-quite-
in-sync) test matrices in tox.ini and test.yml.
2022-01-30 11:11:41 -08:00

70 lines
2.0 KiB
YAML

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:
get-envlist:
runs-on: ubuntu-20.04
outputs:
envlist: ${{ steps.generate-envlist.outputs.envlist }}
steps:
- name: Get code
uses: actions/checkout@v2
- name: Install tox-gh-matrix
run: |
python -m pip install tox tox-gh-matrix
python -m tox --version
- name: Generate tox envlist
id: generate-envlist
run: |
python -m tox --gh-matrix
python -m tox --gh-matrix-dump # for debugging
test:
runs-on: ubuntu-20.04
needs: get-envlist
strategy:
matrix:
tox: ${{ fromJSON(needs.get-envlist.outputs.envlist) }}
fail-fast: false
name: ${{ matrix.tox.name }} ${{ matrix.tox.ignore_outcome && 'allow-failures' || '' }}
timeout-minutes: 15
steps:
- name: Get code
uses: actions/checkout@v2
- name: Setup Python ${{ matrix.tox.python.version }}
# Ensure matrix Python version is installed and available for tox
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.tox.python.spec }}
- 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.8"
- name: Install tox
run: |
set -x
python -VV
python -m pip install tox
python -m tox --version
- name: Test ${{ matrix.tox.name }}
run: |
python -m tox -e ${{ matrix.tox.name }}
continue-on-error: ${{ matrix.tox.ignore_outcome == true }}
env:
CONTINUOUS_INTEGRATION: true
TOX_OVERRIDE_IGNORE_OUTCOME: false