mirror of
https://github.com/actions/setup-node.git
synced 2025-11-07 13:06:55 +00:00
Set up your GitHub Actions workflow with a specific version of node.js
|
|
||
|---|---|---|
| __tests__ | ||
| docs | ||
| externals | ||
| lib | ||
| node_modules | ||
| src | ||
| toolkit | ||
| .gitignore | ||
| .prettierrc.json | ||
| action.yml | ||
| jest.config.js | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
@actions/setup-node
This action sets by node environment for use in actions by:
- optionally downloading and caching a version of node - npm by version spec and add to PATH
- TODO: registering problem matchers for error output
- TODO: configuring authentication for npm packages
- TODO: configuring proxy if the runner is configured to use a proxy (coming with private runners)
Usage
See action.yml
Basic:
actions:
- uses: actions/setup-node@latest
with:
version: 10.x
- run: npm install
- run: npm test
Matrix Testing:
workflow:
build:
strategy:
matrix:
node: [ 10, 8 ]
name: Node ${{ matrix.node }} sample
actions:
- name: Setup node
uses: actions/setup-node@latest
with:
version: ${{ matrix.node }}
- run: npm install
- run: npm test
License
The scripts and documentation in this project are released under the MIT License
Contributions
Contributions are welcome! See Contributor's Guide