python-hyper / h11

A pure-Python, bring-your-own-I/O implementation of HTTP/1.1
https://h11.readthedocs.io/
MIT License
490 stars 62 forks source link

Add GitHub Actions CI/CD Workflow #89

Closed webknjaz closed 4 years ago

codecov-io commented 5 years ago

Codecov Report

Merging #89 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #89   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          20     20           
  Lines         927    927           
  Branches      173    173           
=====================================
  Hits          927    927

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 68e32db...0dc734f. Read the comment docs.

webknjaz commented 5 years ago

Demo: https://github.com/webknjaz/h11/runs/219198825

pquentin commented 5 years ago

Oh, interesting! Daily runs are a great feature.

webknjaz commented 5 years ago

Yep! Plus a number of extra free envs and up to 20 parallel jobs.

njsmith commented 5 years ago

Nice work!

I guess the main limitation is that this doesn't cover the pypy/pypy3/py38-dev tests that we run on Travis now, so we'd presumably have to keep both running? Or is there a way to cover those too? Testing on Windows and macOS is nice just in case, though the full set of OSes here seems like a bit of overkill, given that h11 is pure python and doesn't use any OS interfaces at all.

webknjaz commented 5 years ago

The action that installs Pythons only supports those versions. Theoretically, it is possible to install pypy and dev builds but it'd require somebody to implement that. Maybe I'll create actions for those if I have time but not now. So just keep Travis CI for now and enjoy more free resources :) The matrix can be made smaller but given the duration of test activities and the parallelism, I'd not care about it right now. Also, even though there's no OS-specific stuff in code, it's nice to test against different build configurations since those interpreters aren't compiled the same way as in other CIs.

Oh, and one more thing: codecov gets confused because the service doesn't know how to verify things going on in Actions. So you'd need to create a secret with the codecov token @ https://github.com/python-hyper/h11/settings/secrets and than put that into the workflow.

njsmith commented 5 years ago

So if we merge this, will that activate it, or is there a separate activation step someone has to do?

For the codecov token, is there somewhere in particular we're supposed to stick that secret? Not that I'm terribly worried about codecov tokens becoming public, but might as well figure out how this is supposed to work...

webknjaz commented 5 years ago

So if we merge this, will that activate it

Probably. But check https://github.com/python-hyper/h11/actions/new page first, it may have a tooltip with "Enable" button right now. Once you click it, wait for a few minutes and refresh the page. If it's not there, it's probably active.

[...] codecov token, is there somewhere in particular we're supposed to stick that secret?

Just add env: key here: https://github.com/python-hyper/h11/pull/89/files#diff-2deae8ed35e0da386b702aa047e106cbR62. It should look like:

    - name: Report collected coverage
      run: >-
        codecov
      env:
        CODECOV_TOKEN: ${{ secrets.codecov_token }}

_(if you call your secret codecov_token)_

webknjaz commented 4 years ago

@pquentin @njsmith here's how it looks in the fork: https://github.com/webknjaz/h11/actions/runs/59303498

pgjones commented 4 years ago

Closed in favour of #108 (to match other Hyper projects). Thanks for this though, it was used as the basis for what is now the Hyper workflow.