Skip to content

Commit

Permalink
Merge pull request #308 from twisted/github-actions
Browse files Browse the repository at this point in the history
GitHub Actions CI config
  • Loading branch information
twm authored Dec 27, 2020
2 parents 80e52e2 + 9d044f5 commit 3a5da48
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 88 deletions.
117 changes: 117 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
lint:
runs-on: ubuntu-20.04
timeout-minutes: 5

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: '3.8'

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key:
${{ runner.os }}-pip-lint-${{ hashFiles('pyproject.toml', 'setup.py', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-lint-
${{ runner.os }}-pip-
- run: python -m pip install tox

- run: tox -q -p all -e flake8,towncrier,twine,check-manifest

docs:
runs-on: ubuntu-20.04
timeout-minutes: 5

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: "3.8"

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key:
${{ runner.os }}-pip-docs-${{ hashFiles('pyproject.toml', 'setup.py', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-docs-
${{ runner.os }}-pip-
- run: python -m pip install tox

- run: tox -q -e docs


test:
name: "Test ${{ matrix.python-version }} with ${{ matrix.twisted-version }} Twisted"
runs-on: ubuntu-20.04
timeout-minutes: 10
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "pypy-2.7", "pypy-3.7"]
twisted-version: ["lowest", "latest"]
experimental: [false]

include:
- python-version: "3.8"
twisted-version: "trunk"
experimental: true

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key:
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'setup.py', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Translate Python version to Tox factor
id: pyfactor
shell: python
run: |
table = {
"2.7": "py27",
"3.5": "py35",
"3.6": "py36",
"3.7": "py37",
"3.8": "py38",
"3.9": "py39",
"pypy-2.7": "pypy",
"pypy-3.7": "pypy3",
}
factor = table["${{ matrix.python-version }}"]
print("::set-output name=value::" + factor)
- run: python -m pip install tox coveralls

- run: tox -e ${{ steps.pyfactor.outputs.value }}-twisted_${{ matrix.twisted-version }}

- run: coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: 4nctuKHTnVtbdmty2FgdO3iiWm1nb7xc4
COVERALLS_FLAG_NAME: python_${{ matrix.python-version }}-twisted_${{ matrix.twisted-version }}
COVERALLS_PARALLEL: true
78 changes: 0 additions & 78 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions changelog.d/307.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The minimum supported Twisted version has increased to 18.7.0. Older versions are no longer tested in CI.
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"requests >= 2.1.0",
"hyperlink >= 19.0.0",
"six >= 1.13.0",
"Twisted[tls] >= 16.4.0 ; python_version < '3.7'",
"Twisted[tls] >= 18.7.0 ; python_version >= '3.7'",
"Twisted[tls] >= 18.7.0",
"attrs",
],
extras_require={
Expand Down
6 changes: 3 additions & 3 deletions src/treq/test/local_httpbin/child.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from .shared import _HTTPBinDescription


def _certificates_for_authority_and_server(service_identity, key_size=1024):
def _certificates_for_authority_and_server(service_identity, key_size=2048):
"""
Create a self-signed CA certificate and server certificate signed
by the CA.
Expand All @@ -44,8 +44,8 @@ def _certificates_for_authority_and_server(service_identity, key_size=1024):
:type service_identity: :py:class:`unicode`
:param key_size: (optional) The size of CA's and server's private
RSA keys. Defaults to 1024 bits, which is the minimum allowed
by OpenSSL Contexts at the default security level as of 1.1.
RSA keys. Defaults to 2048 bits, which is the minimum allowed
by OpenSSL Contexts at the default security level.
:type key_size: :py:class:`int`
:return: a 3-tuple of ``(certificate_authority_certificate,
Expand Down
7 changes: 2 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
envlist =
{pypy,py27,py35,py36,py37}-twisted_lowest,
{pypy,pypy3,py27,py35,py36,py37,py38}-twisted_latest,
{pypy3,py35,py36,py37,py38}-twisted_trunk-pyopenssl_trunk,
{pypy3,py35,py36,py37,py38}-twisted_trunk,
towncrier, twine, check-manifest, flake8, docs

[testenv]
Expand All @@ -11,13 +11,10 @@ deps =
coverage
mock

!py37-twisted_lowest: Twisted==16.4.0
py37-twisted_lowest: Twisted==18.7.0
twisted_lowest: Twisted==18.7.0
twisted_latest: Twisted
twisted_trunk: https://github.com/twisted/twisted/archive/trunk.zip

pyopenssl_trunk: https://github.com/pyca/pyopenssl/archive/master.zip

docs: Sphinx>=1.4.8
setenv =
# Avoid unnecessary network access when creating virtualenvs for speed.
Expand Down

0 comments on commit 3a5da48

Please sign in to comment.