-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CI workflow for GitHub Actions #1012
Conversation
0ae3a35
to
cc800ac
Compare
Codecov Report
@@ Coverage Diff @@
## master #1012 +/- ##
=======================================
Coverage 99.47% 99.47%
=======================================
Files 37 37
Lines 2675 2680 +5
Branches 322 322
=======================================
+ Hits 2661 2666 +5
Misses 8 8
Partials 6 6
Continue to review full report at Codecov.
|
f75bd55
to
56de8bf
Compare
Tracking issue for tokenless codecov reports: https://community.codecov.io/t/whitelist-github-action-servers-to-upload-without-a-token/491/5 |
0c5958d
to
b743655
Compare
7309dcd
to
294e31d
Compare
Hey @webknjaz. Thank you so much for such huge feedback! Much appreciated! ❤️ I've resolved all the discussions (I hope, feel free to unresolve otherwise) and I'm ready for another round of review! 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I am not sure I need tox in a GitHub actions world, but that is certainly a question of preference.
What the only point I'd stress on, would be to merge both workflows. Both have the same running condition and only one job. IMHO it should be one workflow with two or more jobs, preferable a dependent one. A workflow can be as big as this: https://github.com/codingjoe/django/blob/30962/flake8/.github/workflows/ci.yml
It's needed with any CI because it works like a glue between different platforms, plus it allows running tests locally exactly the same way. It's a well-established practice to use it like this. |
@atugushev maybe on the next iteration we could make the CI actually test the dists too, not just source. And add macOS into the matrix. But right now it seems ready to go. Done is better than perfect. |
What do you mean by "test the dists"? |
When you run tox, it works with the source in the project dir and even creates some temporary dists. But they are not what you're going to publish to PyPI hence you test not exactly the same as users will get. Also, you may be testing not what's installed for various reasons.
|
Co-Authored-By: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
I've added MacOS to the matrix. |
|
You could add a condition to only run them on cron and push, for example |
@@ -1,28 +1,73 @@ | |||
name: cron | |||
name: Cron |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't think you'd copy all the workflow into another file. I meant we could inject a small if-clause on the job level to filter out things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you post a suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this should do https://github.com/jazzband/pip-tools/pull/1012/files#r419714725
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with the copy approach for a while. As soon as GitHub provides an opportunity to make matrix conditionals at a job level we'll refactor it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, there is a crazy way to implement this: https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#fromjson 🤪
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow 😄
|
||
jobs: | ||
test: | ||
name: ${{ matrix.os }} / ${{ matrix.python-version }} / ${{ matrix.pip-version }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: ${{ matrix.os }} / ${{ matrix.python-version }} / ${{ matrix.pip-version }} | |
name: ${{ matrix.os }} / ${{ matrix.python-version }} / ${{ matrix.pip-version }} | |
if: >- | |
!startsWith(matrix.python-version, 'pypy') || | |
github.event_name != 'pull_request' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... In that case test
job is not run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? It should only exclude matching jobs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may have made a mistake in the condition, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it looks correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's because you have to apply my suggestion exactly like it's submitted. But you added a leading !
there w/o quoting. This works w/o quoting only if you wrap the whole value with quotes or use a multiline form as I originally suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a context access problem but a YAML parsing one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. Maybe you're right but that post is old, have you checked if it works with the proper syntax?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You and @webknjaz are thoroughly ironing this out. 🙌 👍
@codingjoe do you still want to block this? |
Seems like it's ready to go! 🚀 |
I'm so happy we've finally done this. Huge thanks to the reviewers! ❤️ |
Use `set-output` instead of `set-env`, since it is removed from GHA. See https://github.blog/changelog/2020-11-09-github-actions-removing-set-env-and-add-path-commands-on-november-16/ Addresses jazzband/pip-tools#1012 (comment)
No description provided.