Test local dependencies in one build

I am using a monorepo structure for my server projects, and I would like to test all my packages every time something has changed.

Let's say I have a library called Lib and a server executable called Server. Right now I have to build and test the two packages separately. This have some issues:

  • It would take much longer to build. For instance, my Lib depends on many communities projects such as SwiftNIO, and my Server depends indirectly on those projects as well. When I have to build for both of them, it means I need to build those community packages for twice.

  • It means potentially inconsistent package resolution. Right now I have Package.resolved for Server committed in the repo, and Xcode automatically deletes Package.resolved for Lib when I open Server's Package.swift. So every time I build Lib for CI, it uses the latest package resolution, which might lead to different behaviors.

  • Also, in the future, if I have multiple leaf packages (Server and its siblings), I would like my local dependencies' tests work correctly with package resolution in all my leaf packages. So in any case, I would like to in all my leaf packages, to run tests for each local dependencies. Though this is not very important.

So, is it possible, when testing for Server, to also test my dependencies? It would be fine to manually select a list of packages to run tests for, to skip community packages that I am not responsible for. Thanks!

Terms of Service

Privacy Policy

Cookie Policy