Skip to content

GitHub Action to Setup Volta

License

Notifications You must be signed in to change notification settings

formsort/volta-cli-action

 
 

Repository files navigation

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

About

GitHub Action to Setup Volta

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 87.9%
  • Shell 6.9%
  • JavaScript 5.2%