On Fri, Nov 08, 2024 at 07:01:39PM +0100, Paolo Bonzini wrote: > Code checks, as well as documentation generation, are not yet tied > to "make check" because they need new version of the Rust toolchain > (even nightly in the case of "rustfmt"). Run them in CI using the > existing nightly-Rust container. > > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > --- > .gitlab-ci.d/buildtest-template.yml | 14 ++++++++++++++ > .gitlab-ci.d/buildtest.yml | 14 ++++++++++++++ > .../docker/dockerfiles/fedora-rust-nightly.docker | 4 ++++ > tests/lcitool/refresh | 4 ++++ > 4 files changed, 36 insertions(+) > > diff --git a/.gitlab-ci.d/buildtest-template.yml > b/.gitlab-ci.d/buildtest-template.yml > index 39da7698b09..612e968ff19 100644 > --- a/.gitlab-ci.d/buildtest-template.yml > +++ b/.gitlab-ci.d/buildtest-template.yml > @@ -79,6 +79,20 @@ > - $MAKE NINJA=":" $MAKE_CHECK_ARGS > - section_end test > > +.rust_test_job_template: > + extends: .base_job_template > + stage: test > + image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG > + script: > + - source scripts/ci/gitlab-ci-section > + - section_start test "Running Rust code checks" > + - cd build > + - pyvenv/bin/meson devenv -w ../rust ${CARGO-cargo} fmt --check > + - make clippy > + - pyvenv/bin/meson devenv -w ../rust ${CARGO-cargo} doc --no-deps > + - pyvenv/bin/meson devenv -w ../rust ${CARGO-cargo} test --doc > + - section_end test > +
I'd suggest that the static checks "fmt" and "doc" should be separated from the dynamic (unit test) check in "tests", and that the former should be in a job defined in the static-checks.yml file. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|