Skip to content

Commit

Permalink
Merge pull request #51 from FlowFuse/feat-build-node-multiple-node-ve…
Browse files Browse the repository at this point in the history
…rsions

feat: add possibility to test node packages against multiple node versions
  • Loading branch information
hardillb committed Jun 12, 2024
2 parents b97f26d + 61be60b commit a59c5b6
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/build_node_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,37 @@ name: Build and test npm package
on:
workflow_call:
inputs:
run_tests:
description: 'Run tests'
node:
description: 'JSON array of Node.js versions and parameters'
required: false
type: boolean
default: false
type: string
default: '[{"version": "18", "tests": true, "lint": true}]'

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [16.x]
node: ${{ fromJson(inputs.node)}}
name: Build on ${{ matrix.node.version }}

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

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

- name: Install Dependencies
run: npm ci

- name: Run lint
if: ${{ fromJson(matrix.node.lint) }}
run: npm run lint

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

0 comments on commit a59c5b6

Please sign in to comment.