|
| 1 | +name: Tests |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + - '*' |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - master |
| 10 | + |
| 11 | +jobs: |
| 12 | + tests: |
| 13 | + name: ${{ matrix.name }} |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + include: |
| 19 | + - {name: '3.12', python: '3.12', os: ubuntu-latest, tox: py312} |
| 20 | + - {name: '3.11', python: '3.11', os: ubuntu-latest, tox: py311} |
| 21 | + - {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310} |
| 22 | + - {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39} |
| 23 | + - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38} |
| 24 | + - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37} |
| 25 | + - {name: '3.6', python: '3.6', os: ubuntu-20.04, tox: py36} |
| 26 | + services: |
| 27 | + postfix: |
| 28 | + image: lavr/docker-postfix |
| 29 | + env: |
| 30 | + SMTP_SERVER: smtp.gmail.com |
| 31 | + SMTP_PORT: 587 |
| 32 | + SMTP_USERNAME: ${{ secrets.SMTP_TEST_GMAIL_USER }} |
| 33 | + SMTP_PASSWORD: ${{ secrets.SMTP_TEST_GMAIL_PASSWORD }} |
| 34 | + SERVER_HOSTNAME: python-emails-tests.github-ci.lavr.me |
| 35 | + ports: |
| 36 | + - 2525:25 |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v2 |
| 39 | + - uses: actions/setup-python@v2 |
| 40 | + with: |
| 41 | + python-version: ${{ matrix.python }} |
| 42 | + - name: update pip |
| 43 | + run: | |
| 44 | + pip install -U wheel |
| 45 | + pip install -U setuptools |
| 46 | + python -m pip install -U pip |
| 47 | + - name: get pip cache dir |
| 48 | + id: pip-cache |
| 49 | + run: echo "::set-output name=dir::$(pip cache dir)" |
| 50 | + - name: cache pip |
| 51 | + uses: actions/cache@v1 |
| 52 | + with: |
| 53 | + path: ${{ steps.pip-cache.outputs.dir }} |
| 54 | + key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }} |
| 55 | + - run: pip install tox |
| 56 | + - name: run rests |
| 57 | + env: |
| 58 | + SMTP_TEST_SUBJECT_SUFFIX: "github-actions sha:${{ github.sha }} run_id:${{ github.run_id }}" |
| 59 | + SMTP_TEST_MAIL_FROM: python-emails-tests@lavr.me |
| 60 | + SMTP_TEST_MAIL_TO: python-emails-tests@lavr.me |
| 61 | + SMTP_TEST_SETS: LOCAL |
| 62 | + SMTP_TEST_LOCAL_WITHOUT_TLS: true |
| 63 | + SMTP_TEST_LOCAL_HOST: 127.0.0.1 |
| 64 | + SMTP_TEST_LOCAL_PORT: 2525 |
| 65 | + |
| 66 | + SMTP_TEST_GMAIL_TO: python-emails-tests@lavr.me |
| 67 | + SMTP_TEST_GMAIL_USER: ${{ secrets.SMTP_TEST_GMAIL_USER }} |
| 68 | + SMTP_TEST_GMAIL_PASSWORD: ${{ secrets.SMTP_TEST_GMAIL_PASSWORD }} |
| 69 | + SMTP_TEST_GMAIL_WITH_TLS: true |
| 70 | + SMTP_TEST_GMAIL_HOST: smtp.gmail.com |
| 71 | + SMTP_TEST_GMAIL_PORT: 587 |
| 72 | + SMTP_TEST_YAMAIL_TO: python.emails.test.2@yandex.ru |
| 73 | + SMTP_TEST_YAMAIL_FROM: python.emails.test.2@yandex.ru |
| 74 | + SMTP_TEST_YAMAIL_USER: python.emails.test.2 |
| 75 | + SMTP_TEST_YAMAIL_PASSWORD: ${{ secrets.SMTP_TEST_YAMAIL_PASSWORD }} |
| 76 | + SMTP_TEST_YAMAIL_WITH_TLS: true |
| 77 | + SMTP_TEST_YAMAIL_HOST: smtp.yandex.ru |
| 78 | + SMTP_TEST_YAMAIL_PORT: 25 |
| 79 | + run: tox -e ${{ matrix.tox }} |
0 commit comments