Small docs change #550
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "aiosmtpd CI" | |
# If you change the name above, also change badge address in README.rst | |
on: | |
# This is for direct commit to master | |
push: | |
branches: [ "master" ] | |
paths: | |
- "aiosmtpd/**" | |
- "setup.cfg" # To monitor changes in dependencies | |
- "pyproject.toml" # To monitor changes in dependencies | |
# This is for PRs | |
pull_request: | |
branches: [ "master" ] | |
paths: | |
- "aiosmtpd/**" | |
- "setup.cfg" # To monitor changes in dependencies | |
- "pyproject.toml" # To monitor changes in dependencies | |
# Manual/on-demand | |
workflow_dispatch: | |
# When doing "releases" | |
release: | |
types: [ "created", "edited" ] | |
jobs: | |
qa_docs: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout latest PR commit" | |
uses: actions/checkout@v3 | |
- name: "Set up Python" | |
uses: actions/setup-python@v4 | |
with: | |
# 3.8 is chosen because it seems to be the fastest for <3.9 | |
# (3.9 excluded because it seems to be still very unstable) | |
python-version: 3.8 | |
- name: "Update modules & install deps" | |
# language=bash | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python setup.py develop | |
# Common deps | |
pip install colorama | |
- name: "flake8 Style Checking" | |
shell: bash | |
# language=bash | |
run: | | |
# A bunch of flake8 plugins... | |
grab_f8_plugins=( | |
"from configparser import ConfigParser;" | |
"config = ConfigParser();" | |
"config.read('tox.ini');" | |
"print(config['flake8_plugins']['deps']);" | |
) | |
pip install "flake8>=5.0.4" $(python -c "${grab_f8_plugins[*]}") | |
python -m flake8 aiosmtpd setup.py housekeep.py release.py | |
- name: "Docs Checking" | |
# language=bash | |
run: | | |
# Prepare sphinx and the deps for sphinx extensions | |
pip install -r aiosmtpd/docs/RTD-requirements.txt | |
sphinx-build --color -b doctest -d build/.doctree aiosmtpd/docs build/doctest | |
sphinx-build --color -b html -d build/.doctree aiosmtpd/docs build/html | |
sphinx-build --color -b man -d build/.doctree aiosmtpd/docs build/man | |
- name: "Static Type Checking" | |
# language=bash | |
run: | | |
# Required by examples | |
pip install dnspython argon2-cffi | |
# Install pytype | |
pip install pytype | |
pytype --keep-going --jobs auto . | |
- name: "Other QA Checks" | |
shell: bash | |
# language=bash | |
run: | | |
# Final checks before launching the runners | |
ver_sed='s/^__version__ = (["'"'"'])(.*)\1/\2/p;d' | |
verfile="aiosmtpd/__init__.py" | |
if [[ $GITHUB_REF != refs/heads/master ]]; then | |
# Fetch master because some test cases need its existence | |
git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin master:master | |
fi | |
pip install pytest pytest-mock check-manifest | |
pytest -v aiosmtpd/qa | |
check-manifest -v | |
testing: | |
needs: qa_docs | |
strategy: | |
# If a matrix fail, do NOT stop other matrix, let them run to completion | |
fail-fast: false | |
matrix: | |
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.7", "pypy3.8", "pypy3.9" ] | |
os: [ "macos-11", "macos-12", "ubuntu-18.04", "ubuntu-20.04", "ubuntu-22.04", "windows-2019", "windows-2022" ] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 15 # Slowest so far is pypy3 on MacOS, taking almost 7m | |
steps: | |
- name: "Checkout latest commit" | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Required by codecov/codecov-action@v1 | |
- name: "Set up Python ${{ matrix.python-version }}" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: "Install dependencies" | |
# language=bash | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
# Test deps | |
pip install colorama "coverage>=7.0.1" coverage[toml] "coverage-conditional-plugin>=0.5.0" packaging pytest pytest-cov pytest-mock | |
# Package deps | |
python setup.py develop | |
- name: "Security checking" | |
# language=bash | |
run: | | |
pip install bandit | |
bandit -c bandit.yml -r aiosmtpd | |
# IMPORTANT: pypy3.8 is currently excluded from coverage testing because coverage seems to be unstable when | |
# running on PyPy 3.8. This is still under investigation (See issue #325) | |
# Edit: This is due to change in behavior in PyPy v7.3.10, and coverage.py needs to adapt. | |
# See: https://github.com/nedbat/coveragepy/issues/1515 | |
- name: "Execute testing with coverage" | |
if: matrix.python-version != 'pypy3.8' | |
shell: bash | |
# language=bash | |
run: | | |
# Fetch master if needed because some test cases need its existence | |
if [[ $GITHUB_REF != refs/heads/master ]]; then | |
git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin master:master | |
fi | |
pytest --cov --cov-report=xml --cov-report=term | |
# | |
- name: "Execute testing w/o coverage" | |
if: matrix.python-version == 'pypy3.8' | |
shell: bash | |
# language=bash | |
run: | | |
# Fetch master if needed because some test cases need its existence | |
if [[ $GITHUB_REF != refs/heads/master ]]; then | |
git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin master:master | |
fi | |
pytest | |
# | |
- name: "Report to codecov" | |
# Ubuntu 18.04 came out of the box with 3.6, and LOTS of system are still running | |
# 18.04 happily, so we choose this as the 'canonical' code coverage testing. | |
# One day we'll have to revisit this and bump the version ... | |
# 2022-12-16: Bumped to Python 3.8 and Ubuntu 20.04. Yeah, we take the conservative LTS route. | |
if: matrix.python-version == '3.8' && matrix.os == 'ubuntu-20.04' | |
uses: codecov/codecov-action@v3 |