Skip to content

Support cache dependencies for cases where package lock files are located in subfolders聽#275

Closed

Description

@bbugh

Hi! 馃憢

We have a mixed-language monorepo with nothing in the base folder except some CI info. We need to be able to specify working-directory input like other scripts in order to use this fantastic action to build our node subfolders.

Something like:

- uses: actions/setup-node@v2
  with:
    node-version: '14'
    working-directory: some-client

Thanks!

Activity

  1. maxim-lobanov commented on Jun 30, 2021

    @maxim-lobanov
    Contributor

    Hello @bbugh , I don't think that you need working-directory input in setup-node task. This task just installs specified Node.js version and do nothing with working directory.

    If your package.json / project are located in the separate folder, I think you need to specify working-directory for next steps:

    - uses: actions/setup-node@v2
      with:
        node-version: '14'
        
    - name: Install dependencies and build project
      working-directory: some-client
      run: |
        npm install
        npm run build
        npm run test
  2. bbugh commented on Jun 30, 2021

    @bbugh
    Author

    Hi again! 馃憢 On the caching PR, I had asked about caching working for mono repos, and you had replied saying that's not supported yet. I created this issue to request that support. 馃槈

    Since GitHub actions has poor support for yaml and no reuse between steps, we have a lot of repetitive yarn tasks for caching and running. Having support built into this will be super helpful, and as we have a multi-language mono repo, we need to be able to run and cache them separately.

    In particular, Yarn 2's cache folder will be different for each project, as the default is <project>/.yarn and in the case of zero-installs would be committed to source control. In that case, a working-directory would be used to successfully run yarn in the correct location with the correct cache folder.

    Or a cache-root option, or something. I suggested working-directory because that's a standard configuration among most actions.

  3. changed the title [-]Support working-directory input[/-] [+]Support cache dependencies for cases where package lock files are located in subfolders[/+] on Jun 30, 2021
  4. maxim-lobanov commented on Jun 30, 2021

    @maxim-lobanov
    Contributor

    @bbugh caught it. I have renamed the issue title a bit to be more clear. Hope it works for you!

  5. bbugh commented on Jun 30, 2021

    @bbugh
    Author

    I'm always reminding people about XY problems and here I did one myself. Thanks!

  6. maxim-lobanov commented on Jul 15, 2021

    @maxim-lobanov
    Contributor

    Hello everyone!

    This feature request will be implemented soon. I have a small ADR under review #299 .
    Proposed approach is a bit different from proposed in this issue - we would like allow specifying full path (directory path + filename) to lock file instead of working_directory (directory path only). We believe this approach will be a bit more generic and unblock more use-cases.

  7. dmitry-shibanov commented on Aug 16, 2021

    @dmitry-shibanov
    Contributor

    Hello everyone, pull request with adding support of specifying lock files was merged. I'm closing the issue if you have any concerns, feel free to reopen it or ping me in the thread.

  8. added a commit that references this issue on Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions