Can I attach only specific files from a workspace using `attach-workspace`

Currently, our workflow has around 15 jobs in it. There are data that needs to be passed from one job to another. This works well but some of our jobs only need a file or two from the workspace. With only one shared workspace, our builds are taking a long time to complete. I am aware that CircleCI does not support multiple workspaces in one workflow so I am wondering if it’s possible to attach only specific items from the workspace and not all of it.

Or is there a require command for workflows similar to jobs so I can split them up into smaller workflows?

:wave: At the moment this is not possible as when you attach the workspace it will attach the whole workspace. There is no option to attach a specific directory (or file) from the workspace to the job.

This is a great idea though, so I would encourage you to open a feature request for this over on our ideas board. Every vote and comment counts as we take all features into consideration when we plan future features!

You may be able to work around this by using caching instead, but this will likely add complexity to your workflow as you will need to use cache keys (that subsequent jobs will need to know) along with the fact that caches are immutable once created.

1 Like