-
Suggestion
-
Resolution: Unresolved
-
None
Problem Definition
Assume a project with dependencies in the following directories:
- packages/componentA/dist
- packages/componentB/dist
If we use one cache definition with a wildcard as follows
definitions:
caches:
build-cache: packages/**/dist
or
definitions: caches: build-cache: key: files: - package.json path: packages/**/dist
the result is that a directory named ** will be created inside the packages directory, and then one directory named dist will be created inside the directory ** which will contain the files of both packages/componentA/dist and packages/componentB/dist. The directory structure is not preserved in the cache.
Multiple cache definitions can be used, one for each directory. However, if the number of components (and directories to be cached) is large, the yml file will become quite large.
Suggested Solution
When using a wildcard in the cache path, preserve the structure of the directories that are cached.
Workaround
Multiple cache definitions can be used, one for each directory as follows:
definitions: caches: build-cache: key: files: - package.json path: packages/componentA/dist build-cache2: key: files: - package.json path: packages/componentB/dist
Form Name |
---|
This prevents using wildcards on windows self hosted runners as cache keys, I would escalate to BUG and not suggestion.
BBS-229433