Skip to content

Commit

Permalink
CI: have workflow install Yarn if not present
Browse files Browse the repository at this point in the history
This is useful e.g. for act [1] if using the medium-sized image.

Taken from user @francis-switcho’s comment on actions/setup-node. [2]

[1]: https://github.com/nektos/act#default-runners-are-intentionally-incomplete

[2]: actions/setup-node#182 (comment)
  • Loading branch information
claui committed Oct 3, 2023
1 parent ef60d6b commit 72e1784
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,23 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install yarn if not present
run: |-
if which yarn; then
exit
fi
curl -fsSL --create-dirs -o ~/bin/yarn \
https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn-1.22.19.js
chmod +x ~/bin/yarn
echo ~/bin >> "${GITHUB_PATH}"
- name: Use specified Node.js version
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn

- name: Install dependencies
run: yarn install
Expand Down

0 comments on commit 72e1784

Please sign in to comment.