-
Notifications
You must be signed in to change notification settings - Fork 131
CI improvements #417
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 improvements #417
Conversation
66ed1f9 to
fa1a370
Compare
6cd9153 to
8251bdd
Compare
Drop the usage of 'actions-rs/toolchain@v1` which doesn't seem to be maintained
anymore (the repository is archived). Instead let's follow the official guide by
GitHub on building Rust projects[1].
In order to not duplicate the code, introduce a custom GitHub Action to set up our
build env, including native libraries and rust toolchain.
Split the github workflows into 4 files:
- formatting.yml - Linux only - rustfmt nor clang-format shall be be effected
by target platform, they don't process conditional
compilation (previously was checked on multiple
platforms)
- intergation-tests.yml - runs integration tests (Linux x86_64 only, because of
GitHub limitations)
- unit-tests.yml - still x86_64 Linux only for now
- code-quality.yml - runs `cargo clippy` on Linux (x86_64, aarch64) and macOS
with respective supported features
[1]: https://docs.github.com/en/actions/tutorials/build-and-test-code/rust
Signed-off-by: Matej Hrica <mhrica@redhat.com>
By using the `cargo clippy --locked` flag, we can assert that the commited lock files match the commited Cargo.toml. Signed-off-by: Matej Hrica <mhrica@redhat.com>
Signed-off-by: Matej Hrica <mhrica@redhat.com>
8a41fd1 to
e35c855
Compare
57c1177 to
e35c855
Compare
| - name: Setup build environment | ||
| uses: ./.github/actions/setup-build-env | ||
|
|
||
| - name: Cache GLib 2.82 + GTK 4.16 build |
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.
What is the motivation behind building GTK manually?
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.
Sorry, I just saw that in the commit message but wouldn't using a fedora container be 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.
In any case, gtk would build glib automatically if the required version is not installed. So you can drop the glib build part
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.
Yeah I realized maybe I should have done that. But then we would have to maintain both list of build libraries for Fedora and for Ubuntu in the CI (not sure if we can get KVM in a container). Anyways I'm hoping we can just drop this once Ubuntu 26.04 LTS is released.
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.
In any case, gtk would build glib automatically if the required version is not installed. So you can drop the glib build part
This would only work if you pull from git though but i guess what you have is good enough. When it comes to build deps, installing libgtk4-dev should pull all the needed deps i guess
Verify that the the executable gui_vm (and its dependency gtk_display) examples can compile without warnings using `cargo clippy`. This requires a newer version of GTK than we have in the CI, to solve build the required GTK version from source and cache the built GTK libraries in Github cache. Signed-off-by: Matej Hrica <mhrica@redhat.com>
Add test-prefix target for building and installing libkrun to the test prefix prefix without actually running the tests. Signed-off-by: Matej Hrica <mhrica@redhat.com>
Run cargo clippy on tests workspace to ensure there aren't any warnings. Signed-off-by: Matej Hrica <mhrica@redhat.com>
Signed-off-by: Matej Hrica <mhrica@redhat.com>
Signed-off-by: Matej Hrica <mhrica@redhat.com>
7aa2755 to
709342b
Compare
|
This one looks great, nice work here @mtjhrc |
This refactors the CI code, removes the usage of the no longer maintained
actions-rsGitHub action, and adds more checks:Cargo.lockfiles committedcargo fmtandclippy) the examples workspacecargo-fmtandclippy) the tests workspaceThis also resolves the small issues (rustfmt + clippy) uncovered by the new checks