Skip to content

Commit

Permalink
Extend control over each node version
Browse files Browse the repository at this point in the history
  • Loading branch information
ppawlowski committed Jun 12, 2024
1 parent 245ff60 commit 7dcdbec
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build_node_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,36 @@ on:
required: false
type: boolean
default: false
node_version:
description: 'Node.js version'
required: false
node:
description: 'JSON array of Node.js versions and parameters'
required: true
type: string
default: '[18]'
default: '[{"version": "18", "test": true, "lint": true}]'

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: ${{ fromJson(inputs.node_version)}}
node-version: ${{ fromJson(inputs.node)}}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version}}
- name: Use Node.js ${{ matrix.version}}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.version }}

- name: Install Dependencies
run: npm ci

- name: Run lint
if: ${{ matrix.lint }}
run: npm run lint

- name: Run tests
if: ${{ fromJson(inputs.run_tests)}}
if: ${{ matrix.test }}
run: npm run test

0 comments on commit 7dcdbec

Please sign in to comment.