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

Yarn cache not found #453

Closed
2 of 5 tasks
mrlubos opened this issue Mar 30, 2022 · 5 comments
Closed
2 of 5 tasks

Yarn cache not found #453

mrlubos opened this issue Mar 30, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@mrlubos
Copy link

mrlubos commented Mar 30, 2022

Description:
Opening a pull request and pushing changes to it does not cache dependencies, even if the lock file hasn't been affected at all.

Action version:
v3.0.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

Repro steps:
Using a Github CI workflow that looks like this:

setup:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3.0.0
        with:
          fetch-depth: 0

      - name: Setup Node environment
        uses: actions/setup-node@v3.0.0
        with:
          cache: yarn
          node-version-file: .nvmrc

      - name: Install dependencies
        run: yarn install --frozen-lockfile

Produces this log file for setup-node action:

Run actions/setup-node@v3.0.0
  with:
    cache: yarn
    node-version-file: .nvmrc
    always-auth: false
    check-latest: false
    token: ***
Resolved .nvmrc as 16.14.[2](https://github.com/foo/runs/5759850063?check_suite_focus=true#step:3:2)
Found in cache @ /opt/hostedtoolcache/node/16.1[4](https://github.com/foo/runs/5759850063?check_suite_focus=true#step:3:4).2/x[6](https://github.com/foo/runs/5759850063?check_suite_focus=true#step:3:6)4
/usr/local/bin/yarn --version
1.22.1[8](https://github.com/foo/runs/5759850063?check_suite_focus=true#step:3:8)
/usr/local/bin/yarn cache dir
/home/runner/.cache/yarn/v6

yarn cache is not found

Expected behavior:
Pushing to the same pull request should trigger a new run that uses dependencies from the previous run, regardless of its completion status.

Actual behavior:
Every commit causes yarn install to take multiple minutes due to missing cache

@mrlubos mrlubos added bug Something isn't working needs triage labels Mar 30, 2022
@dmitry-shibanov
Copy link
Contributor

Hello @mrlubos. Thank you for your report. I think it can be related to the cache scope:

If it's not relevant to you, could you please provide a public repository to reproduce the issue.

@mrlubos
Copy link
Author

mrlubos commented Mar 31, 2022

@dmitry-shibanov Thank you for your reply! I believe I used to use actions/cache before cache became an option in actions/setup-node, now I am no longer using it. Given that, how would I answer either of the links you shared? I am not sure if I use v1 or v2 since I only have actions/setup-node. Or am I misunderstanding this and I should be still explicitly using actions/cache in my Github workflow?

@dmitry-shibanov
Copy link
Contributor

Sorry for possible misunderstanding. Internally both actions/cache and actions/setup-node use toolkit/cache. The same rule for cache sharing applies to the setup-node action.

@dmitry-shibanov
Copy link
Contributor

Hello @mrlubos, just a gentle ping.

@dmitry-shibanov
Copy link
Contributor

Hello @mrlubos. For now I'm going to close the issue, because it looks like the expected behaviour. If you have any concerns feel free to ping us.

deining pushed a commit to deining/setup-node that referenced this issue Nov 9, 2023
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

2 participants