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
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
The scripts and documentation in this project are released under the MIT License