Skip to content

Commit 2c3d8e1

Browse files
authored
Move more Travis jobs to GitHub Actions (#705)
* 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.
1 parent c1c02f2 commit 2c3d8e1

File tree

7 files changed

+56
-50
lines changed

7 files changed

+56
-50
lines changed

.github/workflows/integration.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
15-
- name: Setup Python
16-
uses: actions/setup-python@v1
15+
- uses: actions/setup-python@v2
1716
with:
1817
python-version: 3.8
1918
- name: Install dependencies
20-
run: |
21-
python -m pip install --upgrade pip setuptools wheel tox
19+
run: python -m pip install tox
2220
- name: Run tests
2321
run: python -m tox -e integration

.github/workflows/main.yml

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,40 @@
11
name: Main
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * *' # daily
48

59
jobs:
10+
611
lint:
712
runs-on: ubuntu-latest
813
steps:
914
- uses: actions/checkout@v2
10-
- name: Setup Python
11-
uses: actions/setup-python@v1
15+
- uses: actions/setup-python@v2
1216
with:
1317
python-version: 3.8
14-
- name: Install tox
18+
- name: Install dependencies
1519
run: python -m pip install tox
1620
- name: Run linting
1721
run: python -m tox -e lint
1822

23+
types:
24+
strategy:
25+
matrix:
26+
python: [3.6, 3.7, 3.8]
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v2
30+
- uses: actions/setup-python@v2
31+
with:
32+
python-version: ${{ matrix.python }}
33+
- name: Install dependencies
34+
run: python -m pip install tox
35+
- name: Run type-checking
36+
run: python -m tox -e types
37+
1938
test:
2039
strategy:
2140
matrix:
@@ -24,12 +43,27 @@ jobs:
2443
runs-on: ${{ matrix.platform }}
2544
steps:
2645
- uses: actions/checkout@v2
27-
- name: Setup Python
28-
uses: actions/setup-python@v1
46+
- uses: actions/setup-python@v2
2947
with:
3048
python-version: ${{ matrix.python }}
31-
- name: "Install dependencies"
32-
run: |
33-
python -m pip install --upgrade pip setuptools wheel tox
49+
- name: Install dependencies
50+
run: python -m pip install tox
3451
- name: Run tests
35-
run: python -m tox -e py # Run tox using the version of Python in `PATH`
52+
run: python -m tox -e py -- --cov-report xml
53+
- uses: codecov/codecov-action@v1
54+
with:
55+
file: ./coverage.xml
56+
name: ${{ matrix.python }} - ${{ matrix.platform }}
57+
fail_ci_if_error: true
58+
59+
docs:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v2
63+
- uses: actions/setup-python@v2
64+
with:
65+
python-version: 3.8
66+
- name: Install dependencies
67+
run: python -m pip install tox
68+
- name: Build docs
69+
run: python -m tox -e docs

.travis.yml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,6 @@ matrix:
1111

1212
include:
1313
- python: &latest_py3 3.8
14-
- python: 3.7
15-
- python: &oldest_py3 3.6
16-
17-
- python: 3.7
18-
name: Linting code style
19-
env:
20-
TOXENV: lint
21-
22-
- python: *latest_py3
23-
name: Checking type annotations (latest Python)
24-
env:
25-
TOXENV: types
26-
- python: *oldest_py3
27-
name: Checking type annotations (oldest Python)
28-
env:
29-
TOXENV: types
30-
31-
- python: 3.7
32-
name: Making sure that docs build is healthy
33-
env:
34-
TOXENV: docs
3514

3615
- stage: deploy
3716
if: tag IS present
@@ -41,10 +20,7 @@ matrix:
4120
after_script: skip
4221

4322
install:
44-
- pip install tox codecov
23+
- pip install tox
4524

4625
script:
4726
- tox
48-
49-
after_script:
50-
- codecov --env TRAVIS_OS_NAME,TOXENV

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
.. image:: https://img.shields.io/readthedocs/twine
88
:target: https://twine.readthedocs.io
99

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

1313
.. image:: https://img.shields.io/codecov/c/github/pypa/twine
1414
:target: https://codecov.io/gh/pypa/twine

docs/contributing.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ To pass options to ``pytest``, e.g. the name of a test, run:
107107
108108
tox -e py -- tests/test_upload.py::test_exception_for_http_status
109109
110-
Twine is continuously tested against Python 3.6, 3.7, and 3.8 using `Travis`_.
111-
To run the tests against a specific version, e.g. Python 3.6, you will need it
112-
installed on your machine. Then, run:
110+
Twine is continuously tested against Python 3.6, 3.7, and 3.8 using `GitHub
111+
Actions`_. To run the tests against a specific version, e.g. Python 3.6, you
112+
will need it installed on your machine. Then, run:
113113

114114
.. code-block:: console
115115
@@ -183,9 +183,7 @@ Adding a maintainer
183183

184184
A checklist for adding a new maintainer to the project.
185185

186-
#. Add them as a Member in the GitHub repo settings. (This will also
187-
give them privileges on the `Travis CI project
188-
<https://travis-ci.com/github/pypa/twine>`_.)
186+
#. Add them as a Member in the GitHub repo settings.
189187
#. Get them Test PyPI and canon PyPI usernames and add them as a
190188
Maintainer on `our Test PyPI project
191189
<https://test.pypi.org/manage/project/twine/collaboration/>`_ and
@@ -202,7 +200,7 @@ A checklist for creating, testing, and distributing a new version.
202200
#. Choose a version number, e.g. ``3.2.0``.
203201
#. Add a ``:release:`` line to :file:`docs/changelog.rst`.
204202
#. Commit and open a pull request for review.
205-
#. Merge the pull request, and ensure the `Travis`_ build passes.
203+
#. Merge the pull request, and ensure the `GitHub Actions`_ build passes.
206204
#. Create a new git tag with ``git tag -m "Release v{version}" {version}``.
207205
#. Push the new tag with ``git push upstream {version}``.
208206
#. Watch the release in `Travis`_.
@@ -225,6 +223,7 @@ merge into a single tool; see `ongoing discussion
225223
.. _`virtual environment`: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
226224
.. _`tox`: https://tox.readthedocs.io/
227225
.. _`pytest`: https://docs.pytest.org/
226+
.. _`GitHub Actions`: https://github.com/pypa/twine/actions
228227
.. _`Travis`: https://travis-ci.com/github/pypa/twine
229228
.. _`isort`: https://timothycrosley.github.io/isort/
230229
.. _`black`: https://black.readthedocs.io/

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ long_description = file:README.rst
88
url = https://twine.readthedocs.io/
99
project_urls =
1010
Packaging tutorial = https://packaging.python.org/tutorials/distributing-packages/
11-
Travis CI = https://travis-ci.com/github/pypa/twine
1211
Twine documentation = https://twine.readthedocs.io/en/latest/
1312
Twine source = https://github.com/pypa/twine/
1413
classifiers =

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ deps =
1111
passenv =
1212
PYTEST_ADDOPTS
1313
commands =
14-
pytest --ignore-glob '*integration*.py' {posargs:--cov-report term-missing --cov-report html tests}
14+
pytest --ignore-glob '*integration*.py' {posargs:--cov-report term-missing --cov-report html}
1515

1616
[testenv:integration]
1717
deps =

0 commit comments

Comments
 (0)