Skip to content

Commit

Permalink
Drop Travis CI and migrate Coveralls
Browse files Browse the repository at this point in the history
Travis CI for Open Source is shutting down in a few weeks so the queue
for jobs is insane due to lower resources. I'm 99.99% sure we don't need
it as our Test, Lint, Docs, Upload / Package, Primer, and Fuzz workflows
are all on GitHub Actions. So even though we *can* migrate to the .com
version with its 1000 free Linux minutes(?), I don't think we need to.

more information here:
- https://blog.travis-ci.com/oss-announcement
- https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing
- https://docs.travis-ci.com/user/migrate/open-source-repository-migration

This commit does the following:
- delete the Travis CI configuration
- add to the GHA test workflows so coverage continues to be recorded
  - tweaked coverage configuration so this wouldn't break
  - also moved over the coverage configuration to pyproject.toml to
    reduce root clutter
- remove any references to Travis CI in the docs (i.e. readme + sphinx
  docs)

Regarding the Travis CI to GitHub Actions Coveralls transition, the
official action doesn't support the coverage files produced by coverage.py
unfornately. Also no, I don't really know what I am doing so don't @ me
if this breaks :p
  • Loading branch information
ichard26 committed May 3, 2021
1 parent 35e8d15 commit 7a3aba8
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 40 deletions.
5 changes: 0 additions & 5 deletions .coveragerc

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -34,3 +34,46 @@ jobs:
- name: Unit tests
run: |
tox -e py
- name: Publish coverage to Coveralls
# If pushed / is a pull request against main repo AND
# we're running on Linux (this action only supports Linux)
if:
((github.event_name == 'push' && github.event.push.repository.full_name ==
'psf/black') || github.event.pull_request.base.repo.full_name == 'psf/black')
&& matrix.os == 'ubuntu-latest'

uses: AndreMiras/coveralls-python-action@v20201129
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
base-path: ./src/
flag-name: py${{ matrix.python-version }}-${{ matrix.os }}
debug: true

coveralls-finish:
needs: build
permissions:
actions: write
checks: write
contents: none
deployments: none
issues: none
packages: none
pull-requests: write
repository-projects: none
security-events: none
statuses: write
# If pushed / is a pull request against main repo
if:
(github.event_name == 'push' && github.event.push.repository.full_name ==
'psf/black') || github.event.pull_request.base.repo.full_name == 'psf/black'

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Coveralls finished
uses: AndreMiras/coveralls-python-action@v20201129
with:
parallel-finished: true
debug: true
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Expand Up @@ -3,7 +3,6 @@
<h2 align="center">The Uncompromising Code Formatter</h2>

<p align="center">
<a href="https://travis-ci.com/psf/black"><img alt="Build Status" src="https://travis-ci.com/psf/black.svg?branch=master"></a>
<a href="https://github.com/psf/black/actions"><img alt="Actions Status" src="https://github.com/psf/black/workflows/Test/badge.svg"></a>
<a href="https://github.com/psf/black/actions"><img alt="Actions Status" src="https://github.com/psf/black/workflows/Primer/badge.svg"></a>
<a href="https://black.readthedocs.io/en/stable/?badge=stable"><img alt="Documentation Status" src="https://readthedocs.org/projects/black/badge/?version=stable"></a>
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Expand Up @@ -314,7 +314,6 @@ def process_sections(
"show_powered_by": True,
"fixed_sidebar": True,
"logo": "logo2.png",
"travis_button": True,
}


Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Expand Up @@ -18,9 +18,13 @@ extend-exclude = '''
)/
'''

# NOTE: You don't need the following in your own Black configuration.

# Build system information below.
# NOTE: You don't need this in your own Black configuration.
[tools.coverage.run]
relative_files = true

[tools.coverage.report]
omit = ['src/blib2to3/*', 'tests/data/*', '*/site-packages/*']

[build-system]
requires = ["setuptools>=41.0", "setuptools-scm", "wheel"]
Expand Down

0 comments on commit 7a3aba8

Please sign in to comment.