fix(test): added npm init parity test #254
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
setup: | |
name: Setup | |
runs-on: ubuntu-latest | |
outputs: | |
nodes: ${{ steps.nodes.outputs.nodes }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
- name: Setup Node Version Matrix | |
id: nodes | |
run: | | |
NODES=$(npx -y @pkgjs/nv ls supported | jq '. | .version' | paste -sd "," -) | |
echo "nodes=[${NODES}]" >> $GITHUB_OUTPUT | |
test: | |
runs-on: ubuntu-latest | |
needs: setup | |
strategy: | |
matrix: | |
node-version: ${{ fromJson(needs.setup.outputs.nodes) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: npm install and test | |
run: npm it |