mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
pypy-3.8-v7.3.8 accidentally shipped with sqlite v3.7.17, which is a decade old, and causes the tests to fail with `django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required`. Until pypy-3.8-v7.3.9 is available in actions/setup-python, work around the problem by forcing unqualified "pypy-3.8" to specific (older) version "pypy-3.8-v7.3.7". See https://foss.heptapod.net/pypy/pypy/-/issues/3690 and https://github.com/actions/setup-python/issues/339.
75 lines
2.4 KiB
YAML
75 lines
2.4 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
|
|
# Ugh. pypy-3.8-v7.3.8 accidentally includes an ancient sqlite unusable by Django,
|
|
# so change "pypy-3.8" to specific (older) version "pypy-3.8-v7.3.7".
|
|
# (Remove these `sed` commands after pypy-3.8-v7.3.9 is released.)
|
|
# https://foss.heptapod.net/pypy/pypy/-/issues/3690
|
|
# https://github.com/actions/setup-python/issues/339
|
|
run: |
|
|
python -m tox --gh-matrix | sed -e 's/"pypy-3\.8"/"pypy-3.8-v7.3.7"/g'
|
|
python -m tox --gh-matrix-dump | sed -e 's/"pypy-3\.8"/"pypy-3.8-v7.3.7"/g' # 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
|