From aab1b12700c25bedeec90e9c82018c0cf3f8fd4e Mon Sep 17 00:00:00 2001 From: Alexander Akait <4567934+alexander-akait@users.noreply.github.com> Date: Wed, 8 May 2024 18:45:43 +0300 Subject: [PATCH] ci: fix (#1099) --- .github/workflows/nodejs.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 624a871f..71abb2bf 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -67,7 +67,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [12.x, 14.x, 16.x, 18.x, 20.x] + node-version: [12.x, 14.x, 16.x, 18.x, 20.x, 22.x] webpack-version: [latest] runs-on: ${{ matrix.os }} @@ -82,11 +82,21 @@ jobs: run: git config --global core.autocrlf input - uses: actions/checkout@v4 - + - uses: actions/github-script@v7 + id: calculate_architecture + with: + result-encoding: string + script: | + if ('${{ matrix.os }}' === 'macos-latest' && ('${{ matrix['node-version'] }}' === '12.x' || '${{ matrix['node-version'] }}' === '14.x')) { + return "x64" + } else { + return '' + } - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} + architecture: ${{ steps.calculate_architecture.outputs.result }} cache: "npm" - name: Install dependencies @@ -110,7 +120,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [12.x, 14.x, 16.x, 18.x, 20.x] + node-version: [12.x, 14.x, 16.x, 18.x, 20.x, 22.x] runs-on: ${{ matrix.os }} @@ -120,11 +130,21 @@ jobs: run: git config --global core.autocrlf input - uses: actions/checkout@v4 - + - uses: actions/github-script@v7 + id: calculate_architecture + with: + result-encoding: string + script: | + if ('${{ matrix.os }}' === 'macos-latest' && ('${{ matrix['node-version'] }}' === '12.x' || '${{ matrix['node-version'] }}' === '14.x')) { + return "x64" + } else { + return '' + } - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} + architecture: ${{ steps.calculate_architecture.outputs.result }} cache: "npm" - name: Install dependencies