diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index e9c2e3e2..bfff9f9d 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -51,12 +51,25 @@ jobs: run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false" shell: bash - if: steps.packagejson.outputs.exists == 'true' + name: Check package-lock.json lockfileVersion + id: packagelockjson + shell: bash + run: | + grep '"lockfileVersion": 1' package-lock.json && echo "::set-output name=lockfileVersion::1" || echo "::set-output name=lockfileVersion::2" + - if: steps.packagejson.outputs.exists == 'true' && steps.packagelockjson.outputs.lockfileVersion == 1 name: Setup Node.js uses: actions/setup-node@v2 with: node-version: 14 cache: 'npm' cache-dependency-path: '**/package-lock.json' + - if: steps.packagejson.outputs.exists == 'true' && steps.packagelockjson.outputs.lockfileVersion == 2 + name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies id: first-installation diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index b1a51693..8b3523d2 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -45,12 +45,25 @@ jobs: run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false" shell: bash - if: steps.packagejson.outputs.exists == 'true' + name: Check package-lock.json lockfileVersion + id: packagelockjson + shell: bash + run: | + grep '"lockfileVersion": 1' package-lock.json && echo "::set-output name=lockfileVersion::1" || echo "::set-output name=lockfileVersion::2" + - if: steps.packagejson.outputs.exists == 'true' && steps.packagelockjson.outputs.lockfileVersion == 1 name: Setup Node.js uses: actions/setup-node@v2 with: node-version: 14 cache: 'npm' cache-dependency-path: '**/package-lock.json' + - if: steps.packagejson.outputs.exists == 'true' && steps.packagelockjson.outputs.lockfileVersion == 2 + name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies run: npm install @@ -82,10 +95,25 @@ jobs: id: packagejson run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false" - if: steps.packagejson.outputs.exists == 'true' + name: Check package-lock.json lockfileVersion + id: packagelockjson + shell: bash + run: | + grep '"lockfileVersion": 1' package-lock.json && echo "::set-output name=lockfileVersion::1" || echo "::set-output name=lockfileVersion::2" + - if: steps.packagejson.outputs.exists == 'true' && steps.packagelockjson.outputs.lockfileVersion == 1 name: Setup Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: node-version: 14 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + - if: steps.packagejson.outputs.exists == 'true' && steps.packagelockjson.outputs.lockfileVersion == 2 + name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies run: npm install diff --git a/.github/workflows/if-nodejs-version-bump.yml b/.github/workflows/if-nodejs-version-bump.yml index fbf68224..8ed8fb50 100644 --- a/.github/workflows/if-nodejs-version-bump.yml +++ b/.github/workflows/if-nodejs-version-bump.yml @@ -25,12 +25,25 @@ jobs: id: packagejson run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false" - if: steps.packagejson.outputs.exists == 'true' + name: Check package-lock.json lockfileVersion + id: packagelockjson + shell: bash + run: | + grep '"lockfileVersion": 1' package-lock.json && echo "::set-output name=lockfileVersion::1" || echo "::set-output name=lockfileVersion::2" + - if: steps.packagejson.outputs.exists == 'true' && steps.packagelockjson.outputs.lockfileVersion == 1 name: Setup Node.js uses: actions/setup-node@v2 with: node-version: 14 cache: 'npm' cache-dependency-path: '**/package-lock.json' + - if: steps.packagejson.outputs.exists == 'true' && steps.packagelockjson.outputs.lockfileVersion == 2 + name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies run: npm install