Skip to content

Commit

Permalink
Move more Travis jobs to GitHub Actions (pypa#705)
Browse files Browse the repository at this point in the history
* Tidy up workflow

* Remove redundant Travis jobs

* Move type-checking to GH Action

* Move docs build to GH Action

* Update setup-python action

* Move codecov to GH Action

* Update links to Travis

* Run daily

* Remove unnecessary dependency installs

* Add pip list for debugging

* Revert "Add pip list for debugging"

This reverts commit 62159b7.
  • Loading branch information
bhrutledge committed Oct 12, 2020
1 parent c1c02f2 commit 2c3d8e1
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 50 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel tox
run: python -m pip install tox
- name: Run tests
run: python -m tox -e integration
54 changes: 44 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
name: Main

on: [push, pull_request]
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *' # daily

jobs:

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install tox
- name: Install dependencies
run: python -m pip install tox
- name: Run linting
run: python -m tox -e lint

types:
strategy:
matrix:
python: [3.6, 3.7, 3.8]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: python -m pip install tox
- name: Run type-checking
run: python -m tox -e types

test:
strategy:
matrix:
Expand All @@ -24,12 +43,27 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip setuptools wheel tox
- name: Install dependencies
run: python -m pip install tox
- name: Run tests
run: python -m tox -e py # Run tox using the version of Python in `PATH`
run: python -m tox -e py -- --cov-report xml
- uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
name: ${{ matrix.python }} - ${{ matrix.platform }}
fail_ci_if_error: true

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: python -m pip install tox
- name: Build docs
run: python -m tox -e docs
26 changes: 1 addition & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,6 @@ matrix:

include:
- python: &latest_py3 3.8
- python: 3.7
- python: &oldest_py3 3.6

- python: 3.7
name: Linting code style
env:
TOXENV: lint

- python: *latest_py3
name: Checking type annotations (latest Python)
env:
TOXENV: types
- python: *oldest_py3
name: Checking type annotations (oldest Python)
env:
TOXENV: types

- python: 3.7
name: Making sure that docs build is healthy
env:
TOXENV: docs

- stage: deploy
if: tag IS present
Expand All @@ -41,10 +20,7 @@ matrix:
after_script: skip

install:
- pip install tox codecov
- pip install tox

script:
- tox

after_script:
- codecov --env TRAVIS_OS_NAME,TOXENV
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
.. image:: https://img.shields.io/readthedocs/twine
:target: https://twine.readthedocs.io

.. image:: https://img.shields.io/travis/com/pypa/twine
:target: https://travis-ci.com/github/pypa/twine
.. image:: https://img.shields.io/github/workflow/status/pypa/twine/Main
:target: https://github.com/pypa/twine/actions

.. image:: https://img.shields.io/codecov/c/github/pypa/twine
:target: https://codecov.io/gh/pypa/twine
Expand Down
13 changes: 6 additions & 7 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ To pass options to ``pytest``, e.g. the name of a test, run:
tox -e py -- tests/test_upload.py::test_exception_for_http_status
Twine is continuously tested against Python 3.6, 3.7, and 3.8 using `Travis`_.
To run the tests against a specific version, e.g. Python 3.6, you will need it
installed on your machine. Then, run:
Twine is continuously tested against Python 3.6, 3.7, and 3.8 using `GitHub
Actions`_. To run the tests against a specific version, e.g. Python 3.6, you
will need it installed on your machine. Then, run:

.. code-block:: console
Expand Down Expand Up @@ -183,9 +183,7 @@ Adding a maintainer

A checklist for adding a new maintainer to the project.

#. Add them as a Member in the GitHub repo settings. (This will also
give them privileges on the `Travis CI project
<https://travis-ci.com/github/pypa/twine>`_.)
#. Add them as a Member in the GitHub repo settings.
#. Get them Test PyPI and canon PyPI usernames and add them as a
Maintainer on `our Test PyPI project
<https://test.pypi.org/manage/project/twine/collaboration/>`_ and
Expand All @@ -202,7 +200,7 @@ A checklist for creating, testing, and distributing a new version.
#. Choose a version number, e.g. ``3.2.0``.
#. Add a ``:release:`` line to :file:`docs/changelog.rst`.
#. Commit and open a pull request for review.
#. Merge the pull request, and ensure the `Travis`_ build passes.
#. Merge the pull request, and ensure the `GitHub Actions`_ build passes.
#. Create a new git tag with ``git tag -m "Release v{version}" {version}``.
#. Push the new tag with ``git push upstream {version}``.
#. Watch the release in `Travis`_.
Expand All @@ -225,6 +223,7 @@ merge into a single tool; see `ongoing discussion
.. _`virtual environment`: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
.. _`tox`: https://tox.readthedocs.io/
.. _`pytest`: https://docs.pytest.org/
.. _`GitHub Actions`: https://github.com/pypa/twine/actions
.. _`Travis`: https://travis-ci.com/github/pypa/twine
.. _`isort`: https://timothycrosley.github.io/isort/
.. _`black`: https://black.readthedocs.io/
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ long_description = file:README.rst
url = https://twine.readthedocs.io/
project_urls =
Packaging tutorial = https://packaging.python.org/tutorials/distributing-packages/
Travis CI = https://travis-ci.com/github/pypa/twine
Twine documentation = https://twine.readthedocs.io/en/latest/
Twine source = https://github.com/pypa/twine/
classifiers =
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ deps =
passenv =
PYTEST_ADDOPTS
commands =
pytest --ignore-glob '*integration*.py' {posargs:--cov-report term-missing --cov-report html tests}
pytest --ignore-glob '*integration*.py' {posargs:--cov-report term-missing --cov-report html}

[testenv:integration]
deps =
Expand Down

0 comments on commit 2c3d8e1

Please sign in to comment.