Skip to content

Commit

Permalink
Replace Travis CI with GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Sep 20, 2021
1 parent ec344d8 commit db5d7c9
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 159 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Examples

on: [push, pull_request, workflow_dispatch]

env:
FORCE_COLOR: 1

jobs:
examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [
"src-layout",
"adhoc-layout",
]

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key:
examples-v1-${{ hashFiles('**/tox.ini') }}
restore-keys: |
examples-v1-
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U wheel
python -m pip install --progress-bar=off tox -rci/requirements.txt
- name: Examples
run: |
cd examples/${{ matrix.target }}
tox -v
41 changes: 41 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Lint

on: [push, pull_request, workflow_dispatch]

env:
FORCE_COLOR: 1

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toxenv: ["check", "docs"]

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key:
lint-v1-${{ hashFiles('**/tox.ini') }}
restore-keys: |
lint-v1-
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U wheel
python -m pip install --progress-bar=off tox -rci/requirements.txt
- name: Lint ${{ matrix.toxenv }}
run: |
tox -v -e ${{ matrix.toxenv }}
68 changes: 68 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Test

on: [push, pull_request, workflow_dispatch]

env:
FORCE_COLOR: 1

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["pypy3", "3.6", "3.7", "3.8", "3.9"]
tox-extra-versions: [
"pytest46-xdist133-coverage55",
"pytest54-xdist133-coverage55",
"pytest62-xdist202-coverage55",
]
include:
# Add new helper variables to existing jobs
- {python-version: "pypy3", tox-python-version: "pypy3"}
- {python-version: "3.6", tox-python-version: "py36"}
- {python-version: "3.7", tox-python-version: "py37"}
- {python-version: "3.8", tox-python-version: "py38"}
- {python-version: "3.9", tox-python-version: "py39"}
# Add extra jobs to the matrix
- {tox-extra-versions: "pytest46-xdist127", python-version: "pypy-2.7", tox-python-version: "pypy"}
- {tox-extra-versions: "pytest46-xdist127", python-version: "pypy3", tox-python-version: "pypy3"}
- {tox-extra-versions: "pytest46-xdist127", python-version: "2.7", tox-python-version: "py27"}
- {tox-extra-versions: "pytest46-xdist127", python-version: "3.5", tox-python-version: "py35"}
- {tox-extra-versions: "pytest46-xdist127", python-version: "3.6", tox-python-version: "py36"}
- {tox-extra-versions: "pytest46-xdist127", python-version: "3.7", tox-python-version: "py37"}

steps:
- uses: actions/checkout@v2

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

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
test-${{ matrix.python-version }}-v1-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
test-${{ matrix.python-version }}-v1-
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U wheel
python -m pip install --progress-bar=off tox -rci/requirements.txt
virtualenv --version
pip --version
tox --version
- name: Tox tests
run: |
tox -v -e ${{ matrix.tox-python-version }}-${{ matrix.tox-extra-versions }}
89 changes: 0 additions & 89 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ For merging, you should:
3. Add a note to ``CHANGELOG.rst`` about the changes.
4. Add yourself to ``AUTHORS.rst``.

.. [1] If you don't have all the necessary python versions available locally you can rely on Travis - it will
`run the tests <https://travis-ci.com//github/pytest-dev/pytest-cov/pull_requests>`_
.. [1] If you don't have all the necessary Python versions available locally you can rely on GitHub Actions - it will
`run the tests <https://github.com/pytest-dev/pytest-cov/actions>`_
for each change you add in the pull request.
It will be slower though ...
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ prune examples/*/*/htmlcov
prune examples/adhoc-layout/*.egg-info
prune examples/src-layout/src/*.egg-info

graft .github/workflows
graft src
graft ci
graft tests
Expand All @@ -21,6 +22,6 @@ include CONTRIBUTING.rst
include LICENSE
include README.rst

include tox.ini .travis.yml .appveyor.yml .readthedocs.yml .pre-commit-config.yaml
include tox.ini .appveyor.yml .readthedocs.yml .pre-commit-config.yaml

global-exclude *.py[cod] __pycache__/* *.so *.dylib .coverage .coverage.*
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Overview
* - docs
- |docs|
* - tests
- | |travis| |appveyor| |requires|
- | |github-actions| |appveyor| |requires|
* - package
- | |version| |conda-forge| |wheel| |supported-versions| |supported-implementations|
| |commits-since|
Expand All @@ -19,9 +19,9 @@ Overview
:target: https://readthedocs.org/projects/pytest-cov
:alt: Documentation Status

.. |travis| image:: https://api.travis-ci.com/pytest-dev/pytest-cov.svg?branch=master
:alt: Travis-CI Build Status
:target: https://travis-ci.com/github/pytest-dev/pytest-cov
.. |github-actions| image:: https://github.com/pytest-dev/pytest-cov/actions/workflows/test.yml/badge.svg
:alt: GitHub Actions Status
:target: https://github.com/pytest-dev/pytest-cov/actions

.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/pytest-dev/pytest-cov?branch=master&svg=true
:alt: AppVeyor Build Status
Expand Down
61 changes: 0 additions & 61 deletions ci/templates/.travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/releasing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The process for releasing should follow these steps:
git push
git push --tags
#. Wait for `AppVeyor <https://ci.appveyor.com/project/pytestbot/pytest-cov>`_
and `Travis <https://travis-ci.org/schlamar/pytest-cov>`_ to give the green builds.
and `GitHub Actions <https://github.com/pytest-dev/pytest-cov/actions>`_ to give the green builds.
#. Check that the docs on `ReadTheDocs <https://readthedocs.org/projects/pytest-cov>`_ are built.
#. Make sure you have a clean checkout, run ``git status`` to verify.
#. Manually clean temporary files (that are ignored and won't show up in ``git status``)::
Expand Down
2 changes: 1 addition & 1 deletion docs/reporting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ The final report option can also suppress printing to the terminal::

This mode can be especially useful on continuous integration servers, where a coverage file
is needed for subsequent processing, but no local report needs to be viewed. For example,
tests run on Travis-CI could produce a .coverage file for use with Coveralls.
tests run on GitHub Actions could produce a .coverage file for use with Coveralls.

0 comments on commit db5d7c9

Please sign in to comment.