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

Cache is not saved when using cache-dependency-path #578

Closed
2 of 5 tasks
IanVS opened this issue Sep 23, 2022 · 6 comments
Closed
2 of 5 tasks

Cache is not saved when using cache-dependency-path #578

IanVS opened this issue Sep 23, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@IanVS
Copy link

IanVS commented Sep 23, 2022

Description:
I'm using a multi-project repo setup, where the top-level of my repo does not have a package.json or a yarn.lock, but subfolders do. I use cache-dependency-path to specify the subfolder, and node dependencies are correctly installed. But then, in the post step, I get the error:

Error: Cache folder path is retrieved for yarn but doesn't exist on disk: undefined

Because it seems that /usr/local/bin/yarn config get cacheFolder is being run at the top level, rather than my subfolder.

Action version:
v2

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
yarn 3.1.1

Repro steps:

     - name: Use Node
        uses: actions/setup-node@v2
        with:
          node-version: 16.x
          cache: 'yarn'
          cache-dependency-path: path/to/subdir/yarn.lock

Expected behavior:
Deps should be installed and cached, without failing.

Actual behavior:
The Post Use Node step fails with:

Post job cleanup.
/usr/local/bin/yarn --version
[3](https://github.com/storybookjs/builder-vite/actions/runs/3115195970/jobs/5051847340#step:11:3).1.1
/usr/local/bin/yarn config get cacheFolder
undefined
Error: Cache folder path is retrieved for yarn but doesn't exist on disk: undefined
@IanVS IanVS added bug Something isn't working needs triage labels Sep 23, 2022
@IanVS
Copy link
Author

IanVS commented Sep 23, 2022

I just found #488, which seems to be related, but maybe not the same issue exactly.

@IanVS
Copy link
Author

IanVS commented Sep 23, 2022

I was able to get this working by explicitly adding cacheFolder in .yarnrc.yml files in both the root and subfolders, but I think that by default the /usr/local/bin/yarn config get cacheFolder should run in the cache-dependency-path to avoid this failure.

@dmitry-shibanov
Copy link
Contributor

Hello @IanVS. Thank you for your report. We'll investigate the issue.

@dsame dsame self-assigned this Oct 24, 2022
@dsame
Copy link
Contributor

dsame commented Oct 25, 2022

Hello @IanVS

I tried to reproduce the issue both with v2 and v3 version of the action but both seems to work without the problem.

Can you please fork the branch and modify the repo to reproduce the issue?

@dsame
Copy link
Contributor

dsame commented Nov 7, 2022

@IanVS i am closing the issue because of no activity for 2 weeks, but please feel free to reopen this issue or to o create another one in case the problem still exists.

@dsame dsame closed this as completed Nov 7, 2022
@dreamalligator
Copy link

Hi, I have same issue, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants
@dsame @dreamalligator @IanVS @dmitry-shibanov and others