sloria / sphinx-issues

A Sphinx extension for linking to your project's issue tracker
MIT License
54 stars 13 forks source link

Test on GitHub Actions #119

Closed hugovk closed 2 years ago

hugovk commented 2 years ago

As noted here, Travis CI is no longer running: https://github.com/sloria/sphinx-issues/pull/118#issuecomment-991979247

This PR moves testing to GitHub Actions.

There are two workflows.

One does the linting by running pre-commit.

The other runs the tests. This improves upon Travis by testing macOS and Windows in addition to Ubuntu. GHA also gives 20 parallel jobs compared to 5 at Travis.


I've not deleted the .travis.yml file yet because one thing it ~does~ did was deploy on tags.

This can be achieved via GHA using https://github.com/pypa/gh-action-pypi-publish

I've not included it here, because it will need tokens adding as secrets to this repo. But I could prepare another PR after this if you'd like.

hugovk commented 2 years ago

Updated!

sloria commented 2 years ago

Thanks! We might want to evaluate an approach that runs tests in tox, similar to https://github.com/python-attrs/attrs/blob/main/.github/workflows/main.yml . This would make for better parity between CI and local dev.

That said, that can be a follow-up PR. I'll make a new issue. Let's get this in for now

hugovk commented 2 years ago

This is running tests in tox :)

tox-gh-actions is also good for more complex setups, remember it needs a mapping of Python versions to tox envs, like:

https://github.com/python-attrs/attrs/blob/d6f5ae957a264d865854b9d70248d653936608ae/tox.ini#L11-L21

sloria commented 2 years ago

Ah right right, i misspoke. I meant that we should consider running pre-commit in tox as well, esp since the pre-commit GHA is deprecated https://github.com/pre-commit/action

hugovk commented 2 years ago

I didn't know https://github.com/pre-commit/action is deprecated, thanks for pointing it out!

I definitely recommend https://pre-commit.ci/ as well, a really good feature is it can update PRs with pre-commit changes.

But one thing it's missing: it's unlikely contributors will enable https://pre-commit.ci/ for their forks so they it's possible they won't see failures until after creating PRs.

So good idea to run it in tox too.