Merge branch 'trunk' into setuptools

This commit is contained in:
Thomas Grainger 2021-07-23 23:18:25 +01:00 committed by GitHub
commit f251d3239e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 132 additions and 86 deletions

82
.github/workflows/tests.yaml vendored Normal file
View File

@ -0,0 +1,82 @@
# Try to get a short workflow name and a job name that start with Python
# version to make it easier to check the status inside GitHub UI.
name: CI
on:
push:
branches: [ trunk ]
tags:
- incremental-*
pull_request:
branches: [ trunk ]
defaults:
run:
shell: bash
jobs:
testing:
runs-on: ubuntu-20.04
env:
TOXENV: "${{ matrix.tox-env }}"
name: ${{ matrix.python-version }}-${{ matrix.tox-env }}
strategy:
fail-fast: false
matrix:
# Run on the minimum micro Python version that we can get on CI.
# When updating the minimum Python version here, also update the
# `python_requires` from `setup.cfg`.
# Run on latest minor release of each major python version.
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
tox-env: ['tests']
include:
# Run non-python version specific jobs.
- python-version: 3.9
tox-env: mypy,apidocs
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: twisted/python-info-action@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Run job via tox
run: |
# GitHub Actions VM have 2 CPUs.
tox --parallel 2
- name: Prepare GitHub Pages
if: contains(matrix['tox-env'], 'apidocs')
run: |
mkdir website
touch website/index.html
mv apidocs website/docs
- name: Publish documentation for push on trunk
# FIXME:
# Add push event condition before merge.
if: contains(matrix['tox-env'], 'apidocs') && github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_message: Publish docs for ${{ github.sha }}
publish_dir: ./website
- uses: codecov/codecov-action@v1
if: always() && matrix.tox-env == 'tests'
with:
files: coverage.xml
name: lnx-${{ matrix.python-version }}-${{ matrix.tox-env }}
fail_ci_if_error: true
functionalities: gcov,search

1
.gitignore vendored
View File

@ -17,3 +17,4 @@ htmlcov/
apidocs/
.tox/
.DS_Store
coverage.xml

View File

@ -1,40 +0,0 @@
dist: bionic
language: python
python: "3.9"
install:
- pip install tox codecov
env:
global:
- secure: LecqzHkkjNJ0GbLgvr/5YFy2U90JB1GAThqwr6WAab0c30z5w2EVJOubkASzREfMj6LKzUIdublskQC0x5kge46RVhsqVGZFIywR/7fUmqpaeaV3VvHBLk5vVLvFFYfbnRZQ9AtBEg6M7YAZwgAKRjE0mtJxKDP1Ksn5aV4wox4WZfeYKwPnjkHZQb/GrSdS93Uzi4Xe3TrtQ2m5lSMAaoeUFeKJbUEX6avqlfrsU1RZqvFTmDWhLiHSIvCVtG6DtrA2kGovC7qP6xVcjPcpx8D4aVpHzr7LqcCGaRQwLmO0aMe1YdegFQQeU7L7/c6m+UbVsobhxdjR8SWchdzAkmoE2QTdNTRTVbouvQL+uF8LvVKZoNBjUYxoeng0MqJLFfJUks8SnhN/wFujZmmlYv6Nm559GiR63i7hqCjbn2XFyE1mrvBPEpIMxpBc6kxN3GhCAyfHHRniyNbdD0e1eQ7JxQfzqqkQVMkdh2HRvpINIMZNM7247gsXEaGiJV/5ntGl138vuEXWjj8o0wdp0wBcqrHbEcPnjWBZIqexdevjiSpIJyMP0q4F2kv7eIfZLViLVfygRPQBpPcmETiNJtPJkXsxGFmTEtt/gdjT8dU/FvROTJRo3Iiz3rxHNsXJG8TGsZduLbBuzvGVadywLqD+Mb74CsizvdK0tdsP5Tg=
matrix:
fast_finish: true
include:
- python: 2.7
env: TOX_ENV=tests
- python: 3.5
env: TOX_ENV=tests
- python: 3.6
env: TOX_ENV=tests
- python: 3.7
env: TOX_ENV=tests
- python: 3.8
env: TOX_ENV=tests
- python: 3.9
env: TOX_ENV=tests
- env: TOX_ENV=mypy
- env: TOX_ENV=apidocs
- env: PUSH_DOCS=true
script:
- if [[ -n "${TOX_ENV}" ]]; then tox -e $TOX_ENV; fi
- if [[ "$PUSH_DOCS" == "true" ]]; then ./.travis/build_docs.sh; fi
after_script:
- codecov
branches:
only:
- master

View File

@ -1,41 +0,0 @@
#!/bin/bash
if [[ ${TRAVIS_PULL_REQUEST} == "false" ]] && [[ ${TRAVIS_BRANCH} == "master" ]]; then
echo "uploading docs"
REV=`git rev-parse HEAD`
# Build the docs
tox -e apidocs
# Make the directory
git clone --branch gh-pages https://github.com/twisted/incremental.git /tmp/tmp-docs
# Copy the docs
rsync -rt --del --exclude=".git" apidocs/* /tmp/tmp-docs/docs/
cd /tmp/tmp-docs
git add -A
# set the username and email. The secure line in travis.yml that sets
# these environment variables is created by:
# travis encrypt 'GIT_NAME="HawkOwl (Automatic)" GIT_EMAIL=hawkowl@atleastfornow.net GH_TOKEN=<token>'
export GIT_COMMITTER_NAME="${GIT_NAME}";
export GIT_COMMITTER_EMAIL="${GIT_EMAIL}";
export GIT_AUTHOR_NAME="${GIT_NAME}";
export GIT_AUTHOR_EMAIL="${GIT_EMAIL}";
git commit -m "Built from ${REV}";
if [[ ${TRAVIS_REPO_SLUG} == "twisted/incremental" ]];
then
# Push it up
git push -q "https://${GH_TOKEN}@github.com/twisted/incremental.git" gh-pages
fi
else
echo "skipping docs upload"
fi;

View File

@ -1,7 +1,7 @@
Incremental
===========
|travis|
|gha|
|pypi|
|coverage|
@ -98,11 +98,11 @@ Once the final version is made, it will become:
- ``<projectname> 17.1.0``
.. |coverage| image:: https://codecov.io/github/twisted/incremental/coverage.svg?branch=master
.. _coverage: https://codecov.io/github/twisted/incremental
.. |coverage| image:: https://codecov.io/gh/twisted/incremental/branch/master/graph/badge.svg?token=K2ieeL887X
.. _coverage: https://codecov.io/gh/twisted/incremental
.. |travis| image:: https://travis-ci.org/twisted/incremental.svg?branch=master
.. _travis: https://travis-ci.org/twisted/incremental
.. |gha| image:: https://github.com/twisted/incremental/actions/workflows/tests.yaml/badge.svg
.. _gha: https://github.com/twisted/incremental/actions/workflows/tests.yaml
.. |pypi| image:: http://img.shields.io/pypi/v/incremental.svg
.. _pypi: https://pypi.python.org/pypi/incremental

43
codecov.yaml Normal file
View File

@ -0,0 +1,43 @@
#
# For documentation: https://docs.codecov.io/docs/codecovyml-reference
# Incremental settings: https://codecov.io/gh/twisted/incremental/settings/yaml
#
# We want 100% coverage for new patches to make sure we are always increasing
# the coverage.
#
codecov:
require_ci_to_pass: yes
notify:
# We have at least 10 builds in GitHub Actions and 12 in Azure
# and lint + mypy + docs + ReadTheDocs
after_n_builds: 15
wait_for_ci: yes
coverage:
precision: 2
round: down
status:
patch:
default:
# New code should have 100% CI coverage as the minimum
# quality assurance measurement.
# If there is a good reason for new code not to have coverage,
# add inline pragma comments.
target: 100%
project:
default:
# Temporary allow for a bit of slack in overall code coverage due to
# swinging coverage that is not triggered by changes in a PR.
# See: https://twistedmatrix.com/trac/ticket/10170
threshold: 0.02%
# We don't want to receive general PR comments about coverage.
# We have the commit status checks and that should be enough.
# See https://docs.codecov.io/docs/pull-request-comments
comment: false
# See https://docs.codecov.io/docs/github-checks
github_checks:
# We want codecov to send inline PR comments for missing coverage.
annotations: true

View File

@ -37,6 +37,7 @@ commands =
tests: coverage combine
tests: coverage report
tests: coverage html
tests: coverage xml
mypy: mypy src