Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
zap

GitHub Action

@volta-cli/action

v2.0.2

GitHub Action to Setup Volta

GitHub Actions status

This action installs volta by:

  • downloading and caching volta (adding it to your $PATH)
  • optionally downloading and caching a version of node - npm by version spec and add to PATH

Usage

See action.yml

Basic (when the project's package.json has a volta property with node and/or yarn versions pinned):

steps:
- uses: actions/checkout@v1
- uses: volta-cli/action@v1
- run: npm install
- run: npm test

Manually specifying node and/or yarn versions (e.g. to test a project without volta in package.json):

steps:
- uses: actions/checkout@v1
- uses: volta-cli/action@v1
  with:
    node-version: 10.x
    yarn-version: 1.19.1

- run: yarn install
- run: yarn test

Setting up a matrix of node versions:

strategy:
  matrix:
    node-version: ['^8.12', '10', '12']

steps:
- uses: actions/checkout@v1
- uses: volta-cli/action@v1
  with:
    node-version: ${{ matrix.node-version }}

- run: npm install
- run: npm test

You can also specify the version of npm:

strategy:
  matrix:
    node-version: ['^8.12', '10', '12']

steps:
- uses: actions/checkout@v1
- uses: volta-cli/action@v1
  with:
    node-version: ${{ matrix.node-version }}
    npm-version: '7'

- run: npm install
- run: npm test

License

The scripts and documentation in this project are released under the MIT License