Replace Travis with GitHub action for linting & tests #47
Conversation
Hmm, strange, it doesn't even appear that you can cancel the stuck clippy action. 😦 |
Co-Authored-By: Jake Shadle <jake.shadle@embark-studios.com>
Hey, @repi and @Jake-Shadle! I think that the stuck "CI / clippy (push)" check is on me. Can you change this line uses: actions-rs/clippy-check@v1 to uses: actions-rs/clippy-check@instant-success temporary so we could test the fix? |
@svartalf thanks! trying it out and we'll see if it works better |
@svartalf that did start the build and passed, but didn't do anything in it |
@repi according to the check page, clippy had found nothing to report about. |
Yes I expected it to report 1 warning, this one which 1.38 clippy finds:
And I thought it was a bit suspicious in the build log that one doesn't see any output from the |
Okay, I think I know what the problem is :)
args: --all-features -D warnings
Can you try to remove the |
Ah good catch! We do want clippy warnings to be interpreted as errors for CI, but I added the setting wrong, needs to be |
In fact, with a current implementation, non-zero exit code for |
Ok interesting. We chose this workflow in our repos because when working locally it was a bit too much of a hassle to make sure we have no clippy warnings, esp. as one may also try different toolchains such as switching between stable, beta and nightly for testing and experimentation purposes. Quite similar to rustfmt, while one is working locally it is ok that the code is not formatted, but want to make sure in PRs that everything has been formatted. Actually in that specific case we wouldn't ideally want to fail CI on rustfmt mismatches, but actually have another action that just runs rustfmts on that branch and commits it. But that is another story. We could potentially change our clippy workflow to |
@repi it is very interesting, thank you. Could I ask you to restart the build once again? No additional changes, just press the "Re-run all checks" button |
@svartalf done |
@repi ta-da: https://github.com/EmbarkStudios/texture-synthesis/pull/47/checks?check_run_id=239021326 Your idea is reasonable, so I added two extra things:
|
@svartalf sweet, big thanks for the quick support and fixes! |
And thank you for your thoughts and test environment :) I published new version already, do not forget to switch back from the |
@svartalf right will change it back. Oh and another small thing if you don't mind. or actually two :)
|
Either you can remove the
|
Thanks, makes sense. and as one can't select other images one will always have that Rust install step. Hopefully later rustup gets the option to install without docs that could speed it up a bit though. Good suggestion to combine the steps, that actually solved point 2 for me also because it is just a single step and we run both rustfmt and clippy on the same latest stable version, not different versions. And configuration is simpler: on: push
name: CI
jobs:
fmt:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check --color always
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features -- -D warnings |
In fact, |
@svartalf Yeah that will be nice, running the toolchain install action on Windows takes close to 3 min. Though we have the same problem on Travis. Looking forward to that improvement |
@Jake-Shadle I tested replacing also the Build times (Travis vs Github Actions):
And this is on their standard 2 core machines, but should overall be a lot better than our Travis usage because GitHub allows running way more parallel builds:
And I hope later when they are out of beta that one could pay for getting better machines (8 cores at least would be nice). |
Note: still currently use Travis for publishing releases here |
If/when we merge this in, I'll have to reconfigure the list of required checks on the protected master branch here in Settings. unfortunately that is not just a file that one can change in a branch, not ideal. Really would have wanted the default to be that all checks are required of one requires checks. |
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.
Awesome, I can transition the deployment next week since I want to do it for cargo-deny as well, good that everything is better and cleaner. Thanks a lot for the actions and help @svartalf!
This is a first experiment to use @svartalf 's new Rust GitHub actions for verifying that that are no differences with rustfmt and no clippy warnings instead of Travis CI.
My hope is that it would both be less setup, better performance (Travis is capped to 5 concurrent builds per org) and better user experience with being able to see the errors & warnings of a failing check directly in GitHub.
Have run into some issues though, primarily that occasionally the clippy build simple doesn't want to start, which is a major blocker. Issue with GitHub Actions in general, or configuration error?
Here is an example of such a build: https://github.com/EmbarkStudios/texture-synthesis/runs/238881653. Just sits on "Starting your workflow run..."