From 7dcdbec484483a9fa7d908855fd3c5c1d7bb084f Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Wed, 12 Jun 2024 10:26:36 +0200 Subject: [PATCH] Extend control over each node version --- .github/workflows/build_node_package.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_node_package.yml b/.github/workflows/build_node_package.yml index 2d020c6..de83381 100644 --- a/.github/workflows/build_node_package.yml +++ b/.github/workflows/build_node_package.yml @@ -8,11 +8,11 @@ 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: @@ -20,23 +20,24 @@ jobs: 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