From 03c5a8d957c6af9ee6d43081f7a3490cc8ca02c8 Mon Sep 17 00:00:00 2001 From: Jared Hanson Date: Fri, 22 Nov 2024 16:38:28 -0800 Subject: [PATCH] Update workflow. --- .github/workflows/node.js.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 8b12371..fbff5c3 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -80,7 +80,19 @@ jobs: N_MAJOR: ${{steps.lockfile-version.outputs.version}} run: echo "lockfile - $N_MAJOR" - - run: npm ci + - id: clean-install-v3 + name: Clean install with lockfileVersion >= 3 + run: npm ci + if: steps.lockfile-version.outputs.version >= 3 && steps.npm-version.outputs.major >= 7 + + - id: clean-install-v3-compat + name: Install with lockfileVersion >= 3 + run: npm install + if: steps.lockfile-version.outputs.version <= 3 && steps.lockfile-version.outputs.version != null && steps.npm-version.outputs.major < 7 && steps.npm-version.outputs.major >= 5 + + - id: clean-install + name: Clean install + run: npm ci # The [`ci`][1] command was [introduced][2] with npm@5, and is intended to # be used in continuous integration environments. If npm@5 or later is # installed and the package-lock.json file exists, `npm ci` is executed to @@ -88,9 +100,12 @@ jobs: # # [1]: https://docs.npmjs.com/cli/v10/commands/npm-ci # [2]: https://blog.npmjs.org/post/171556855892/introducing-npm-ci-for-faster-more-reliable + #if: steps.npm-version.outputs.major >= 6 if: steps.lockfile-version.outputs.version != null && steps.npm-version.outputs.major >= 5 + && steps.clean-install-v3.outcome == 'skipped' && steps.clean-install-v3-compat.outcome == 'skipped' - run: npm install + name: Install if: steps.lockfile-version.outputs.version == null || steps.npm-version.outputs.major < 5 - run: npm test