I'd like to be able to only invoke a build script without triggering full build, for GitLab CI purposes. I'd like to call
cargo fmt -- --check but that fails because a file (that's generated by calling
build.rs) doesn't exist yet and is depended on inside
src/lib.rs via a
use generated_module; clause. To generate the file we'd have to invoke
cargo build first which we don't want to do.
The reason is that we push a Docker image where the project is fully built (after these preliminary CI steps finish). I don't want the GitLab CI to duplicate the compilation process. I want it to do a few sanity checks -- like checking formatting -- and then leave the actual
cargo build step to a remote Docker container.
The team is open to rework their
.gitlab-ci.yml file if we can insert the checking formatting step before that (currently it's not there and we'd like to have it).
Do you have any advice? Thanks for reading.