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: yarn
not working for Yarn 3 (Berry) in a subfolder
#488
Comments
Hi @kachkaev , We will investigate on that issue and come back to you. |
Hello @kachkaev , Thanks for your issue. This is unexpected behavior because you're using binaries located directly in a directory, but the action is running at the root of the repository, so it doesn't see yarn binaries in a subfolder. So the yarn version hasn't changed. |
Yep, that's what happens. Keeping Yarn binary in the project and calling global Running - name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- cache-dependency-path: tooling/yarn.lock
+ working-directory: tooling ## proposed option, does not exist at the time of writing This proposed Please let me know if you see other solutions here! 🙂 |
Hi, @kachkaev 👋 ! Thanks for popping this issue up! Our action, in fact, doesn't support yarn berry out of the box, but you found the perfect workaround that can be helpful to other customers! I think we can close this issue now because it's not really a bug, but expected behaviour. However, I'd like to ask you to open a new feature request and we will investigate the possibility of adding this functionality to the new releases. |
👋 @IvanZosimov! Yeah I actually agree with you that this more like a feature request rather than a bug report. Do you know if it’s OK to just change issue labels instead of closing and reopening it? |
Hello, @kachkaev 👋 ! Yes, it's OK, I changed the label by myself, thank you again for contributing 🤟 |
Read the comments it sounds like there is a potential work around? But I am unclear on what the work around is. I also don't see What's the status of this one? |
Hi, @gruckion 👋 Most probably my comment mislead you, sorry for that. About the status, this feature request is not the top priority at the moment, so we keep it to implement in the future. |
See workaround section in the first comment. |
- fix dockerfile - remove i386 arch - fix puppeteer running on arm - use a fix from actions/setup-node#488 (comment) - lint inside container - remove double build for tests - upgrade all deps - fix linter errors
temporary workaround as actions/setup-node@v3 does not support yarn berry see https://gist.github.com/belgattitude/042f9caf10d029badbde6cf9d43e400a and actions/setup-node#488 (comment)
* Canvas test failures #91 fixed workflows fixed dockerfile for binder * Fix unknown entity warnings (#90) * fixed package info * fix for #92 #93 and #94 added new workflow for releasetools * use yarn instead of npm * workaround for yarn caches on subprojects: from actions/setup-node#488 (comment) --------- Co-authored-by: Manuel Martins <Manuel.Martins@ecmwf.int> Co-authored-by: Jerry James <loganjerry@gmail.com>
* Canvas test failures #91 fixed workflows fixed dockerfile for binder * Fix unknown entity warnings (#90) * fixed workflows fixed dockerfile for binder * fixed dockerfile for binder * fixed dockerfile for binder * fixed dockerfile for binder * fixed package info * fix for #92 #93 and #94 added new workflow for releasetools * revert changes from latest jupyterlab extension cookiecutter * use yarn instead of npm * workaround for yarn caches on subprojects: from actions/setup-node#488 (comment) * workaround for yarn caches on subprojects: from actions/setup-node#488 (comment) * new release 2.0.2 to test ReleaseTools --------- Co-authored-by: Manuel Martins <Manuel.Martins@ecmwf.int> Co-authored-by: Jerry James <loganjerry@gmail.com>
* Canvas test failures #91 fixed workflows fixed dockerfile for binder * Fix unknown entity warnings (#90) * fixed workflows fixed dockerfile for binder * fixed dockerfile for binder * fixed dockerfile for binder * fixed dockerfile for binder * fixed package info * fix for #92 #93 and #94 added new workflow for releasetools * revert changes from latest jupyterlab extension cookiecutter * use yarn instead of npm * workaround for yarn caches on subprojects: from actions/setup-node#488 (comment) * workaround for yarn caches on subprojects: from actions/setup-node#488 (comment) * new release 2.0.2 to test ReleaseTools * Update RELEASE.yml use already present gh-pages branch --------- Co-authored-by: Manuel Martins <Manuel.Martins@ecmwf.int> Co-authored-by: Jerry James <loganjerry@gmail.com>
* Canvas test failures #91 fixed workflows fixed dockerfile for binder * Fix unknown entity warnings (#90) * fixed workflows fixed dockerfile for binder * fixed dockerfile for binder * fixed dockerfile for binder * fixed dockerfile for binder * fixed package info * fix for #92 #93 and #94 added new workflow for releasetools * revert changes from latest jupyterlab extension cookiecutter * use yarn instead of npm * workaround for yarn caches on subprojects: from actions/setup-node#488 (comment) * workaround for yarn caches on subprojects: from actions/setup-node#488 (comment) * new release 2.0.2 to test ReleaseTools * Update RELEASE.yml use already present gh-pages branch * Update RELEASE.yml --------- Co-authored-by: Manuel Martins <Manuel.Martins@ecmwf.int> Co-authored-by: Jerry James <loganjerry@gmail.com>
I fixed it with the following setup, but the docker still takes time (2-3m) to build the image, maybe we should apply cache to docker too. jobs:
frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(cd client && yarn config get cacheFolder)" >> $GITHUB_ENV
- name: Cache Dependencies
uses: actions/cache@v3
with:
path: ${{ env.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup Node.js and Yarn
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache-dependency-path: client/yarn.lock
registry-url: "https://registry.yarnpkg.com"
- name: Install dependencies
working-directory: client
run: yarn install
- name: Run linter
working-directory: client
run: yarn lint |
* Canvas test failures #91 fixed workflows fixed dockerfile for binder * Fix unknown entity warnings (#90) * fixed workflows fixed dockerfile for binder * fixed dockerfile for binder * fixed dockerfile for binder * fixed dockerfile for binder * fixed package info * fix for #92 #93 and #94 added new workflow for releasetools * revert changes from latest jupyterlab extension cookiecutter * use yarn instead of npm * workaround for yarn caches on subprojects: from actions/setup-node#488 (comment) * workaround for yarn caches on subprojects: from actions/setup-node#488 (comment) * new release 2.0.2 to test ReleaseTools * Update RELEASE.yml use already present gh-pages branch * Update RELEASE.yml * added fetch-depth: 0 to fetch all branches --------- Co-authored-by: Manuel Martins <Manuel.Martins@ecmwf.int> Co-authored-by: Jerry James <loganjerry@gmail.com>
* develop: update gh-pages branch added fetch-depth: 0 to fetch all branches Update RELEASE.yml Update RELEASE.yml new release 2.0.2 to test ReleaseTools workaround for yarn caches on subprojects: from actions/setup-node#488 (comment) workaround for yarn caches on subprojects: from actions/setup-node#488 (comment) use yarn instead of npm revert changes from latest jupyterlab extension cookiecutter fix for #92 #93 and #94 added new workflow for releasetools fixed package info fixed dockerfile for binder fixed dockerfile for binder fixed dockerfile for binder fixed workflows fixed dockerfile for binder Fix unknown entity warnings (#90) Canvas test failures #91 fixed workflows fixed dockerfile for binder
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.9.5 to 5.0.2. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](microsoft/TypeScript@v4.9.5...v5.0.2) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix incorrect sizing of recent blog post images * Fix broken hash navigation on page load with code examples The code replacement modifies height, which means the anchor navigation is at the wrong place. Renavigate after code has loaded. * Update browserlist * Yarn workaround in github action See actions/setup-node#488 for reference. * eslint-check -> eslint, remove website test (we don't have them)
Description:
When a repo with Yarn Berry is in a subfolder,
cache: yarn
does not get applied.Action version:
setup-node@3.1.1
Platform:
Runner type:
Tools version:
Yarn 3.2
Repro steps:
Configure a pipeline that checks out the Node repo into a subfolder:
Setup Node, as suggested in the action docs:
Expected behavior:
actions/setup-node
correctly launches the right version of Yarn (which is included into the repo). Therefore, the right folder is cached and the follow-up setup is faster.Actual behavior:
Yarn cache dir is resolved to
/home/runner/.cache/yarn/v6
. This is becauseyarn --version
is called in the default directory, which is followed byyarn cache dir
instead ofyarn config get cacheFolder
insidetooling
. Cache end up empty and so all packages are re-downloaded again each time.Potential solution:
It’d be nice to pass
working-directory
down toactions/setup-node
(similar to therun
task).Workaround:
Cache key is inspired by #325
The text was updated successfully, but these errors were encountered: