-
-
Notifications
You must be signed in to change notification settings - Fork 97
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 GHA CICD #120
Add GHA CICD #120
Conversation
I added in several commits fixing They are currently logically separated so that you can more easily evaluate the refactoring decisions, but I can easily squash them into one if you'd prefer. |
Oh, also, it's 5 to 10 times faster than Travis or AppVeyor. |
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.
Thank you very much for your contribution!
In general, this looks great! 👍
That being said, I would really prefer the CI/CD file to be as simple as possible. At the moment, there is A LOT of code and some of it doesn't seem to be strictly necessary. There are also a lot of commented-out lines which I would prefer to be removed, if possible.
I know that you already put a lot of work into this, but I need to consider the fact that I might have to maintain this myself in the future. And for now, I'm not very familiar with GitHub Actions (although it sounds like a great idea to use this in the future).
Should we remove the AppVeyor/Travis CI files? Is there anything that is not supported in GitHub Actions?
I think GHA is a complete solution and that AppVeyor and Travis can be discarded. But, I'd let this percolate for a few commits/PRs before removing them to make sure there's no problem or unmet need. |
Thank you!
That sounds fantastic :-) |
Ok, I've slimmed the CICD code down (a bit). I think what's left is necessary, but please let me know if you disagree or any of it is unclear. I replaced the commented Code Coverage section with a new alternate (working) version (using I left a couple of "cleanup/polish" commits for the GHA:CI code because you might want to preserve them instead (especially, leaving the 'features' support might make a future self happier if you ever add any features). I'm happy to squash down any/all of the Notably, all steps together, which now includes style checks and code coverage runs, take 8 minutes to complete (for comparison the Travis run takes 25 min, and the AppVeyor run was taking about 20 minutes). The GHA:CI runs (from my repo) are available for review at https://github.com/rivy/rs.pastel/actions. |
Looks like I have a bug in the way I'm testing MinSRV and that rust v1.35 doesn't like |
... or tonight, I guess. 😄 To use Instead, I'm using |
That still seems like a massive amount of code/configuration. We currently have a ~90 line file It seems to do a lot more than our For example, there are a whole lot of |
I can remove the Style checks, the MinSRV build/test, and all code coverage which would take the line count down to 218 lines. But I think it's valuable functionality that shouldn't be removed. The And, in looking at the Travis build, it's really about the same size as this CICD script (which has significantly more functionality and speed). The Travis build uses several scripts in the ./ci directory which add another 230 lines to the size of the build script, just bundled in a library directory. I'm happy to run through what the CICD.yml is doing and why, in a step-wise manner, so that you can decide what you do and don't want to include. But, IMO, the current version has reasonable code size for the functionality (which is all useful). |
Thank you for your work. I'd like to get this merged!
For now, I would really prefer a version without style checks and without clippy checks. I really love both Don't get me wrong. I would love to have such checks if this would be a high-performance library or something security relevant, etc.. But it's just a innocent little command line application which would rather profit from having low maintenance PRs/pushes. As for MinSRV build/test... I don't even know what that is?
ok
Fair point! |
src/distinct.rs
Outdated
result.closest_pair.0 | ||
} else { | ||
if self.rng.gen() { | ||
#[allow(clippy::collapsible_if)] |
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.
similar here
src/lib.rs
Outdated
@@ -868,7 +871,7 @@ impl ColorScale { | |||
let same_position = self | |||
.color_stops | |||
.iter_mut() | |||
.find(|c| position.value() == c.position.value()); | |||
.find(|c| (position.value() - c.position.value()).abs() < std::f64::EPSILON); |
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!! the ==
check on float
s is actually desired here. Using an epsilon check would be wrong.
This is one of the reasons why I don't like to have clippy warnings checked by default.
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.
Commit dropped (reverted).
src/types.rs
Outdated
@@ -15,7 +15,7 @@ impl Hue { | |||
|
|||
/// Return a hue value in the interval [0, 360]. | |||
pub fn value(self) -> Scalar { | |||
if self.unclipped == 360.0 { | |||
if (self.unclipped - 360.0).abs() < std::f64::EPSILON { |
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.
Same here. Please leave the ==
check in place. This can lead to wrong results (angles larger 360.0 degrees)
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.
Commit dropped (reverted).
Fair enough, I'll yank the "Style" jobs from the CI.
Sorry for the jargon ... "MinSRV" == "minimum supported rust version". It is debatable whether yoiu want to have this as a signal you want to send to other devs. If you don't want it, I can yank it as well. I'll plan to give this a look again tomorrow or the day after and update based on your feedback. |
Oh 😄
No - a test for min. supported Rust version is great. Thanks! |
Ok, I've dropped the 'Style' job, and removed the commit altering the float comparisons. I've included some other minor updates for code coverage and i686-pc-windows-gnu builds as well. I've grouped the All jobs are passing. Let me know how you want me to handle the |
Let's leave the allow parts in. I guess I just have to get used to it.
I'm fine with raising to 1.40, thanks!
You don't have to, if it's up to me. I like your fine-grained commits 👍 |
I'll have an updated PR pushed later tonight. |
… * MinSRV to '1.40.0' - `.as_deref()` was stabilized in rust v1.40.0; * requires MinSRV => '1.40.0' - ref: <https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1400-2019-12-19>
…uired stable == rust v1.43.0+)
…nightly toolchain ## [why] Code coverage must currently use some unstable features in nightly rust builds. The nightly builds are, by definition, unstable and subject to frequent breaking changes. To prevent CI build breakage, the toolchain is pinned to a specific known working set. Note: (maint!) this will require periodic review until code coverage is more fully implemented/integrated into Rust and moved into the stable channel. - refs: <mozilla/grcov#427>, <newsboat/newsboat#916>
Ok, it's up.
|
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.
@rivy Thank you so much for all of this work! Is there anything else I need to set up in order to make the automatic deployment work?
I'm just now starting to realize how cool this is 😎 |
No, it should just auto-deploy to releases section any time you push a "version tag", meaning any tag starting with a number (with an optional leading v), to the repository. The regex match is If it doesn't work, ping me and I'll look at it. |
Thank you! I'll try to tag a new release soon. |
If you have trouble with code coverage breaking the build, I submitted a new PR to alleviate that issue (#126). |
The release process worked just fine. Thanks again. |
This is a GitHub Actions workflow for CICD that I created for a couple of other repositories.
I've also added in automated debian packaging / deployment (see example at https://github.com/rivy/rs.pastel/releases/tag/v0.7.0.2).
Additional targets are easily added as well.
Fixes: #119