Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect cached folders from multiple directories #735

Merged
merged 21 commits into from Jun 21, 2023

Conversation

dsame
Copy link
Contributor

@dsame dsame commented Apr 10, 2023

Description:

Traverse all the sub directories derived from cache-dependency-path input and add detect all dependencies directories to cache.

The key change is to replace getCacheDirectoryPath with getCacheDirectoriesPaths

The major changes are:

  • modifying interface PackageManagerInfo to have name field (to avoid passing it as a parameter to
    many functions) and replace string property getCacheFolderCommand with a function getCacheFolderPath: (projectDir?: string) => Promise<string>
  • adding a function expandCacheDependencyPath to expand string cache-dependency-path input that can be either
    one file or glob pattern and multiline list of files or glob patterns

The other code changes are clue and mappings from expanded cache-dependency-path to the array of directories to cache.

and minor but worth to be noted change is
src/cache-save.ts

  // TODO: core.getInput has a bug - it can return undefined despite its definition
  //       export declare function getInput(name: string, options?: InputOptions): string;
  const cacheDependencyPath = core.getInput('cache-dependency-path') || '';

Related issue:
link to original issue
link to milestone issue

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@dsame dsame requested a review from a team as a code owner April 10, 2023 15:08
@dsame dsame changed the title Add project-dir Detect current working directory Apr 11, 2023
kish3499

This comment was marked as spam.

@dsame dsame force-pushed the project-dir branch 6 times, most recently from 3e5c14d to 15c2532 Compare April 19, 2023 14:21
@dsame

This comment was marked as outdated.

src/cache-utils.ts Outdated Show resolved Hide resolved
src/cache-utils.ts Outdated Show resolved Hide resolved
src/cache-utils.ts Outdated Show resolved Hide resolved
@dsame dsame force-pushed the project-dir branch 5 times, most recently from bca9c4f to 3527195 Compare April 24, 2023 09:54
@dsame dsame force-pushed the project-dir branch 2 times, most recently from c0ab8e3 to b67cbdb Compare May 8, 2023 16:50
@dsame dsame force-pushed the project-dir branch 4 times, most recently from a690446 to 4ce3252 Compare May 17, 2023 07:58
@dsame dsame changed the title Detect current working directory Detect cached folders from multiple directories May 17, 2023
@dsame dsame force-pushed the project-dir branch 3 times, most recently from b2328f1 to 47381ae Compare May 19, 2023 18:33
@dsame dsame force-pushed the project-dir branch 6 times, most recently from 2308e96 to e6a6894 Compare June 8, 2023 12:18
src/cache-utils.ts Outdated Show resolved Hide resolved
.github/workflows/e2e-cache.yml Outdated Show resolved Hide resolved
__tests__/cache-save.test.ts Outdated Show resolved Hide resolved
@dsame dsame force-pushed the project-dir branch 3 times, most recently from 8951c11 to f792668 Compare June 16, 2023 12:45
Copy link
Contributor

@marko-zivic-93 marko-zivic-93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! :)

@MaksimZhukov MaksimZhukov merged commit 8170e22 into actions:main Jun 21, 2023
148 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants