-
Notifications
You must be signed in to change notification settings - Fork 48
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
CI: Add building, testing and linting #297
Conversation
8e5038c
to
4cc39cb
Compare
@couryrr-afs interesting! Don't you need to change the README as well? When I read
Maybe we should remove that section of the README and suggest that people instead refer to the CI for instructions on how to run tests. That will ensure that we don't have two sources of truth that we have to keep consistent. The code looks fine, as soon as this change is done, I am happy to approve from my side. |
@shankari I thought the same thing about the
|
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.
Hi @couryrr-afs,
thanks for your first contribution. It's good that you're pushing that there also the build and tests are automatically run.
Looks like you've copied most parts of the workflow from the everest-core
repo (see here). That would result in maintaining multiple, >90% similar workflows. (Besides the point that I think it's nice practice to give credit to the source. A simple link would be enough, though, IMO.)
So can you help on improving the workflow in everest-core
to become a reuseable workflow instead, please? That would be nice. Thanks.
But you are using
Is that actually required, or is it |
If I am reading this correctly Any guidance from the community would be appreciated if I am interpreting this incorrectly. |
@Dominik-K I can take a look at the reusable workflow. We have a few work items that are all very similar to this so it might be useful. If time is not in my favor would you just want a simple comment with a link to core's implementation? |
Nice idea 👍 Actually, if we transform the We're using reStructuredText in many places already. But this should be done in another PR. |
Regarding the |
@Dominik-K this sounds like a great idea but I am not 100% sure how it will happen. Maybe you can link to an example of how the shell scripts from the README are currently automatically checked or elaborate further. One back of the envelope option is to have the README.rst include a file with the script. But that would also have to be RST. So then is the expectation that the Github action would parse through the included file, treat it as a script, and execute it? |
Sorry, I've forgot that GitHub deactivated the
Yeah, then the easiest way would be to simply link to the shell-script from the readme. But that requires context-switching while reading. |
@shankari I cannot add reviewers but there was an update to this PR for the CI work. Please re-review. |
@couryrr-afs FYI: I just started trying to reuse the workflow from |
4cc39cb
to
844e351
Compare
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.
The database_test
doesn't succeed. Unclear why because outputs are missing (see comment).
Please make sure that all tests run accordingly before asking for review. Incl. the lint
/clang-format
.
Very sorry for this. It was working before my commit but I had to do some merges. This seems odd now the test that is failing.
|
e130b0d
to
597fae7
Compare
@couryrr-afs I've figured out the issue: So it's actually already a good result that the unit-tests are run again. 👍 I'm wondering why this wasn't noticed before. However, I suggest to skip this test for now. As it's now tracked to solve it. I wanted to contribute this change, but it seems you disallowed changes by maintainers. Or? So I want to commit this change in TEST_F(DatabaseTest, test_insert_and_get_profiles) {
// TODO enable again on fixing https://github.com/EVerest/libocpp/issues/384
GTEST_SKIP() << "validFrom/validTo checks are failing. See https://github.com/EVerest/libocpp/issues/384"; I'm surprised that in the test-result summary it's nowhere mentioned that one test is skipped. Or is it just with my setup? |
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 with comments (in the meaning: I assume you'll address my comments.)
|
||
cmake \ | ||
-B build \ | ||
-S "$EXT_MOUNT/source" \ |
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.
This line is specific for within the docker-container. I think it can be removed and the source-dir set to the current working-dir in the workflow itself.
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.
Is there a desire to not run the build and test in a docker container? Currently, that was the process. If there needs to be an update to that process could it be a separate issue? I would like to get this PR merged so that tests are being ran in an automated fashion.
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.
Yes, the scripts run in a Docker-container in GitHub (mainly that the CI could be easily debugged locally, as there no SSH-access, etc. to the CI-runners).
But this script should now also serve as the source for the local run (see #297 (comment)).
However, with the reusable workflow all this files (as all others) will be gone in this repo anyway.
trap "cp build/Testing/Temporary/LastTest.log /ext/ctest-report" EXIT | ||
|
||
ninja -j$(nproc) -C build test |
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.
The /ext/
is specific within the docker-container. When you split-up this script in two files (build_install.sh
and test.sh
), you could run the trap
inside workflow. That's not needed when running locally. (However, I hope the files here will soon be replaced with the reusable workflow anyway.)
ab9ce2d
to
3ec0c68
Compare
@shankari Please review again. I'll merge it when you approved it. Note: It will be replaced with the reusable workflow in |
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 as a short-term improvement, soon to be superceded by the reusable workflow.
I'm glad this exposed the issue around timestamps, which is apparently not trivial to fix.
Testing FTW!
@Dominik-K you can go ahead and merge this.
Signed-off-by: Coury Richards <[email protected]>
Signed-off-by: Coury Richards <[email protected]>
Signed-off-by: Coury Richards <[email protected]>
Co-authored-by: Dominik-K <[email protected]> Signed-off-by: Coury Richards <[email protected]>
Signed-off-by: Coury Richards <[email protected]>
Signed-off-by: Coury Richards <[email protected]>
@Dominik-K and @shankari I am pushing one more change this morning. Looks like it was still running on branch pushes. |
3ec0c68
to
8e7d2a5
Compare
Update the GitHub Actions to run the build and test as well as the linting.
@shankari please review.