mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41: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:
88
.github/workflows/integration-test.yml
vendored
Normal file
88
.github/workflows/integration-test.yml
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
name: integration-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:15 UTC.
|
||||
# (Used to monitor compatibility with ESP API changes.)
|
||||
- cron: "15 12 * * 4"
|
||||
|
||||
|
||||
jobs:
|
||||
skip_duplicate_runs:
|
||||
# Avoid running the live integration tests twice on the same code
|
||||
# (to conserve limited sending quotas in the live ESP test accounts)
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||
steps:
|
||||
- id: skip_check
|
||||
# uses: fkirc/skip-duplicate-actions@v3.4.0
|
||||
uses: fkirc/skip-duplicate-actions@4c656bbdb6906310fa6213604828008bc28fe55d
|
||||
with:
|
||||
concurrent_skipping: "same_content"
|
||||
skip_after_successful_duplicate: "true"
|
||||
cancel_others: "true"
|
||||
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
|
||||
|
||||
test:
|
||||
name: ${{ matrix.config.tox }} ${{ matrix.config.options }}
|
||||
runs-on: ubuntu-20.04
|
||||
needs: skip_duplicate_runs
|
||||
if: needs.skip_duplicate_runs.outputs.should_skip != 'true'
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Live API integration tests are run on only one representative Python/Django version
|
||||
# combination, to avoid rapidly consuming the testing accounts' entire send allotments.
|
||||
config:
|
||||
- { tox: django40-py310-amazon_ses, python: "3.10" }
|
||||
- { tox: django40-py310-mailgun, python: "3.10" }
|
||||
- { tox: django40-py310-mailjet, python: "3.10" }
|
||||
- { tox: django40-py310-mandrill, python: "3.10" }
|
||||
- { tox: django40-py310-postal, python: "3.10" }
|
||||
- { tox: django40-py310-postmark, python: "3.10" }
|
||||
- { tox: django40-py310-sendgrid, python: "3.10" }
|
||||
- { tox: django40-py310-sendinblue, python: "3.10" }
|
||||
- { tox: django40-py310-sparkpost, python: "3.10" }
|
||||
|
||||
steps:
|
||||
- name: Get code
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Python ${{ matrix.config.python }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.config.python }}
|
||||
- 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
|
||||
ANYMAIL_RUN_LIVE_TESTS: true
|
||||
ANYMAIL_TEST_AMAZON_SES_ACCESS_KEY_ID: ${{ secrets.ANYMAIL_TEST_AMAZON_SES_ACCESS_KEY_ID }}
|
||||
ANYMAIL_TEST_AMAZON_SES_REGION_NAME: ${{ secrets.ANYMAIL_TEST_AMAZON_SES_REGION_NAME }}
|
||||
ANYMAIL_TEST_AMAZON_SES_SECRET_ACCESS_KEY: ${{ secrets.ANYMAIL_TEST_AMAZON_SES_SECRET_ACCESS_KEY }}
|
||||
ANYMAIL_TEST_MAILGUN_API_KEY: ${{ secrets.ANYMAIL_TEST_MAILGUN_API_KEY }}
|
||||
ANYMAIL_TEST_MAILGUN_DOMAIN: ${{ secrets.ANYMAIL_TEST_MAILGUN_DOMAIN }}
|
||||
ANYMAIL_TEST_MAILJET_API_KEY: ${{ secrets.ANYMAIL_TEST_MAILJET_API_KEY }}
|
||||
ANYMAIL_TEST_MAILJET_SECRET_KEY: ${{ secrets.ANYMAIL_TEST_MAILJET_SECRET_KEY }}
|
||||
ANYMAIL_TEST_MANDRILL_API_KEY: ${{ secrets.ANYMAIL_TEST_MANDRILL_API_KEY }}
|
||||
ANYMAIL_TEST_POSTMARK_SERVER_TOKEN: ${{ secrets.ANYMAIL_TEST_POSTMARK_SERVER_TOKEN }}
|
||||
ANYMAIL_TEST_POSTMARK_TEMPLATE_ID: ${{ secrets.ANYMAIL_TEST_POSTMARK_TEMPLATE_ID }}
|
||||
ANYMAIL_TEST_SENDGRID_API_KEY: ${{ secrets.ANYMAIL_TEST_SENDGRID_API_KEY }}
|
||||
ANYMAIL_TEST_SENDGRID_TEMPLATE_ID: ${{ secrets.ANYMAIL_TEST_SENDGRID_TEMPLATE_ID }}
|
||||
ANYMAIL_TEST_SENDINBLUE_API_KEY: ${{ secrets.ANYMAIL_TEST_SENDINBLUE_API_KEY }}
|
||||
ANYMAIL_TEST_SPARKPOST_API_KEY: ${{ secrets.ANYMAIL_TEST_SPARKPOST_API_KEY }}
|
||||
Reference in New Issue
Block a user