add workflow for installing dependencies with yarn as package manager#1
add workflow for installing dependencies with yarn as package manager#1
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a reusable GitHub Actions workflow for setting up Node.js projects that use Yarn as their package manager, addressing the need to support different package managers across AICS repositories.
Changes:
- Added a new reusable workflow
setup_yarn.ymlwith configurable Node.js and Yarn versions - Configured the workflow to cache Yarn dependencies and install them using
--frozen-lockfileflag - Set default versions to Node.js 24 and Yarn 1.22.22
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ShrimpCryptid
left a comment
There was a problem hiding this comment.
One suggestion, otherwise LGTM
.github/workflows/setup_yarn.yml
Outdated
| uses: actions/checkout@v4 | ||
| - name: Setup node | ||
| uses: actions/setup-node@v4 |
There was a problem hiding this comment.
Pin specific commit hashes for security?
There was a problem hiding this comment.
Made this workflow match the other one (v6.2.0 via hash)
| workflow_call: | ||
| inputs: | ||
| node-version: | ||
| required: false |
There was a problem hiding this comment.
This is a good choice, we should probably make node-version and npm-version inputs in setup_npm.yml also not required
There was a problem hiding this comment.
I'll tack that on this PR
The
setup_npm.ymlworkflow should hopefully work for any repo that usesnpmas its project manager.However, some repos at AICS use
yarnas a package manager (idea-board, cell catalog), some also usebun(I don't know of any projects at AICS usingpnpm). Different package managers might resolve dependencies differently, trying to callnpm installinidea-boardfailed.I added a
yarnflavored version of the setup workflow and was able to call it successfully by referencing the commit inidea-board.AllenCell/idea-board#48