Run tests that only required by commit?

I have workspace ~30 crates. And I don't want to run all tests for each commit on CI sever, because of it takes too much time. Is any tool that

  1. Check "git diff" and generate list of crates code in which was changed
  2. Use this information to build list of crates that depend on crates in step (1)


1 Like

If you're using GitHub CI you might be able to use the paths option - but I'm not sure how useful this is.

git diff --stat will give you paths of files that have changed.

From there it may be easiest to just grep the output for known directories, but if you want to do it fancy-correct way, then you can use cargo metadata to get a list of crates and their paths.

Yeah, I know it can been automated, what I am looking for is already existing solution, even if it is partly applied.

I read a list of cargo-* crates, but can not find even something that solve (1) or (2).

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.