Skip to content

Commit

Permalink
Update workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Nov 23, 2024
1 parent f024901 commit 03c5a8d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,32 @@ 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
# install dependencies. Otherwise, `npm install` is executed.
#
# [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

0 comments on commit 03c5a8d

Please sign in to comment.