setup-node/README.md

59 lines
1.1 KiB
Markdown
Raw Normal View History

# setup-node
2019-05-30 23:10:12 -04:00
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
- registering problem matchers for error output
2019-05-30 23:10:12 -04:00
# Usage
See [action.yml](action.yml)
Basic:
```yaml
2019-07-25 21:00:00 -04:00
steps:
2019-07-23 15:45:28 -04:00
- uses: actions/checkout@master
- uses: actions/setup-node@master
2019-05-30 23:10:12 -04:00
with:
version: 10.x
- run: npm install
- run: npm test
```
Matrix Testing:
```yaml
jobs:
2019-05-30 23:10:12 -04:00
build:
strategy:
matrix:
node: [ 10, 8 ]
name: Node ${{ matrix.node }} sample
2019-07-25 21:00:00 -04:00
steps:
2019-07-23 15:45:28 -04:00
- uses: actions/checkout@master
2019-05-30 23:10:12 -04:00
- name: Setup node
2019-07-23 15:45:28 -04:00
uses: actions/setup-node@master
2019-05-30 23:10:12 -04:00
with:
version: ${{ matrix.node }}
- run: npm install
- run: npm test
```
2019-07-29 10:50:34 -04:00
Get the LTS version:
```yaml
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
version: lts
- run: npm install
- run: npm test
```
2019-05-30 23:10:12 -04:00
# License
The scripts and documentation in this project are released under the [MIT License](LICENSE)
# Contributions
Contributions are welcome! See [Contributor's Guide](docs/contributors.md)