-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(yarn2): add yarn 2 install action
- Loading branch information
1 parent
a45e6f0
commit d938245
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Install yarn 2 dependencies | ||
description: Install yarn 2 dependencies from scratch or from cache | ||
|
||
inputs: | ||
node-version: | ||
description: 'The Node.js version to use' | ||
default: '16' | ||
required: false | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
|
||
- name: 'Get yarn cache directory path' | ||
id: yarn-cache-dir-path | ||
shell: bash | ||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)" | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: 'Install yarn dependencies' | ||
run: yarn install | ||
shell: bash |