github actions/setup-node v2.2.0
Support caching dependencies and LTS aliases

latest releases: v4.0.4, v4, v4.0.3...
3 years ago

This release brings two major features:

Supported version syntax

The node-version input supports the following syntax:

major versions: 12, 14, 16
more specific versions: 10.15, 14.2.0, 16.3.0
nvm LTS syntax: lts/erbium, lts/fermium, lts/*

Caching dependencies

The action has a built-in functionality for caching and restoring npm/yarn dependencies. Supported package managers are npm, yarn. The cache input is optional, and caching is turned off by default.

Caching npm dependencies:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
  with:
    node-version: '14'
    cache: 'npm'
- run: npm install
- run: npm test

Caching yarn dependencies:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
  with:
    node-version: '14'
    cache: 'yarn'
- run: yarn install
- run: yarn test

Yarn caching handles both yarn versions: 1 or 2.

At the moment, only lock files in the project root are supported.

Don't miss a new setup-node release

NewReleases is sending notifications on new releases.