Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.

Add Travis CI config for testing and linting#41

Open
laymonage wants to merge 3 commits intomarceloFA:masterfrom
laymonage:add-travis-ci
Open

Add Travis CI config for testing and linting#41
laymonage wants to merge 3 commits intomarceloFA:masterfrom
laymonage:add-travis-ci

Conversation

@laymonage
Copy link
Copy Markdown

@laymonage laymonage commented Oct 24, 2019

With this config, the project is tested on Travis CI with Python 3.6, 3.7, and 3.8 (+ linted on 3.8) on every push. It will also check for code coverage and upload the result to codecov. Badges for the Travis build and code coverage will appear on README.md.

You'll need to:

  1. Sign in to Travis CI and Codecov
  2. Add the repository to your account on both sites.
  3. Copy the token from Codecov and paste it to Travis CI settings for your repo as CODECOV_TOKEN

Normally, step 3 shouldn't be required for public repositories, but Travis CI for public projects is moving from travis-ci.org to travis-ci.com and it seems that Codecov hasn't picked up on that, so you have to set the token as if it's a private repository.

Hopefully, this can help to alert regressions such as this commit that fails this test.

To add prevention locally, I can add a pre-commit git hook using pre-commit so that black . and python manage.py test is run before every commit. However, this would add another dependency and creating the first commit after this change would need an internet connection. If you're okay with that, I'd be happy to create another PR.

@marceloFA
Copy link
Copy Markdown
Owner

Greta PR! Thanks so much for helping out :D
I'm finishing some refactoring in a separate branch and after I merge it back into master we can merge your PR and set the git hook you mentioned.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants