Giter Club home page Giter Club logo

voltash's Introduction

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

Inputs

parameter description required default
volta-version Version of volta to fetch and setup. Examples: 0.6.0, 10.15.1, >=10.15.0 false
node-version Version Spec of the node version to use. Examples: 10.6.x, 10.15.1, >=10.15.0 false
npm-version Version Spec of the npm version to use. Examples: 7.5.x, 7.5.3, >=7.5.3 false
yarn-version Version Spec of the yarn version to use. Examples: 1.6.x, 10.15.1, >=10.15.0 false
package-json-path The path to the package.json to update when using an explicit node-version yarn-version npm-version override. By default, we will use package.json in the checkout root.
variant Specific variant to install. Example: providing the variant "linux-openssl-rhel", which will target installing the volta-${version}-linux-openssl-rhel.tar.gz tarball false
registry-url Optional registry to set up for auth. Will set the registry in a project level .npmrc file, and set up auth to read in from env.NODE_AUTH_TOKEN false
scope Optional scope for authenticating against scoped registries. Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/). false
token Used to avoid low rate limiting for cached tool downloads. Since there's a default, this is typically not supplied by the user. false ${{ github.token }}
always-auth Set always-auth in npmrc false false

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@v4
- uses: volta-cli/action@v4
- 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@v4
- uses: volta-cli/action@v4
  with:
    node-version: 18.x
    yarn-version: 1.19.1

- run: yarn install
- run: yarn test

Setting up a matrix of node versions:

strategy:
  matrix:
    node-version: ['^14.10', '16', '18']

steps:
- uses: actions/checkout@v4
- uses: volta-cli/action@v4
  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@v4
- uses: volta-cli/action@v4
  with:
    node-version: ${{ matrix.node-version }}
    npm-version: '7'

- run: npm install
- run: npm test

In some cases, you may know the particular variant of the installer that you want to use for Volta. You can specify the variant input to the action to use a specific installer:

steps:
- uses: actions/checkout@v4
- uses: volta-cli/action@v4
  with:
    variant: 'linux-openssl-rhel'

- run: yarn install
- run: yarn test

The variant fragment corresponds to a portion of the installer filename, and can be found in the Volta Releases page.

License

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

voltash's People

Contributors

rwjblue avatar dependabot[bot] avatar scalvert avatar internetbuilder avatar alexlafroscia avatar zaubernerd avatar pzuraq avatar felipecrs avatar maxwell2022 avatar otahontas avatar jeevcat avatar turbo87 avatar stijnvn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.